{
    "mode": "man",
    "parameter": "whereis",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/whereis/1/json",
    "generated": "2026-05-30T06:06:54Z",
    "synopsis": "whereis [options] [-BMS directory... -f] name...",
    "sections": {
        "NAME": {
            "content": "whereis - locate the binary, source, and manual page files for a command\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "whereis [options] [-BMS directory... -f] name...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "whereis locates the binary, source and manual files for the specified command names. The\nsupplied names are first stripped of leading pathname components. Prefixes of s. resulting\nfrom use of source code control are also dealt with. whereis then attempts to locate the\ndesired program in the standard Linux places, and in the places specified by $PATH and\n$MANPATH.\n\nThe search restrictions (options -b, -m and -s) are cumulative and apply to the subsequent\nname patterns on the command line. Any new search restriction resets the search mask. For\nexample,\n\nwhereis -bm ls tr -m gcc\n\nsearches for \"ls\" and \"tr\" binaries and man pages, and for \"gcc\" man pages only.\n\nThe options -B, -M and -S reset search paths for the subsequent name patterns. For example,\n\nwhereis -m ls -M /usr/share/man/man1 -f cal\n\nsearches for \"ls\" man pages in all default paths, but for \"cal\" in the /usr/share/man/man1\ndirectory only.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-b",
                    "content": "Search for binaries.\n",
                    "flag": "-b"
                },
                {
                    "name": "-m",
                    "content": "Search for manuals.\n",
                    "flag": "-m"
                },
                {
                    "name": "-s",
                    "content": "Search for sources.\n",
                    "flag": "-s"
                },
                {
                    "name": "-u",
                    "content": "Only show the command names that have unusual entries. A command is said to be unusual if\nit does not have just one entry of each explicitly requested type. Thus 'whereis -m -u *'\nasks for those files in the current directory which have no documentation file, or more\nthan one.\n",
                    "flag": "-u"
                },
                {
                    "name": "-B",
                    "content": "Limit the places where whereis searches for binaries, by a whitespace-separated list of\ndirectories.\n",
                    "flag": "-B"
                },
                {
                    "name": "-M",
                    "content": "Limit the places where whereis searches for manuals and documentation in Info format, by\na whitespace-separated list of directories.\n",
                    "flag": "-M"
                },
                {
                    "name": "-S",
                    "content": "Limit the places where whereis searches for sources, by a whitespace-separated list of\ndirectories.\n",
                    "flag": "-S"
                },
                {
                    "name": "-f",
                    "content": "Terminates the directory list and signals the start of filenames. It must be used when\nany of the -B, -M, or -S options is used.\n",
                    "flag": "-f"
                },
                {
                    "name": "-l",
                    "content": "Output the list of effective lookup paths that whereis is using. When none of -B, -M, or\n-S is specified, the option will output the hard-coded paths that the command was able to\nfind on the system.\n",
                    "flag": "-l"
                },
                {
                    "name": "-h --help",
                    "content": "Display help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-V --version",
                    "content": "Display version information and exit.\n",
                    "flag": "-V",
                    "long": "--version"
                }
            ]
        },
        "FILE SEARCH PATHS": {
            "content": "By default whereis tries to find files from hard-coded paths, which are defined with glob\npatterns. The command attempts to use the contents of $PATH and $MANPATH environment\nvariables as default search path. The easiest way to know what paths are in use is to add the",
            "subsections": [
                {
                    "name": "-l -B -M -S -l",
                    "content": "",
                    "flag": "-l"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "WHEREISDEBUG=all\nenables debug output.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "To find all files in /usr/bin which are not documented in /usr/man/man1 or have no source in\n/usr/src:\n\ncd /usr/bin whereis -u -ms -M /usr/man/man1 -S /usr/src -f *\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "For bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "The whereis command is part of the util-linux package which can be downloaded from Linux\nKernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-06-02                                   WHEREIS(1)",
            "subsections": []
        }
    },
    "summary": "whereis - locate the binary, source, and manual page files for a command",
    "flags": [
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": "Search for binaries."
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": "Search for manuals."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "Search for sources."
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": "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."
        },
        {
            "flag": "-B",
            "long": null,
            "arg": null,
            "description": "Limit the places where whereis searches for binaries, by a whitespace-separated list of directories."
        },
        {
            "flag": "-M",
            "long": null,
            "arg": null,
            "description": "Limit the places where whereis searches for manuals and documentation in Info format, by a whitespace-separated list of directories."
        },
        {
            "flag": "-S",
            "long": null,
            "arg": null,
            "description": "Limit the places where whereis searches for sources, by a whitespace-separated list of directories."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "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."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "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."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Display help text and exit."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Display version information and exit."
        }
    ],
    "examples": [
        "To find all files in /usr/bin which are not documented in /usr/man/man1 or have no source in",
        "/usr/src:",
        "cd /usr/bin whereis -u -ms -M /usr/man/man1 -S /usr/src -f *"
    ],
    "see_also": []
}