Linux basic commands explain "two" (Linux command in the directory and file management uses)

Linux basic commands explain "two"
of content:
Linux directory structure
to view and retrieve files
backup and recovery documentation
vi text editor,
a, Linux directory structure : a directory tree structure (top-down)
Common subdirectories and action:
A, / root: a host system administrator root directory
b, / home: general user's home directory
c, / boot: kernel / boot file
d, / dev: device file
e, / etc: configuration file
f, / bin: All users can perform commands
g, / sbin: administrators can perform administrative commands
h, / usr: application
i, / var: log file (commonly known as variable-length file directory)
J, / proc: hardware configuration information
k, / tmp: temporary files
l, / lib: library
m, / media: multimedia

Second, view and retrieve files:
1, view the file contents of the command:
A, CAT : connection and display information file, all the information is displayed in the document
commonly used options:
-n: to display when the display line number, the line number just show up with the contents of the file does not matter
-E: show line endings of each line, so the Chinese linux line endings of this document is $ symbol
-T: can display tabs
-v: show other non-printing characters
- a: displays all symbols
disadvantages: Init interface 3: when you view the file is too large, beyond the screen load range, there will be content display problems and can not use the wheel to mobilize the page. Commonly used in short text file.
Linux basic commands explain "two" (Linux command in the directory and file management uses)
b, More : with a full-screen page display file contents. The disadvantage is that you do not see the last page of content. It will exit to the last page.
Interactive methods of operation:
· Press the enter key to scroll down line by line
· Press the spacebar to turn down a screen
-press q to exit
Linux basic commands explain "two" (Linux command in the directory and file management uses)
c, less : the same as the more command, but extended functionality more
interactive methods of operation:
* Page up : Page up
· page down: down
* /: Find what n: content next N: a content
-more other functions substantially similar to
Linux basic commands explain "two" (Linux command in the directory and file management uses)
Linux basic commands explain "two" (Linux command in the directory and file management uses)
D, head : show a few lines before the file, the default is 10 lines
-n : how many lines before displaying
Linux basic commands explain "two" (Linux command in the directory and file management uses)
e,tail : display a few lines of the file, the default is 10 lines
-n: display how many rows after
-f: view the end of the file, but does not exit, waiting for new content subsequent additional display;
Linux basic commands explain "two" (Linux command in the directory and file management uses)
2, statistical contents of the file command:
WC : statistics file the number of words (word count) and other information (without any password by default, after a wc view all forms)
common options:
· the -l: statistics rows
· -w: statistics number of words
· -c: count the number of bytes
Linux basic commands explain "two" (Linux command in the directory and file management uses)
Linux basic commands explain "two" (Linux command in the directory and file management uses)
3, search and filter the contents of the file command:
grep : find and contain the specified string lines appear in the file
common options:
· -i: ignore when looking for size
· -v: reverse lookup, the line does not match the output and search criteria

Guess you like

Origin blog.51cto.com/14475876/2430053