Unix keyboard shortcuts

Esc := à After opening the file, Press Esc button and colon (:) and equal symbol (=) will give you the total number of lines in the file.

Esc :q! à After opening the file, if you press Esc colon and letter q and exclamatory symbol (!), will quit the file without saving.

Esc :w à To save the file.

Esc :wq! à To save an quit the file.

Shift+g -à To go to the last line of the file.

Shift+a -à To go to the end of the line.

:0 -à To go back to the first line of the file.

Esc i à To edit the file.

Esc dd à To delete the whole line from the file.

Esc r à To replace the particular character in the file.

Shift+w à To go to the next word in the file.

Shift +d à To remove the remaining characters of the line from the file.

Ctrl+g à To know which line number we are in from the file.

Ex:

Esc :set nu à To add the line number in the file.

Esc :set nonu à To remove the line number added using above command.

Esc u à To undo the changes made in the file.

Shift+d à To empty the line from the file.

j à To go to next line in the file.

k à To go to previous line in the file.

Ctrl+f à To go forward. To go to next page in the file.

Ctrl+b à To go backward. To go to previous page in the file.

/search keyword à To search the keyword after opening the file. After searching a keyword, if you press “n” it will search forward inside the file. If you press “shift+n”, it will search backward inside the file.