Linux File Lookup command

Source: Internet
Author: User

1. Find

Find is the most common and powerful look-up command you can use to find any file you're looking for. Find uses the following format: $ find<Specify directory> <Specify Criteria> <Specify an action>-<Specify directory>: The directory to search for and all its subdirectories.  The current directory is assumed by default. - <Specify Criteria>: The characteristics of the file you are searching for. - <Specify an action>: Specific processing of search results. If no parameters are added, find searches the current directory and its subdirectories by default, and does not filter any results (that is, all files are returned) and displays them all on the screen. Example of use of find: $ find.  -name ' my* ' searches the current directory (with subdirectories, below), all files with the file name beginning with my. $ find.  -name ' my* '-ls searches the current directory for all files with the file name beginning with my, and displays their details. $ find. -type f-mmin-10 searches the current directory for all the normal files that have been updated in the last 10 minutes. If you do not add the-type f parameter, search for normal files + special files + directories. 
View Code

2. Whereis

The Whereis command can only be used 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. Example of use of the Whereis command: $ whereis grep

3. Which

The purpose of the which command is to search for the location of a system command in the path specified by the path variable, and return the first search result. That is, with the which command, you can see whether a system command exists, and the command that executes exactly which location. Example of use of the which command: $ which grep

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.