Linux Common Command Learning record
brother even Linux training, small compiled a common Linux Learning Commands:
1 CP Copy command
parameter:-P file attributes are copied together
-R Copy Folder
-D soft Chain information, etc. copy together
-A is a shorthand for-RDP
2 Find File Lookup commands
general Search by file name (Exact search)
Find/home-name xx.xx
General Branch file name lookup (Fuzzy matching, support:?) (single character), * (multiple characters), [] (matches a specific content in brackets))
Find/home-name "*.xx" All files ending with. xx
Find based on the user who owns the file
Find/home-user sls0919 Find all files sls0919 the user
Find/home-nouser Find files without owner in home directory (approximate rate is junk file)
Find by File size
Find/home-size +25k find files larger than 25k in home directory (plus sign is greater than, minus indicates less than, no symbol equals)
Find by File date
Find/home-mtime +25 Find Files modified 25 days before the home directory (plus sign is greater than, minus is less than, no symbol equals; Mtime: Modify content time, Atime: Access time, CTime: Modify attribute time)
Multi-Criteria lookup connection symbol (A==and,o==or)
Find/home-mtime +25-a-size-25k Find files that were modified 25 days ago in the home directory and size less than 25k
Find/home-mtime +25-o-size-25k Find content modified 25 days ago or files smaller than 25k in the home directory
query results and execute action commands (-exec {}\;)
Find/home-mtime +25-a-size-25k-exec ls-lh {}\; List details of files that were modified 25 days ago and size less than 25k in the home directory
3 grep Text Lookup command
-I ignores case
-V excludes the specified string
-C calculates the number of times the specified string was found
-N output Shows line number
Grep-r ' Test ' * searches the current directory and its subdirectories for files of ' test ' lines
Grep-l-R ' Test ' * searches the current directory and its subdirectories for files of ' test ' lines, but does not display matching rows, showing only matching files
Grep-n ' t[ae]st ' data.txt find information for test or tast in file Data.txt (refer to regular expression)
4 Man and help command
Mans LS
LS--help
5 zip, gzip, bzip2, tar compress unzip command
Zip compressed file name source file
-R Compression Directory
Gzip and bzip2 are both compressed files and cannot be on the directory
Common methods:
TAR-CVF compressed file name source file source file source file can be multiple
-C Compression
-X Decompression
-V Show Compression process
-f Specifies the file name after packaging
-Z compression decompression. tar.gz type File
-j compression decompression. tar.bz2 type File
The above from the Brother even forum to share
Linux Common Command Learning record