Search for files in linux -- typewhereiswhichfindlocate

Source: Internet
Author: User
In linux, the file search & mdash; typewhereiswhichfindlocate1.type command is used to display the type of the specified command. A command can be of the following type: alias keyword, Shell reserved word function, Shel... search for files in linux -- type whereis which find locate 1. description of the type command: the type command is used to display the type of the specified command. A command can be of the following type: alias keyword, Shell reserved word function, Shell function builtin built-in command, Shell built-in command file, disk file, the external command unfound does not find that it is a kind of introspection mechanism of the Linux system. Knowing the type, we can get targeted help. For example, the built-in command can use the help command to get help, and the external command can use man or info to get help. The basic usage of common parameter type commands is to keep up with the command name directly. Type-a can display all possible types. for example, some commands such as pwd are shell built-in commands or external commands. Type-p only returns information about external commands, which is equivalent to the which command. Type-f only returns information about shell functions. Type-t only returns information of the specified type. Type: similar to which, fast, but can only be used in bash Environment 2. whereis Whereis: find executable documents, programs, and so on (only some file paths specified by the system can be found, including system commands, built-in commands, man documents, and so on) the whereis command searches for qualified files in the specified directory. the attributes of the files should belong to the original code, binary files, or help files. The advantage is that the script and common files can be found quickly. because the files are stored in the database, the deleted files cannot be found. Although Find is accurate, it is relatively slow. In addition, the locate command has the same effect, but it also has the same problem. you can use updatedb to update the database. 3. find: Find and process specific file FindDIR (directory) EXP (search condition) ACTION (ACTION) -namepattern: find the name, path name, and symbol-typef | d | l | B | c | p | s. only common files, directories, symbolic connections, block devices, character devices, and names are searched. pipeline, or socketlFind/-name boot-type d: find the maximum file in the current directory in the/boot folder: find-type f-exec stat-c "% s % n "{}\; | sort-nr | head-1 Note:-exec option application 4. locate 5. which: find a specific executable file and specify its location (from the PATH). Which syntax: which [file...] note: The which command searches for qualified files in the directory set by the environment variable $ PATH. That is, binary executable files are searched. -N <文件名长度> Specify the file name length. the specified length must be greater than or equal to the longest file name in all files. -P <文件名长度> The parameter is the same as the-n parameter, but <文件名长度> Including the file path. -W specifies the width of the field when the output is made. -V: The version information is displayed. enter a Command under a user. if "commandnot found" is displayed, a possible cause is, the binary executable file of the command is not in the face of the user's environment.
 
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.