English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux-Befehl whereis

Linux Command大全

Der Linux-Befehl whereis wird verwendet, um Dateien zu finden.

Dieser Befehl sucht in bestimmten Verzeichnissen nach Dateien, die den angegebenen Kriterien entsprechen. Diese Dateien sollten Originalquellcode, Binärdateien oder Hilfsdateien sein.

Dieser Befehl kann nur zum Suchen von binären Dateien, Quellcode-Dateien und manuell abgerufenen Handbuchschriften verwendet werden. Die Lokalisierung allgemeiner Dateien erfordert den Befehl locate.

Syntax

whereis ...-bfmsu...-B <Inhaltsverzeichnis>...-M <目录>...][-S <目录>...][文件...]

Parameters:

  • -b  Only search for binary files.
  • -B<目录>  Only search for binary files in the specified directory.
  • -f  Do not display the path name before the file name.
  • -m  Only search for documentation files.
  • -M<目录>  Only search for documentation files in the specified directory.
  • -s  Only search for original code files.
  • -S<目录>  Only search for original code files in the specified directory.
  • -u  Find files that do not contain the specified type.
  • Online Examples

    Use the instruction "whereis" to view the location of the instruction "bash", enter the following command:

    $ whereis bash 
    

    After executing the above command, the output information is as follows:

    bash:/bin/bash/etc/bash.bashrc/usr/share/man/man1/bash.1.gz 
    

    Note: The output information above is from left to right, respectively, the name of the queried program, the path of bash, and the path of the bash manual page.

    If the user needs to query the binary file or help file separately, the following command can be used:

    $ whereis -b bash 
    $ whereis -m bash 
    

    The output information is as follows:

    $ whereis -b bash               # Display the binary program of bash command  
    bash: /bin/bash /etc/bash.bashrc /usr/share/bash    # Address of the binary program of bash command  
    $ whereis -m bash               # Display the help file of bash command  
    bash: /usr/share/man/man1/bash.1.gz  # Address of bash command help file  
    

    Linux Command大全