- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- Servers - General
- >
- Re: How to find the Process path
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 08:03 PM - last edited on 03-04-2023 08:59 AM by support_s
02-21-2023 08:03 PM - last edited on 03-04-2023 08:59 AM by support_s
How to find the Process path
I have a process running and i need to find out the process path
sxxxxxc: home/sxxxxai $ ps -ef |grep -i jmx
sxxxxxai 12571 4873 1 19:50:42 pts/0 0:00 grep -i jmx
By above i can see that JMX Process id is 12571 , how to find out the location of the file
Same for below
sxxxxc:home/sxxxxi $ ps -ef |grep -i activemq
sxxxxxi 13090 4873 0 19:56:50 pts/0 0:00 grep -i activemq
I have tried below commands but of no use
pwdx 13090
sudo ls -l /proc/13090/exe
readlink -f /proc/<13090>/exe
lsof -p 13090 | grep cwd
- Tags:
- Prolaint server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 08:49 AM
03-01-2023 08:49 AM
Re: How to find the Process path
Hello Satha,
The process id "12571" you have mentioned/seeing, is the PID of the "ps" command ran with grepping for jmx and there is no process with name "jmx" included in server .
sxxxxxc: home/sxxxxai $ ps -ef |grep -i jmx
sxxxxxai 12571 4873 1 19:50:42 pts/0 0:00 grep -i jmx
Here, it says there is only one entry on ps table with "jmx" included is the "grep -i jmx" which you executed .
The process ID would exit once you get the prompt back with the output .
Same is the case of the other command you ran .
sxxxxc:home/sxxxxi $ ps -ef |grep -i activemq
sxxxxxi 13090 4873 0 19:56:50 pts/0 0:00 grep -i activemq
Following would the output when there is an actual process running , here is an example of sshd .
# ps -ef | grep -i sshd
root 9881 1 0 Feb 2 ? 0:00 /opt/ssh/sbin/sshd
root 10988 9881 0 20:37:58 ? 0:00 sshd: root@pts/1
root 27884 24409 0 22:15:40 pts/0 0:00 grep -i sshd
Here , PID 27884 is for the grep command executed .
PID 10988 is the sshd child process and PID 9881 is the actual SSHD process running in server , where you could also see the path of the binary .
I work for HPE/ I am an HPE Employee (HPE Community)
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2023 03:29 AM - last edited on 03-02-2023 09:49 PM by Sunitha_Mod
03-02-2023 03:29 AM - last edited on 03-02-2023 09:49 PM by Sunitha_Mod
Re: How to find the Process path
To find the location of the process file, you can try using the ls command with the process ID. Here's how you can do it:
For the JMX process with ID 12571:
This should give you the full path to the process file.
For the ActiveMQ process with ID 13090:
This should also give you the full path to the process file.
Note that you need to have sufficient permissions to access the process file. If you're not running these commands as the same user that started the process, you may need to run them with sudo.
Also, if the process has already terminated, the /proc directory may no longer contain information about the process, in which case you won't be able to find the process file using this method.