linux command

whereis

Linux Command – whereis ใช้ในการค้นหาตำแหน่ง file program

 

คำสั่ง

whereis <program>

$ whereis perl
perl: /usr/bin/perl5.22-x86_64-linux-gnu /usr/bin/perl /etc/perl /usr/share/perl /usr/share/man/man1/perl.1.gz

 

โครงสร้างคำสั่ง

 whereis [options] [-BMS directory... -f] name...

 

รายละเอียด

เป็นคำสั่งที่ใช้ในการค้นหาตำแหน่ง file program เช่น binary, source , manual page ที่เก็บบนระบบ

 

Option

 -b Search for binaries.

 -m Search for manuals.

 -s Search for sources.

 -u Only show the command names that have unusual entries. A command is said to be unusual if it does not have just one entry of each explicitly requested type. Thus 'whereis
 -m -u *' asks for those files in the current directory which have no documentation file, or more than one.

 -B list
 Limit the places where whereis searches for binaries, by a whitespace-separated list of directories.

 -M list
 Limit the places where whereis searches for manuals and documentation in Info format, by a whitespace-separated list of directories.

 -S list
 Limit the places where whereis searches for sources, by a whitespace-separated list of directories.

 -f Terminates the directory list and signals the start of filenames. It must be used when any of the -B, -M, or -S options is used.

 -l Output the list of effective lookup paths that whereis is using. When none of -B, -M, or -S is specified, the option will output the hard-coded paths that the command was
 able to find on the system.

 

กลุ่มคำสั่ง

find, which

 

Reference:

คำสั่ง Unix – Linux Command

Linux, Unix

 

Author: Suphakit Annoppornchai

Credit: https://saixiii.com

One Thought to “whereis – Linux Command คำสั่งค้นหาตำแหน่ง file program”

Leave a Reply