Linux commonly used text operation commands

Linuv common file operation commands

command Parsing
cat file View the contents of the file forward from the first byte
head -2 file View the first two lines of a file
more file View the contents of a long file
tac file View the contents of a file in reverse from the last line
tail -3 file View the last three lines of a file
you file Open and browse files

The vi editor is a standard editor under all Unix and Linux systems. It is equivalent to the notepad in the windows system. Vim has the ability to edit programs. It can distinguish the correctness of grammar by font color, which is convenient for program design. As an upgraded version of vi.

vi can be divided into three states, namely, normal mode, editing mode and command line mode. Entering a file by vi command defaults to normal mode, enter any letter in [i, I, o, O, a, A, r, R] to enter edit mode, enter any letter in [: /?] To enter command mode .

Description of buttons available for switching from normal mode to command line mode
[:w] Save the edited content
[:w!] Force write to the file, but it is related to your authority to the file
[:q] Leave vi
[:q!] Do not want to save the modification and force to leave
[:wq] Save and leave
[:x] Save and leave

Guess you like

Origin blog.csdn.net/qq_41885819/article/details/112770793