Here are few short-cuts to enhance your command line skills:
To open the default editor:
To execute the last command again
To use the last string of command:
$ !$ # (or) Alt+.(dot)
$ Ctrl-f # -> Forward one character. $ Ctrl-b # -> Backwards one character. $ Ctrl-a # —> Move to the beginning of the line. $ Ctrl-e # —> Move to the end of the line.
History command displays the commands you entered recently. You needn’t enter the commands again and again or keep pressing arrow key to find your mile long command, you can search in reverse.
Incremental reverse search.
For non-Incremental reverse search type ! and few characters of the command;
Shift-Page up Shift-Page Down
Reboot the system
Ctrl + Alt + Del
[Note: By /etc/inittab, you can change the behaviour to shutdown.]
For next X-Server resolution
Copy and paste:
To cut text is know as “killing”. To paste is known as “yanking”, these are emacs terms, which now sticks with bash and other shells too.
- Cut the text from the current cursor position to the end of the line, and copy it to the buffer.
- Kill from the cursor to the end of the current word, or, if between words, to the end of the next word. Word boundaries are the same as those used by Alt+f.
- Kill from the cursor to the start of the current word, or, if between words,
to the start of the previous word. Word boundaries are the same as those used by
- Kill from the cursor to the previous whitespace. This is different than
Alt-DELbecause the word boundaries differ.
- Yank the most recently killed text back into the buffer at the cursor.