Linux File Processing commands touch cat tac more less head tail and tactail
Touch
Command name: touch
Path:/bin/touch
Execution permission: All Users
Function Description: creates an empty file.
Syntax: touch [file name]
Touch test.txt
Touch/root/test.txt? ? Create the test.txt file under the rootdirectory
Touch test test1 test2 create multiple files
Touch "program file" creates a file with spaces
----------------------------------------------------------------------
Cat?
Command name: cat
Path:/bin/cat
Execution permission: All Users
Function Description: displays the file content.
Syntax: cat [-n]? [Test1.txt]? ? ??
? ? ? ? ? ? ? ? ? ? ? -N: display the row number
Cat/etc/issue? Show System Version
Cat-n/etc/issue
--------------------------------------------------
Tac
Command name: tac
Path:/usr/bin/tac
Execution permission: All Users
Function Description: displays the file content? Opposite to cat? Reverse display
----------------------------------------------------------
More
Command name: more
Path:/bin/more
Execution permission: All Users
Function Description: displays the file content by page.
Syntax: more [file name]
? ? ? ? ? ? ? ? (Space) or f? ? Flip
? ? ? ? ? ? ? ? ? (Enter )? ? Line feed
? ? ? ? ? ? ? ? ? ? Q or Q? ? ? ? ? Launch
More/etc/services
-------------------------------------------------
Less
Command name: less
Path:/usr/bin/less
Execution permission: All Users
Syntax: less [file name]
Function Description: displays the file content by PAGE (pages can be turned up). You can use/[search content] to search for the next file by n.
Example: less/etc/services,
? ? ? ? ? ? The operation is the same as that of more. For less operations, you can flip pages by PAGE pageup, or click the up arrow to flip pages online by line.
? ? ? ? ? ? Available? /[Search content], press n to continue searching
-------------------------------------------------
Head
Command name: head
Path:/usr/bin/head
Execution permission: All Users
Function Description: displays the first few lines of a file.
Example: head-n 20/etc/services? (Display the first 20 rows of/etc/services)
? ? ? ? ? ? Head/etc/services? ? The first 10 rows are displayed by default.
---------------------------------------------------------------------
Tail?
Command name: tail
Path:/usr/bin/tail
Execution permission: All Users
Function Description: displays the following lines of a file.
Syntax: tail [file name]
? ? ? ? ? ? -N: number of specified rows
? ? ? ? ? ? ? -F dynamically displays the content at the end of the file
Example: tail-n 18/etc/services (18 rows at the end)
? ? ? ? ? ? Tail-f/var/log/messages? Dynamic Display of 10 lines at the end
? ? ? ? ? ? Tailf/etc/services dynamically displays the last 10 lines
? ? ? ? ? ? ??