Linux history tricks

September 16, 2008

1. The file contain all the history is at /home/$USER/.bash_history

2. The .bash_history file can be edited and it will reflect the output of $history command

3. Press Ctrl+r to search history in reverse manner

4. run command “!historyNumber” where history number is a number shown after command $history fired.


Command line editing tricks

September 16, 2008

1. Ctrl+a : move the command line to the beginning

2. Ctrl+e : move the command line to the end

3. Ctrl+k : remove the line from the current cursor until end of line

4. Ctrl+u : remove the line from the cursor until beginning of the line