How to use the whereis Command


in this academic, we can show you the way to use the whereis command to find the supply, guide, and binary files for certain instructions. 

 


 

the whereis command locates the binary, manual, and source files for a specific command name. it's far in particular handy in case you want to know the place of sure files on your subsequent project.


different instructions which includes locate can get comparable results but can be a good deal slower and provide much less dependable consequences. i suggest using whereis as it is fast and presents correct effects. it also does now not require admin privileges to discover the effects you require.


whereis Command Syntax


the simple syntax of the whereis command is proper under. i'm able to quick provide an explanation for what every a part of the command requires below the instance.

 


  •  the options section is wherein you input any more choice you wish to apply to the command. we contact on some of the one-of-a-kind options that you may use a bit similarly down this page.
  • document is in which you enter the record or command you intend to apply for search. for example, you can certainly enter zip to look for the files related to the zip command.

 

 

whereis Command Options

 

there are a few different alternatives that you could use to regulate the behavior of the whereis command. beneath are a number of the options that you can use. i'm going into a chunk greater depth on the use of those alternatives in addition down the page.

  •     -b will search for binaries simplest.
  •     -m will search for manuals best
  •     -s will search for resources best.
  •     -u is for locating command names that have uncommon entries. a command is considered unusual if it has 0 or multiple access for each requested type.
  •     -b is much like -b but helps you to restriction wherein the command searches for binaries. after the option, upload a area-separated list of directories.
  •     -m is confined to manuals and bounds the hunt to particular directories. after the choice, add a area-separated list of directories.
  •     -s is restrained to resources and helps you to specify wherein the command searches. after the choice, add a area-separated list of directories.
  •     -f terminates the listing listing and indicators the begin of file names. you have to use it with -m, -s, -b options.
  •     -v or --model presentations the version of the command.

 

Using the whereis Command

 

The most basic usage of this command is to simply enter whereis followed by the command which you would like to locate the binaries, manuals, and sources.

 


 Below is an example output from the above command.

 


Searching for Binary Files

 

You can limit the command to search for binary files by using the -b option.




Below is the result of specifying for binary files only.

 


 Searching for Manual Files

 Using the -m option, you can limit the command to search for just manual files.

 

Below is the output from using the above command.

 

 


 

Searching for Source Files

 You can use the -s option to search for just source files. Below is an example of how you would structure the command.

 


 Below is the output from using the above command.

 


 

Limit whereis Searches

 The whereis command will search a few hard-coded paths for the files you are after. You can further limit the search by specifying the directory you want the command to search.

You can use the -l option to view all the paths that whereis will search by default. It should output a pretty long list of paths.

Whenever you use -B, -M, or -S, you will need to terminate the line with -f followed by the file names you wish to search.

For example, if you want to only search for binary files in the /usr/bin/ directory, you would construct a command similar to the one below.



Below is the output from using the above command.

 

 

You can look for a considerable length of time document types and in different areas. For instance, the order underneath looks for pairs and manuals. It look/usr/canister and/usr/neighborhood/for parallels. Additionally, it look/usr/share/man/man1 for manuals. Finally, it looks for both tar and zip.

 


The command above results in the following output.

 


 

Conclusion

 

You should now have an essential comprehension of how to utilize the whereis order on your cherished Linux or Unix dispersion. Obviously, it is impossible you will utilize this order an extraordinary arrangement, yet it proves to be useful at whatever point you want it.

To find out additional, we have bounty more instructional exercises covering Linux orders. They are ideal for the two novices and progressed clients.

I genuinely want to believe that we have precisely covered however much as could reasonably be expected in this instructional exercise. Assuming you notice whatever requires further clarifying, make certain to leave a remark underneath.

Post a Comment

Previous Post Next Post