Linux shell history - Trick

in jrswab •  7 years ago 

To display the history of commands with date and time -

  1. history

  2. cat~/.bash_history

  3. history number_of_command_to_display
    Like this "history 2" - will display first and second command

To clear the history:
rm ~/.bash_history && history -c

To execute the 10 th command in the history, just type - "!10"

Using grep to find the specific command

To save the history in a file
history > list.txt

Some command needs root permission..

Good day

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @shanmugaraj! You received a personal award!

1 Year on Steemit

Click here to view your Board of Honor

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @shanmugaraj! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!