Related commands for Linux search

Source: Internet
Author: User

1, which

View the command with the which command (and only the executable file under $path to use which to view the file)

How to use: Which LS


2, Whereis

The Whereis command can be used only for program name searches, and only binary files (parameter-B), man description file (parameter-m), and source code file (parameter-s) are searched. If the argument is omitted, all information is returned.


Whereis and locate are all looking for database files, so the lookups are fast and the Find command is slow by traversing the Linux hard drive.


3, locate

Do not find the/tmp/folder

The Mlocate package needs to be installed through the Yum tool before it can be used, and the locate command is found through the database.

Before you can use the Locate command to find a file, you need to update the database with the UpdateDB command first

If there is no updatedb after creating a new file, locate cannot find the file


4. Find

How to use:

find/tmp/-name "LongFei" (Find all files named LongFei under the/tmp/folder)

find/tmp/-name "long*" (Find all files with a long beginning under the/tmp/folder)

find/tmp/-type D (Find the directory under the/tmp/folder)

find/tmp/-type F (find files under the/tmp/folder)

find/tmp/-type b (Find block devices under the/tmp/folder)

find/tmp/-type C (Find character devices under the/tmp/folder)

find/tmp/-type S (Locate the socket under the/tmp/folder)

find/tmp/-mtime-10 (Create/modify all files within 10 days)

find/tmp/-mmin-10 ( Create/Modify all files in less than 10 minutes )

find/tmp/-atime-10 (all files with read/execute time within 10 minutes)

find/tmp/-ctime-10 (modify file attributes within 10 minutes of all files)

Find/-inum 141418 (query files by inode number)

View Mtime;atime;ctime's Commands

Stat 1.txt (View 1.txt of three time)


Related commands for Linux search

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.