How to search for File command encyclopedia in Linux system

Source: Internet
Author: User
Tags file size ftp ftp file

Command 1:which

Which command to find only the directory where the command is located

For example: which LS

Command 2:whereis

Whereis command to find only the directory where the command is located + Help document location

Whereis command

Command location + Help document location

Command 3:find

Find path Lookup method parameter to locate any file

There are a number of ways to find:

1. Find by file name

Find how:-name

For example: Find/t3-name file1

Note: The filename can be used with wildcard characters

* Multiple characters

? Single character

For example: Find/t3-name fil*

2. Find by File size

Find how:-size (unit data block 512 bytes, that is, 0.5kb)

+1000

-1000

=1000

For example: find/t3-name-1000

3. Find according to the owner of the file

Find how:-user

For example: Find/t3-user XHC

4. According to the group of files to find

Find how:-group

For example: Find/t3-group greenday

5. According to the last modified time to find

Find the way:-ctime,-atime,-mtime in days as the unit

How to find:-cmin,-amin,-mmin in minutes

C change refers to the file attributes, refers to permissions, groups, owners changed

A visit

M modification means that the contents of the file have been modified

Parameters:

+ More than a long time

-How much time

I don't write anything.

For example: find/t3-mmin-120

6. According to the file type to find

Find how:-type

For example: Find/t3-type D

7. According to the I node to find

Find how:-inum

For example: Find/t3-inum 14

8. Multiple conditions

-A logic and

-O Logic or

For example: Find-size +80-a-size-100

4. After the search operation

Fixed format: Find Xxx-exec command {};

For example: Find/t3-mmin-120-exec ls-l {}; Find files that have been modified within two hours and list details

Locate

UpdateDB

Grep

Example: grep FTP file name A output a file contains FTP rows

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.