Home  >  Article  >  Operation and Maintenance  >  Can linux check the file address?

Can linux check the file address?

WBOY
WBOYOriginal
2022-05-23 16:40:076522browse

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".

Can linux check the file address?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

Can linux check the file address?

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

Can linux check the file address?

which java

Can linux check the file address?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn