View the running path of a process in linux

Source: Internet
Author: User

View the running path of a process in linux

In linux, you may think of ps-ef | grep XXX.


But what we see is not the full path. How can we see the full path?

After each process is started, there is a pid path under/proc.

Example: ps-ef | grep python

Display: oracle 4431 4366 0 00:00:00 pts/2 python Server. py

4431 is the process number

To/proc/4431, ls-l will see (requires root permission ):

Total usage 0
-R -- 1 oracle oinstall 0 December 29 18:58 offline line
Lrwxrwxrwx 1 oracle oinstall 0 December 29 18:58 cwd->/XXX/ultserver_aa
-R -------- 1 oracle oinstall 0 December 29 18:58 environ
Lrwxrwxrwx 1 oracle oinstall 0 December 29 18:58 exe->/usr/bin/python2.4
Dr-x ------ 2 oracle oinstall 0 December 29 18:58 fd
-R -------- 1 oracle oinstall 0 December 29 18:58 maps
-Rw ------- 1 oracle oinstall 0 December 29 18:58 mem
-R -- 1 oracle oinstall 0 December 29 18:58 mounts
Lrwxrwxrwx 1 oracle oinstall 0 December 29 18:58 root->/
-R -- 1 oracle oinstall 0 December 29 18:58 stat
-R -- 1 oracle oinstall 0 December 29 18:58 statm
-R -- 1 oracle oinstall 0 December 29 18:58 status

Note that cwd is the path of the process to be searched.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.