Home > Article > Operation and Maintenance > How to check the installation path of a service in Linux
redis is a service that is often used in the development process. I will take this service as an example to explain.
1. Execute the ps -ef | grep redis command. The results are as follows:
As you can see, only the relative path of the service can be found through the ps command. , detailed information of the process that cannot be found, such as absolute path.
Related learning video sharing: linux video tutorial
2. Execute ps -u system user name to further determine the process id,
My here The system user name is root. Execute ps -u root. The result is as follows:
Combined with the operation result diagram of 1, we can see that the process ID of the redis service is 30058.
3. Enter the Linux process directory/proc, execute ls -l, and you can see the corresponding process directory. The result is as shown in the figure below:
4. Enter the process directory 30058 and execute ls -l. The results are as follows:
When Linux starts a process, the system will create a process named after the PID under /proc. folder, there will be information about our process under this folder, including a file named exe, which records the absolute path, which can be viewed through the ll or ls -l command.
Recommended related articles and tutorials: linux tutorial
The above is the detailed content of How to check the installation path of a service in Linux. For more information, please follow other related articles on the PHP Chinese website!