Old boy Education daily-101th Day-How do I find out which directory the process is in by port?

Source: Internet
Author: User

Reference Answer:

First step-Find the number of the process that corresponds to the port
[[email  protected] ~]# ss -lntup |grep :22tcp    LISTEN      0      128                    :::22                    :::*        users: (("sshd", 1467,4) tcp    listen     0       128                     *:22                     *:*       users :(("sshd", 1467,3)) 
Step Two-show/proc/process number/CWD directory
[Email protected] ~]# ls-l/proc/1467/cwdlrwxrwxrwx 1 root root 0 June 01:25/PROC/1467/CWD
Process number/Other commonly used files in this directory:

CWD Symbolic link is the process running directory;
EXE symbolic connection is the absolute path to execute the program;
CmdLine is the command line command that is entered when the program is run;
Environ records the environment variables when the process is running;
The FD directory is a symbolic connection of the files that the process opened or used.


User Answer

1. We can get the PID of the process from the Netstat-antup command
2. Enter the directory named under the PID in the/proc directory
3. Enter Ls-ail, the result of the EXE link is the full path of the executable file details

Note


Today is the 101th Day of the day to accompany you and look forward to your progress .

For questions and answers, please leave a comment in the blog comments section .
Index of the topic of the previous period

http://lidao.blog.51cto.com/3388056/1914205

This article is from the "Lee blog" blog, make sure to keep this source http://lidao.blog.51cto.com/3388056/1951222

Old boy Education daily-101th Day-How do I find out which directory the process is in by port?

Related Article

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.