When not his to take over a linux server maintenance, we often want to see on the server whether a service is installed, this service is installed in the path of what?
redis service development is a process often used, I am here to this service, for example, is described.
1. Run the ps -ef | grep redis command, as follows:
Summary: It can be seen by the ps command can only be found in the service of a relative path , the process of finding out more information, such as absolute path.
2. Execute ps -u user name system to further determine the process id,
I have here a system user name is root, execute ps -u root, as follows:
1 combined operating results figure shows, the process redis service where id is 30058,
3. The process into linux directory / proc, performed ls -l, see the corresponding process directory, the results shown below:
4. Go to 30058 this process directory, execute ls -l, the following results:
summary:
linux when you start a process, the system in / create proc under a folder named with PID, the information we have processes in this folder, which includes a file called exe that is recorded absolute path, by ll or ls -l command to view
cwd is a symbolic link process run directory;
exe symbolic link is the execution of the program absolute path;
cmdline is input command line command program runs;
environ recording process environment variables at runtime;
Under fd directory is a symbolic link or use the process to open a file