Last active
December 6, 2021 19:09
-
-
Save dandosi/fa690a92d9a99435c39db7e59203290a to your computer and use it in GitHub Desktop.
sort using a field in the middle of the line, sort your history
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if you're looking for the last test you executed in December, BUT your history shows "the command number" first | |
# so, you have to sort by... The *Third field* 😊 | |
# This avoids a problem if you've closed multiple shells, so the order of the commands in history is not chronological | |
history | grep gradlew | grep test | grep "12/" | sort -k 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment