Tuesday, February 26, 2013

Some useful BASH shell hot keys and useful tips.

Check out these hot keys. They can help a lot to save your time.
Since I started using them, I'm just a new man :)

This one is so important, that I'll write it separately.
Ctrl+R To search in previous commands. It displays the last occurrence.
Ctrl+R+R It displays the occurrence before the last.

These commands are also very useful. When I say they are "useful", I really mean that I use them! :)
Ctrl+K To delete the characters from the cursor to the end of the line.
ESC+D To delete the characters from the cursor position to the end of the word
Ctrl+A To move the cursor to the beginning of the command line
Ctrl+E To move the cursor to the end of the command
Ctrl+L To clear the screen, puts the current command line at the top of the screen

And I've got one additional tip for you. Use aliases!
Don't be lazy. It's so worth it!
To create your own alias, edit the file ~/.bashrc. Put there your alias.
Here is my alias that I use very frequently:
 alias pr='cd /var/www/myprojects' 
In this file you can see already added aliases. To check them out, you can also use alias command.