centOS 7 directory file management commands

cat; more; less; head; tail; wc; grep; bzip2; tar; vi; simple operation vim command
1.cat
see all of the contents of the file; unsuitable for reading at length files
centOS 7 directory file management commands
2.more
can be paged view; strong flexibility; spacebar to turn the pages; see line by line using the enter key; to exit Review using q
centOS 7 directory file management commands
3.less
support page view; support up and page down; find support content; pgup page up; pgdown turned down page
centOS 7 directory file management commands
using 4.cat and more binding
centOS 7 directory file management commands
5.head
view the start line, 10 lines before the default view data
centOS 7 directory file management commands
6.tail
view the end of the line, the default view 10 rows
centOS 7 directory file management commands
centOS 7 directory file management commands
7.wc statistics file
wc common option
-l statistical lines; -w count the number of words; -c count size
centOS 7 directory file management commands
8.grep
grep common option
-i to ignore case
-v reversed, inverted
centOS 7 directory file management commands
centOS 7 directory file management commands
centOS 7 directory file management commands
9.gzip file compression and decompression
gzip common options
-q high compression
-d decompress compressed files
centOS 7 directory file management commands
10 .bzip2 common options
-q high compression
-d decompress
centOS 7 directory file management commands
11.tar archive command common options
-c creating an archive
-x extract the files
-C extracted to the specified directory
-v displays detailed information
-z to use gzip compression and decompression to create file
-j Use bzip2 compressed or decompressed file is created
-p compressed file directory permissions remain unchanged
-t view a list of data compression
-P remains compressed source file directory does not change
centOS 7 directory file management commands
12.vi and vim
three modes of vi
1) command mode
to adjust the cursor position; copy, delete, paste using
2) insert mode
edit text using; add, modify, update data using
3) line mode
to save files using a text search to replace
switching between 4) mode
command to enter the insert mode
i is inserted in front of the cursor transactions; a is inserted in the end of the line cursor data; o next line of cursor line data is inserted into
the input mode retreat command mode
using the key esc
5) line mode
using the input esc:
6) line jump
^ reaches the first row; o reaches the first row; $ T reaches the end of the line;
Room 7) line jump
gg quick access to the first line; G to quickly reach the end of the line; logG quickly reach line 10
8) copy
yy copying a row of data; 5yy copy cursor five lines
9 ) paste
P
10) delete
dd delete the entire row of data
x delete cursor position data
d ^ cursor is deleted before the data
d $ delete data after the cursor
11) delete undo
undo once with u
undo several times with u (uppercase )
12) line mode
: W Save
: x save and quit
: wq save and quit
: wq! Forced to save and exit
: q! Forced to exit
and: q editing without saving
13) Alternatively
: 1,20 s / h / bb / g to 1 h to 20 into line BB
: S% / b / dd / G into the entire file dd b

Guess you like

Origin blog.51cto.com/14156658/2405579