Siege Lion on the Way (iii) Linux (16)---command and file lookup

Source: Internet
Author: User

One, the script file query:

1, command format: which [-a] command; <== is found through path.

-A: Lists all, not only the first.

Example: which ifconfig;

Note: Because different user paths are different, there may be differences in the results.

Second, the name of the search:

1, Whereis [-BMSU] file or directory name <== through the database to find, so different users find the results are consistent.

Parameter description:

-B: Only files in binary format are found.

-M: Only files found under the manual path of the description file.

-S: Only source files are found.

-U: A file other than the above three conditions.

2, locate:<== through the database to find, so different users find the results are consistent. It's/var/lib/mlocate.

Locate [-ir] keyword

Parameter description:

-I: Ignores case differences.

-R: The following can be a regular expression.

3, UpdateDB command will refresh the above mentioned database, but it is time-consuming.

4. Find [PATH] [option] [action]

A, time-related parameters:-atime\-actime\-mtime

-mtime files that have been changed within 24 hours of the N-day period.

-mtime files that have been changed before +n:n days (not included).

-mtime-n:n within days (including) files that have been changed.

Example: Find/mtime 0;

B, parameters related to the user or user group:

-uid N: Follow-up instructions.

-gid N: Follow-up instructions.

-user name: such as Vbird.

-group name: such as users.

-nouser: The user's file does not exist.

-nogroup: The file for the user group does not exist.

C. Parameters related to file permissions and names:

-name FileName: Finds the file named filename.

-size [-+] Size: Files larger or smaller than size, such as-size +50k

-type type: Find by file type, f\b\c\d\l\s\p ...

-perm mode: Find files with file permissions just equal to mode.

-perm-mode: Attributes are all included.

-perm +mode: A file that contains any of the mode permissions.

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.