Get the App
SLTechnology News&Howtos  ›  Development  › 

How does the Linux system view file paths

Shulou Source: shulou.com Published: 2022-06-02 00:23:50 09月14日 Update

This "Linux system how to view the file path" article, the article sample code introduction is very detailed, with a certain reference value, interested friends must refer to, for the "Linux system how to view the file path", Xiaobian sorted out the following knowledge points, please follow the pace of the editor step by step slowly understand, then let us enter the topic.

1.which

Which is used to see the path of the current command to be executed

For example:

[root@admin ~] # which python / usr/bin/python

If I enter python directly, the output is the default execution path of the python command: / usr/bin/python

How the which command works: searches for the location of a system command in the path specified by the PATH variable and returns the first search result. That is to say,

Using the which command, you can see whether a system command exists and where the command is being executed.

Examples of use of the which command:

$which grep

2.whereis

Whereis is used to view the path where a command or file is located

For example:

[root@admin ~] # whereis python python: / usr/bin/python / usr/bin/python2.6 / usr/lib/python2.6 / usr/lib64/python2.6 / usr/include/python2.6 / usr/local/python / usr/share/man/man1/python.1.gz

Whereis will search for all files or folders with python in their names.

Whereis command principle: can only be used to search for program names, and only search for binaries (parameter-b), man description files (parameter-m), and source code files (parameter-s). If the parameter is omitted, all information is returned.

Examples of use of the whereis command:

$whereis grep

What are the versions of Linux? the versions of Linux are Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and so on. Among them, Deepin is one of the best-developed Linux distributions in China; UbuntuKylin is a derivative release based on Ubuntu; Manjaro is a Linux release based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP's easy-to-use; Ubuntu is the Linux operating system based on desktop applications.

The above is all the contents of the article "how to View File paths in Linux system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Command file path system search parameter that is version release location example content principle instance that is meaning location desktop knowledge reference Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Huawei Redmi Shulou Technology Microsoft