Common Linux commands and common Linux commands
If some commands are not commonly used, you can't remember them. Every time you use them, you need to query them. Here we record some commands:
(1) tar
Tar-xvzf filename.tar.gz unzip filename.tar.gz to the current folder-C you can specify the decompressed directory tar-xvjf unzip to the current file tar-xvf filename.tar decompress filename.tar to the current folder (the end of tar indicates compression) unzip filename.zip decompress filename.zip to the current folder.-d specifies the directory to be decompressed.
Tar-cvzf filename.tar.gz. Use gzip to compress files and folders in the current directory tar-cvjf filename.tar.bz2. Use bzip2 to compress zip file.zip. Use zip to compress files.
(2) count the number of files (excluding hidden files/folders)
Ls-l | grep "^-" | wc-l count the number of files in the current directory ls-lR | grep "^-" | wc-l count the number of files in the current directory, including ls-l | grep "^ d" | wc-l in the subdirectory to count the folder under the current directory (that is, the directory) number of ls-lR | grep "^ d" | wc-l counts the number of folders (I .e. Directories) in the current directory, including