Linux尋找進程及連接埠佔用

來源:互聯網
上載者:User

法1:

ps aux | grep httpd

netstat -anp | grep httpd

法2:

ps -ef | grep httpd

netstat -tunpl  | grep httpd

#######################

附:

[root@bogon bin]# ps --help********* simple selection *********  ********* selection by list *********-A all processes                      -C by command name-N negate selection                   -G by real group ID (supports names)-a all w/ tty except session leaders  -U by real user ID (supports names)-d all except session leaders         -g by session OR by effective group name-e all processes                      -p by process IDT  all processes on this terminal     -s processes in the sessions givena  all w/ tty, including other users  -t by ttyg  OBSOLETE -- DO NOT USE             -u by effective user ID (supports names)r  only running processes             U  processes for specified usersx  processes w/o controlling ttys     t  by tty*********** output format **********  *********** long options ***********-o,o user-defined  -f full            --Group --User --pid --cols --ppid-j,j job control   s  signal          --group --user --sid --rows --info-O,O preloaded -o  v  virtual memory  --cumulative --format --deselect-l,l long          u  user-oriented   --sort --tty --forest --version-F   extra full    X  registers       --heading --no-heading --context                    ********* misc options *********-V,V  show version      L  list format codes  f  ASCII art forest-m,m,-L,-T,H  threads   S  children in sum    -y change -l format-M,Z  security data     c  true command name  -c scheduling class-w,w  wide output       n  numeric WCHAN,UID  -H process hierarchy[root@bogon bin]# netstat --helpusage: netstat [-veenNcCF] [<Af>] -r         netstat {-V|--version|-h|--help}       netstat [-vnNcaeol] [<Socket> ...]       netstat { [-veenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s } [delay]        -r, --route                display routing table        -I, --interfaces=<Iface>   display interface table for <Iface>        -i, --interfaces           display interface table        -g, --groups               display multicast group memberships        -s, --statistics           display networking statistics (like SNMP)        -M, --masquerade           display masqueraded connections        -v, --verbose              be verbose        -n, --numeric              don't resolve names        --numeric-hosts            don't resolve host names        --numeric-ports            don't resolve port names        --numeric-users            don't resolve user names        -N, --symbolic             resolve hardware names        -e, --extend               display other/more information        -p, --programs             display PID/Program name for sockets        -c, --continuous           continuous listing        -l, --listening            display listening server sockets        -a, --all, --listening     display all sockets (default: connected)        -o, --timers               display timers        -F, --fib                  display Forwarding Information Base (default)        -C, --cache                display routing cache instead of FIB        -T, --notrim               stop trimming long addresses        -Z, --context              display SELinux security context for sockets  <Iface>: Name of interface to monitor/list.  <Socket>={-t|--tcp} {-u|--udp} {-S|--sctp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom  <AF>=Use '-A <af>' or '--<af>'; default: inet  List of possible address families (which support routing):    inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)     netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)     x25 (CCITT X.25) 

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.