This is my approach, and for those who don’t know, you can use those line numbers that come back from history to rerun the command. Like if your output is something like this:
$ history | grep tmp
501 ls /tmp
502 history | grep tmp
Wait until you learn about ctrl-R to search the bash history… :) If you press that and start typing, you will get auto complete from previous commands you typed. This is how an experienced linux user can be so fast in the terminal.
There are even better tools for this, so ctrl R is just the built in way. Later you should look into https://github.com/junegunn/fzf
deleted by creator
This is my approach, and for those who don’t know, you can use those line numbers that come back from
historyto rerun the command. Like if your output is something like this:$ history | grep tmp 501 ls /tmp 502 history | grep tmpYou can run
!501and it will just re-runls /tmpWoah! I had no clue!
I got that as
hgrepdeleted by creator
Yall are missing out on autocomplete.
deleted by creator
didn’t know there was a comment for that, I just always used cat to read the bash history file
Wait until you learn about ctrl-R to search the bash history… :) If you press that and start typing, you will get auto complete from previous commands you typed. This is how an experienced linux user can be so fast in the terminal.
There are even better tools for this, so ctrl R is just the built in way. Later you should look into https://github.com/junegunn/fzf
deleted by creator