Touch/bin/touch Creating an empty file
Linux Create files can use special symbols, except
Touch test Test1 created two files
Touch "Test Test1" creates a file with spaces in the file name
Touch ' Test test1 ' created a file with spaces in the file name
Cat/bin/cat displaying file contents
-N Display Line number
TAC upside down shows that this command does not support-n
Cat-n/etc/services
Tac/etc/services
Cat is suitable for viewing files with less content
More/bin/more page display of file contents
Space or F page
Carriage return line break
Q or Q exit
More/etc/services
More can't page up, not support pageup/pagedown/↑/↓
Less/usr/bin/less page displays the contents of the file, in addition to having more features, you can also page up, support pageup/pagedown/↑/↓
Less/etc/services
In addition, less also supports search, such as enter a/a enter, and then enter N to indicate the next
Head/usr/bin/head display the first few lines of the file
-n Specifies the number of rows
Head-n 20/etc/services default 10 rows
Tail/etc/services Show the end of the file a few lines
-N Default 10 rows
-F dynamically displays the end of the file, head does not support this option
Tail-f/var/log/messages
Linux file Operations Command Touch, cat, more, less, head, tail