Home >Operation and Maintenance >Linux Operation and Maintenance >Can linux check the file address?
Linux can view the file address. Viewing method: 1. Use the whereis command, which can locate the location of executable files, source code files, and help files. The syntax is "whereis file name"; 2. Use the which command, which can view the location of executable files. The syntax is "which filename".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
Can linux check the file address
1, whereis
The whereis command locates the location of executable files, source code files, and help files in the file system.
The attributes of these files should belong to original code, binary files, or help files.
whereis The program also has the ability to search source code, specify alternative search paths, and search for unusual items.
If parameters are omitted, all information will be returned.
test@localhost:~$ whereis bash bash: /bin/bash /etc/bash.bashrc /usr/share/man/man1/bash.1.gz
Note: The above output information from left to right is the queried program name, bash path, and bash man manual page path.
2. The function of which
which command is to search for the location of a system command in the path specified by the PATH variable and return the first search result. .
In other words, using the which command, you can see whether a certain system command exists and which location the command is executed.
Enter export on the command line to view the PATH variable
export
which java
Description: View the address of the java executable file
Note:
which View the location of the executable file.
whereis View the location of the file.
Recommended learning: Linux video tutorial
The above is the detailed content of Can linux check the file address?. For more information, please follow other related articles on the PHP Chinese website!