A rookie to learn programming techniques, record and share knowledge to everyone, hope you can enjoy.
Today to write an article on the basis of learning Linux commands - Bowen working directory commands, but also a lot of practice, summed up for everyone to learn together!
When using the following commands, you can use the alias
command to view the Properties command you want to use.
cat命令
To view plain text files (less contents)
-n
Or-number
: starting from number 1 to number all output linescat
: Entering the interactive modeCtrl + C
: The trap command executionCtrl + D
: Exit interactive modecat >test.txt
: The content written to the test.txt file,Ctrl + D
save and exit
more命令
To view plain text files (more content); format: more [options] file
[Basic Instructions]
- space -> Next to display
- enter -> scroll down one line
- b -> a back display
- q -> Stop showing
less命令
Paging file output for display, using the [pageup]和[pagedown]
other key file can look back and forth, using the 'q'
exit status view;
head命令
To display the contents of a file header (default 10 lines); head [mandatory option] [select Options] File
-n
: The number of lines designated by numbers embodiment shown:head -4 /etc/passwd
tail命令
Tail is used to display the contents of the file (the default line 10); Format: head [mandatory option] [select Options] File
-n
: The number of lines designated by numbers embodiment shown:tail -4 /etc/passwd
wc命令
Number of specified number of lines for text, bytes; Format: wc [Option] Text
-l
: Displays the number of rows-w
: Displays the number of words-c
: Only bytes
cut命令
Press for the "column" extract text character; Format: cut [parameters] Text
-b
: Divided in units of bytes-c
: The characters are divided into units-d
: Custom delimiter, default tab-f
And-d
used together: the designated display area
diff命令
It used to compare two different file contents; Format: diff [options] source file destination
-y
: In a parallel way to show similarities and differences files-b
: Ignore spaces get a different result-B
: Ignore spaces different result-q
: Report only what different places, does not report specific information-i
: Ignore case changes-W
: The use-y
when parameter specifies the column width