First, packaging compression decompression
① compression
TAR-CZVF Test.tar.gz./test
TAR-CJVF Test.tar.bz2./test
② Decompression
TAR-XZVF Test.tar.gz
TAR-XJVF Test.tar.bz2
-C,--create:create a new archive
-Z,--gzip:filter the archive through gzip
-V,--verbose:verbosely list files processed
-F,--file=archive:use ARCHIVE FIle or Defice ARCHIVE
-X,--extract,--get:extract files from an archive
Second, find and replace
①. Finding a file under a specified directory
Find./-name filename
②. Finding strings in files in the specified directory
Grep-r--color "Str".
③. Replacing a string in a file under a specified directory
grep-rl printf./| Xargs sed-i ' s/printf/xxxxxx/g ' --printf-->> xxxxxx
④. Replacing strings in files in a specified directory with strict matching
Grep-rl "printf"./| Xargs sed-i ' s/\<printf\>/xxxxxx/g '
grep Options Introduction
-R,-R,--recursive:read all files under each directory, recursively
-l:suppress normal output; Instead print the name of each input file from which output would normally has been printed.
Linux Common Commands Summary