Linux file Lookup and compression

Source: Internet
Author: User

Locate non-real lookup, lookup is based on the system-wide file database,
#updatedb, build the database manually, locate Find Fast

Find: Real-time precision, support for many search criteria, traverse all files in a given directory, slow

Find Find path Lookup standard find standard find later processing operation
Find the path: Default view current directory
Find standard: Default to all files under the specified road strength
Processing operation: Default is Display

Matching Criteria:
-maxdepth level maximum Search directory depth, specified directory 1th
-mindepth level maximum Search directory depth
-name filename exactly matches the file name, supporting file name wildcard
-iname Case insensitive
-refex PATTERN for file name matching based on regular expressions
-user username based on owner lookup
-group GroupName
-uid
-gid
-nouser to find users who are not owned by the master
-nogroup
-type
F: Normal file
D
C
-size #k #M Search by file size
+10k greater than 10K 10k means 9 to 10K

Combination Condition:-A
-O
-not

-atime +5 five days ago

-ctime-5 within five days
-mtime 5 just five days from now.

-mmin
-cmin
-amin

-perm mode exact Match
/mode or relationship (any permission has a match on the line)
-mode matches only if they contain permissions

Find-name "*.conf"-exec cp {} {}.orig \;
Backup configuration file, Add. orig

Operation:
-print Display
-ls similar to Ls-l
-exec chmod o-w {} \; #花括号引用匹配到的文件

\; The Terminator must be in this format

Compress file compression with the suffix name. Z

-D Decompression
-c result output to standard output, so you can punch

gzip file suffix named GZ
-D
-C
Zcat file.gz View gzip Compressed files

The bzip2 file suffix is named bz2
-K Keep the original file
Bzcat View bzip2 File

XZ file suffix named XZ
-K
Xzcat

TAR-CVF-C: Creating a Package
-F: Packaged file name
-Z Zip: Post-packaged compression
-j XZ
-j bzip2
-X: Unpack the Package
-r: Append files to the packaged

Compression decompression basically similar, decompression is-D, retain the original file using-k,tar support Direct XF decompression, Linux can automatically identify the decompression format, mainly about a compressed format suffix name,

Linux file Lookup and compression

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.