Linux File-related operation file operation to enter the directory cd directory name example: cd/home to home cd without parameters, to the previous directory cd-cut to the previous directory cd .. view the directory or file in the upper-level directory. Format: ls [Option] [directory or file]. Example: 1. ls/home display/home directory files and directories (excluding hidden files) 2. ls-a/home display all files and directories under the/home Directory (including hidden files) 3. ls-l/home display/home directory file and directory details 4. ls-c/home display files and directories in the/home directory, view the files in the current directory in the order of modification time. The ll [-alm] option is in the same format as the ls display directory or file attribute lsattr: lsattr [Option] [directory or file]-a displays all files and directories-d, directory name, not its content-l this parameter currently does not have any Use-R recursive processing to process all the files and subdirectories in the specified directory together-v display file or directory version-V display version letter Create File touch file name format: touch [Option] File Name example: touch/home/test.txt create a test file in the/home directory to delete the file rm [-fr] File Name format: rm [Option] File Name example: rm/home/test Delete the test file-d or -- directory under the/home directory and delete the hard connection data of the directory to be deleted to 0. -F or -- force forcibly deletes a file or directory. -I or -- interactive ask the user before deleting an existing file or directory. To delete a non-empty directory, add-r,-R, or -- recursive processing to process all the files and subdirectories in the specified directory. -V or -- verbose displays the command execution process. File Operation content vi file go to vi editor View File Content cat file name one screen View File Content more file name Page View File Content less file name controllable Page View File Content q exit grep character file name according to character match view the file content and create the directory mkdir. The format of the directory name is as follows: mkdir [Option] Directory Name example: 1. mkdir/home/workdir create the workdir directory under the/home directory 2. mkdir-p/home/dir1/dir2-p command. If dir1 does not exist, create the dir1 directory or file [name/suffix] rename or mv1.mv aaa.txt bbb.txt to modify the file name and change aaa.txtto bbb.txt 2. rename a.txt B .txt * modify a single file 3. rename: rename test.tar.gz to backup.tar.gz # rename t Est backup * .tar.gz modifies the files suffixed with. htm # rename. html. htm * or rename html htm *. format: rmdir [Option] Directory Name example: rmdir/home/workdir delete/rmdir in the home directory cannot delete non-empty directories, delete non-empty directory use rm directory name-r copy file or directory cp source file new directory format: cp [Option] source file or directory target file or directory example: 1. cp/home/test/tmp/copy the test file under the/home directory to the/tmp directory 2. cp-r/home/dir1/tmp/copy the dir1 directory under the/home directory to the/tmp directory to move the file or the target directory format of the mv source file: mv [Option] source file or directory target file or directory example: 1.mv/home/test/home/test1 rename the test file in the/home directory to test1 2.mv/home/dir1/tmp/move the dir1 directory in the/home Directory (CUT) package tar [-cf] [directory/file] In the/tmp directory. Format: tar [Option] file or directory example: Ø tar-cf all.tar *. jpg splits all. jpg files into a package named all.tar. -C indicates that a new package is generated.-f indicates that the file name of the package is Ø tar-rf all.tar *. gif, which adds all .gif files to the package of all.tar. -R indicates to add a file. Ø tar-uf all.tar logo.gif is updated to the logo.gif file in tarbao all.tar.-u indicates to update the file. Ø tar-tf all.tar indicates to output all files in the all.tar package, -t is used to list all files in the all.tar package, -x is undo meaning-c create a new archive file-r append a file to the end of the archive file-u update the file in the package-t view the package file-x extract the file from the archive file -O unlocks the file to the standard output-v process to output the relevant information-f operations on the common file-z calls gzip to compress the archive file, when used with-x, gzip is called to complete decompression-Z is called to compress the archive file. When used with-x, compress is called to complete decompression. gzip compression format: gzip option file directory list-c compression results written to the standard output, the original file remains unchanged. When the upload is complete, gzipzip compresses the original file into a. GZ file and deletes the original file. -V outputs the processing information. -D. decompress the specified file. -T to test the integrity of the compressed file. Gunzip decompression format: gzip option file directory list-c writes the output to the standard output, and the original file remains unchanged. Lack of time, gunzip will convert the compressed file into a decompressed file. -L list compressed files without decompression. -R recursive decompression: go deep into the directory structure and decompress the command line to change the files in all subdirectories in the specified directory. Find-name '.? *. Out. * 'search for all files named ". out ."