whereis command serves the purpose of locating the source/binary file and manual sections for a specified command or file within a Linux system. This utility delivers results with increased accuracy while also being notably time-efficient.
Whereis command examples:
To find the location of lshw command, open the terminal application (ctrl+alt+t) and run below command.
whereis lshw
To find ls command location, run below command.
whereis ls
In this way you can find any command location. Just replace ls with your command.
To locate binary of a Linux command ls, just add the -b filter like below.
whereis -b ls
To locate man page of ls command, run below command with -m filter.
whereis -m ls
For the complete usage help, run below command.
whereis --help