On the Linux directory file management

1, the command to view the file type
1), cat
-time view of all the contents of the file, the file is not suitable for reading at length using
2), more
can be paged look, flexibility, spacebar to turn the page, line by line view using the enter key exit viewed using q
3), less
support page viewing, support up and page down, to find support content, pgup page up, pgdown page down, q to exit Review
On the Linux directory file management
On the Linux directory file management
On the Linux directory file management
On the Linux directory file management
On the Linux directory file management
2, head and tail
1), head
to view the start OK, default 10 rows of data before viewing
2), tail
to see the end of the line, the default view 10 rows
On the Linux directory file management
On the Linux directory file management
On the Linux directory file management
On the Linux directory file management
On the Linux directory file management
3, gzip file compression and decompression
1), gzip common options
-q high compression
-d decompress compressed file
On the Linux directory file management
On the Linux directory file management
4, tar archive command
1), tar options
-c creating an archive
-x extract the files
-C extracted to the specified directory
-v displays detailed information
-Z created using gzip compression and decompression of files
-j to use bzip2 compressed or decompressed file is created
-p compressed file directory permissions remain unchanged
-t view compressed data list
-p remains compressed source file directory does not change
On the Linux directory file management
On the Linux directory file management
On the Linux directory file management
5, Linux system common text editor
1) vi
early text editor, vi default Linux systems use ed Unit
2) vim
powerful than vi, strong flexibility
6, vi three modes
1) command mode
to adjust the position of the cursor, copy, delete, paste using
2) insert mode
edit text files, add, modify, update data using
3) line mode
to save a text file using the replacement See
7, pattern switching between,
1) is inserted into the command mode
i insert data in front of the cursor
a data inserted at the end of the line the cursor
o next line of cursor data is inserted
2) within the row jump
^ reaches the first row
o reaches the first row
$ t reaches the end of the line
3) between the lines jumping
gg rapidly reaches the first row
G to quickly reach the end of the line
logg quickly reach line 10
4) copy
yy copying a row of data
5yy 5 after the cursor line data replication
5) paste
P
. 6) remove
dd delete the entire rows
x cursor data erasure position
d ^ cursor is deleted before the data
d $ delete the cursor data
7) delete undo
undo once with u
undo several times with u (uppercase)
8) line mode
: W save
: x save and exit
: wq save and quit
: wq! Forced to save and exit
: q! Force Quit
: q exit the editor without saving

Guess you like

Origin blog.51cto.com/14156658/2403016