View Process command path information under Linux __linux

Source: Internet
Author: User

Linux we generally use PS to view process information, but the process information given by PS is limited, there is no process work path, the absolute path of the process command and so on, at this time we can through Linux under the/proc/directory stored information for query process command path information.

Linux, after any program is started, the system assigns it an ID, the familiar PID, called the process number, at the same time, the system creates a separate folder for it in the/proc directory, and the folder is named after the PID, which holds the detailed information about the process running in the folder. Interested friends can go into this directory to study, but today's focus is to get the absolute path to the process.

In/proc/This directory has a file named EXE, like the executable file under Windows system, which is actually a symbolic link (similar to a shortcut under Windows) that points to the absolute path of the process counterpart. Use the file command or the LS command to view the properties of the symbolic link to get the absolute path it points to: Ls-l/proc/pid/exe File/proc/pid/exe

Change the PID in the command above to the Linux process number you want to query. --Eof-truevue--

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.