A linux Command (17) every day: whereis command

Source: Internet
Author: User
Tags touch command


One linux Command every day (17): whereis command link: One linux Command every day (1): ls command http://www.bkjia.com/ OS /210210/163049.html#linuxlinuxcommand every day (2): cd command serial (3 ): pwd command Export (4): mkdir command http://www.bkjia.com/ OS /201210/1620.3.html#a linuxcommand every day (5): rm command Export (6): rmdir command http://www.bkjia.com/ OS /201210/164 017. html; one linux Command every day (7): mv command running (8): cp command http://www.bkjia.com/ OS /201210/163164.html#a linuxcommand every day (9): touch command running (10): cat command running (11 ): nl command http://www.bkjia.com/ OS /201211/165990.htmla linuxcommand every day (12): more command http://www.bkjia.com/ OS /201211/165994.htmla linuxcommand every day (13): less command detail (14): head command http://www.bkjia.com/ OS /201211/166191.htmla linuxcommand every day (15): tail command detail (16): which command http://www.bkjia.com/ OS /201211/168890.html whereis command can only be used for search of the program name, only binary files (parameter-B), man description files (parameter-m), and source code files (parameter-s) are searched ). If the parameter is omitted, all information is returned. Compared with find, www.2cto.com is faster than whereis, because the linux system records all files in the system in a database file, when whereis and the locate described below are used, data will be searched from the database, instead of searching through the hard disk like the find command, which will naturally be very efficient. However, this database file is not updated in real time. It is updated once a week by default. Therefore, when we use whereis and locate to find the file, we sometimes find the deleted data, you can't find the file you just created because the database file is not updated. 1. command Format: whereis [-bmsu] [BMS directory name-f] file name 2. command function: The whereis command locates executable files, source code files, and help files in the file system. The attributes of these files should belong to the original code, binary file, or help file. The whereis Program also provides the ability to search for source code, specify a backup search path, and search for unusual items. 3. Command Parameter:-B locates the executable file. -M: locate the Help file. -S: locate the source code file. -U searches for executable files, source code files, and help files in the default path. -B specifies the path to search for executable files. -M specifies the path for searching the Help file. -S specifies the path to search for source code files. 4. Use instance: instance 1: Find all files related to the ** file. Command: whereis svn output: [root @ localhost ~] # Whereis tomcattomcat: [root @ localhost ~] # Whereis svnsvn:/usr/bin/svn/usr/local/svn/usr/share/man/man1/svn.1.gz Description: tomcat is not installed and cannot be found, svn installation found a lot of Related File instances 2: only find the binary file command: whereis-B svn output: [root @ localhost ~] # Whereis-B svnsvn:/usr/bin/svn/usr/local/svn [root @ localhost ~] # Whereis-m svnsvn:/usr/share/man/man1/svn.1.gz [root @ localhost ~] # Whereis-s svnsvn: [root @ localhost ~] # Note: whereis-m svn finds the path of the instruction document, and whereis-s svn finds the source file.

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.