Linux Files, document operation commands (1), linux commands
Open a directory (enter this directory): cd [path]
Create document: mkdir [file name]
Delete a directory (only empty directories are allowed. to delete the entire directory, You need to delete it one by one): rmdir
Create an empty file: touch [file name]
View files and directories: ls
Modify the document owner: chown
Modify the group where the document is located: chgrp
Modify the File Permission: chmod
View the default permissions of a file (a number will be returned, and the last three are the permissions not required in the directory and file, and the (-rw-) directory is (drwxrwxrwx )): unmask
Check the file content (nano editable file)
Cat: displays the file content from the first line.
Tac: displays the file content from the last line
Nl: displays the row number by the way (empty rows do not show the row number)
The cat-n file can also display the row number, and the line number of the empty row will also be displayed.
More: displays data on one page.
Less: similar to more, but can flip the page forward
Head: only view the first few rows of data (only 10 rows are displayed by default) (for example, the header-n 3 File Name Only displays the first three rows of this file)
Tail: only the last few rows
Od: Read File Content in binary mode
Search for file names
Whereis: Find a specific file
Locate: equivalent to fuzzy search. Enter the name of part of the file to obtain the path of the relevant file.
Find: search on the disk, the speed is relatively slow
Note: in linux, commands are embedded and installed. You need to configure the PATH variable for installation.