• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

whereis: command not found

by admin

The whereis command is used to display various details associated with a command. For example, when entering whereis ls the following output is displayed:ls: /bin/ls /usr/share/man/man1/ls.1.gz /usr/ share/man/man1p/ls.1p.gz.

Where /bin/ls indicates the location of the ls command and /usr/ share/man/man1/ls.1.gz /usr/share/man/man1p/ls.1p.gz indicates the location of the man pages for the ls command.

Syntax

The syntax of the whereis command is:

$ whereis [options] [directory name] {file name}

whereis Command Options

The whereis command has several options, as described in the following table.

Option Description
-b Search only for binaries.
-m Search only for manual sections.
-s Search only for sources.
-u Search for unusual entries.

If you encounter below error while running the whereis command:

whereis: command not found

you may try installing below package as per your choice of distribution:

Distribution Command
OS X brew install util-linux
Debian apt-get install util-linux
Ubuntu apt-get install util-linux
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install util-linux
CentOS yum install util-linux
Fedora dnf install util-linux
Raspbian apt-get install util-linux

whereis Command Examples

1. Locate binary, source and man pages for ssh:

# whereis ssh

2. Locate binary and man pages for ls:

# whereis -bm ls

3. Locate source of gcc and man pages for Git:

# whereis -s gcc -m git

4. Locate binaries for gcc in `/usr/bin/` only:

# whereis -b -B /usr/bin/ -f gcc

5. Locate unusual binaries (those that have more or less than one binary on the system):

# whereis -u *

6. Locate binaries that have unusual manual entries (binaries that have more or less than one manual installed):

# whereis -u -m *

Conclusion

The whereis command attempts to locate the given files by searching a hardcoded list of directories. It can find executables, documentation, and source code. whereis is somewhat quirky because its list of directories might not include the ones you need.

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to check failed or bad login attempts in Linux
  2. abroot Command Examples in Linux
  3. hcitool: command not found
  4. Why Does “/var/log/messages” Report Martian Packets
  5. modprobe Command Examples in Linux
  6. umount: command not found
  7. Failed to Download Metadata for Repo ‘repo_name’
  8. Maintaining Linux filesystems using “fsck” and “tune2fs”
  9. znew Command Examples in Linux
  10. make Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright