LINX コマンドでプロセスを確認するときは
psというコマンドを使う、
というか今日使った、いつも使っているけど、
本番で使ったのでドキドキした。
というか良くわかっているようで、
わかっていない気がしたのでおさらい的なメモを残す
$ps -ef | grep init
とか打つ、initの部分は任意、GREPはなんかそこの部分の
文字で検索するという指示。
マイナスの部分はオプションといって、psのコマンドのプラスアルファでできる
部分の指定。この場合ef
eはevery全てのプロセスを意味するオプション
それぞれ僕ですのマシンで確認すると
[maint01@localhost ~]$ ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 22:14 ? 00:00:01 init [5]
root 2 1 0 22:14 ? 00:00:00 [migration/0]
root 3 1 0 22:14 ? 00:00:00 [ksoftirqd/0]
root 4 1 0 22:14 ? 00:00:00 [watchdog/0]
root 5 1 0 22:14 ? 00:00:00 [events/0]
root 6 1 0 22:14 ? 00:00:00 [khelper]
root 7 1 0 22:14 ? 00:00:00 [kthread]
root 10 7 0 22:14 ? 00:00:00 [kblockd/0]
root 11 7 0 22:14 ? 00:00:00 [kacpid]
root 47 7 0 22:14 ? 00:00:00 [cqueue/0]
root 50 7 0 22:14 ? 00:00:00 [khubd]
root 52 7 0 22:14 ? 00:00:00 [kseriod]
root 114 7 0 22:14 ? 00:00:00 [khungtaskd]
root 115 7 0 22:14 ? 00:00:00 [pdflush]
root 116 7 0 22:14 ? 00:00:00 [pdflush]
root 117 7 0 22:14 ? 00:00:00 [kswapd0]
root 118 7 0 22:14 ? 00:00:00 [aio/0]
root 267 7 0 22:14 ? 00:00:00 [kpsmoused]
root 291 7 0 22:14 ? 00:00:00 [ata/0]
root 292 7 0 22:14 ? 00:00:00 [ata_aux]
root 295 7 0 22:14 ? 00:00:00 [scsi_eh_0]
root 300 7 0 22:14 ? 00:00:00 [kstriped]
root 309 7 0 22:14 ? 00:00:00 [ksnapd]
root 320 7 0 22:15 ? 00:00:00 [kjournald]
root 346 7 0 22:15 ? 00:00:00 [kauditd]
root 379 1 0 22:15 ? 00:00:01 /sbin/udevd -d
root 1209 7 0 22:15 ? 00:00:00 [kmpathd/0]
root 1210 7 0 22:15 ? 00:00:00 [kmpath_handlerd]
root 1266 7 0 22:15 ? 00:00:00 [kjournald]
root 1397 7 0 22:15 ? 00:00:00 [iscsi_eh]
root 1436 7 0 22:15 ? 00:00:00 [ib_addr]
root 1444 7 0 22:15 ? 00:00:00 [ib_mcast]
root 1445 7 0 22:15 ? 00:00:00 [ib_inform]
root 1446 7 0 22:15 ? 00:00:00 [local_sa]
root 1449 7 0 22:15 ? 00:00:00 [iw_cm_wq]
root 1452 7 0 22:15 ? 00:00:00 [ib_cm/0]
root 1455 7 0 22:15 ? 00:00:00 [rdma_cm]
root 1469 1 0 22:15 ? 00:00:00 brcm_iscsiuio
root 1475 1 0 22:15 ? 00:00:00 iscsid
root 1476 1 0 22:15 ? 00:00:00 iscsid
root 1745 1 0 22:15 ? 00:00:00 /sbin/dhclient -1 -q -lf /var/li
root 1843 1 0 22:15 ? 00:00:00 auditd
root 1845 1843 0 22:15 ? 00:00:00 /sbin/audispd
root 1867 1 0 22:15 ? 00:00:00 syslogd -m 0
root 1870 1 0 22:15 ? 00:00:00 klogd -x
rpc 1934 1 0 22:16 ? 00:00:00 portmap
root 1960 7 0 22:16 ? 00:00:00 [rpciod/0]
root 1966 1 0 22:16 ? 00:00:00 rpc.statd
root 1990 1 0 22:16 ? 00:00:00 rpc.idmapd
dbus 2005 1 0 22:16 ? 00:00:00 dbus-daemon --system
root 2014 1 0 22:16 ? 00:00:00 /usr/sbin/hcid
root 2018 1 0 22:16 ? 00:00:00 /usr/sbin/sdpd
root 2041 1 0 22:16 ? 00:00:00 [krfcommd]
root 2076 1 0 22:16 ? 00:00:00 pcscd
root 2086 1 0 22:16 ? 00:00:00 /usr/sbin/acpid
68 2099 1 0 22:16 ? 00:00:00 hald
root 2100 2099 0 22:16 ? 00:00:00 hald-runner
68 2108 2100 0 22:16 ? 00:00:00 hald-addon-acpi: listening on ac
68 2112 2100 0 22:16 ? 00:00:00 hald-addon-keyboard: listening o
root 2122 2100 0 22:16 ? 00:00:00 hald-addon-storage: polling /dev
root 2138 1 0 22:16 ? 00:00:00 /usr/bin/hidd --server
root 2171 1 0 22:16 ? 00:00:00 automount
root 2188 1 0 22:16 ? 00:00:00 ./hpiod
root 2193 1 0 22:16 ? 00:00:00 /usr/bin/python ./hpssd.py
root 2208 1 0 22:16 ? 00:00:00 /usr/sbin/sshd
root 2219 1 0 22:16 ? 00:00:00 cupsd
root 2245 1 0 22:16 ? 00:00:00 sendmail: accepting connections
smmsp 2255 1 0 22:16 ? 00:00:00 sendmail: Queue runner@01:00:00
root 2265 1 0 22:16 ? 00:00:00 gpm -m /dev/input/mice -t exps2
root 2274 1 0 22:16 ? 00:00:00 crond
xfs 2307 1 0 22:16 ? 00:00:00 xfs -droppriv -daemon
root 2316 1 0 22:16 ? 00:00:00 anacron -s
root 2324 1 0 22:16 ? 00:00:00 /usr/sbin/atd
avahi 2351 1 0 22:16 ? 00:00:00 avahi-daemon: running [localhost
avahi 2352 2351 0 22:16 ? 00:00:00 avahi-daemon: chroot helper
root 2418 1 0 22:16 ? 00:00:00 /usr/sbin/smartd -q never
root 2423 1 0 22:16 tty1 00:00:00 /sbin/mingetty tty1
root 2424 1 0 22:16 tty2 00:00:00 /sbin/mingetty tty2
root 2432 1 0 22:16 tty3 00:00:00 /sbin/mingetty tty3
root 2439 1 0 22:16 tty4 00:00:00 /sbin/mingetty tty4
root 2442 1 0 22:16 tty5 00:00:00 /sbin/mingetty tty5
root 2445 1 0 22:16 tty6 00:00:00 /sbin/mingetty tty6
root 2446 1 0 22:16 ? 00:00:00 /usr/sbin/gdm-binary -nodaemon
root 2522 2446 0 22:16 ? 00:00:00 /usr/sbin/gdm-binary -nodaemon
root 2524 1 0 22:16 ? 00:00:00 /usr/libexec/gdm-rh-security-tok
root 2527 2522 0 22:16 tty7 00:00:01 /usr/bin/Xorg :0 -br -audit 0 -a
root 2789 1 0 22:16 ? 00:00:00 /usr/bin/python -tt /usr/sbin/yu
root 2791 1 0 22:16 ? 00:00:00 /usr/libexec/gam_server
maint01 2797 2522 0 22:20 ? 00:00:00 /usr/bin/gnome-session
maint01 2829 2797 0 22:20 ? 00:00:00 [Xsession] <defunct>
maint01 2832 2797 0 22:20 ? 00:00:00 /usr/bin/ssh-agent /bin/sh -c ex
maint01 2855 1 0 22:20 ? 00:00:00 /usr/bin/dbus-launch --exit-with
maint01 2857 1 0 22:20 ? 00:00:00 /bin/dbus-daemon --fork --print-
maint01 2863 1 0 22:20 ? 00:00:00 /usr/libexec/gconfd-2 5
maint01 2864 1 0 22:20 ? 00:00:00 /usr/lib/scim-1.0/scim-launcher
maint01 2868 1 0 22:20 ? 00:00:00 /usr/bin/gnome-keyring-daemon
maint01 2870 1 0 22:20 ? 00:00:00 /usr/libexec/gnome-settings-daem
maint01 2876 1 0 22:20 ? 00:00:00 /usr/lib/scim-1.0/scim-helper-ma
maint01 2877 1 0 22:20 ? 00:00:00 /usr/lib/scim-1.0/scim-panel-gtk
maint01 2879 1 0 22:20 ? 00:00:00 /usr/lib/scim-1.0/scim-launcher
root 2891 2208 0 22:20 ? 00:00:00 sshd: maint01 [priv]
maint01 2900 1 0 22:20 ? 00:00:00 metacity --sm-client-id=default1
maint01 2904 1 0 22:20 ? 00:00:00 gnome-panel --sm-client-id defau
maint01 2906 1 0 22:20 ? 00:00:00 nautilus --no-default-window --s
maint01 2910 1 0 22:20 ? 00:00:00 /usr/libexec/bonobo-activation-s
maint01 2912 1 0 22:20 ? 00:00:00 /usr/libexec/gnome-vfs-daemon
maint01 2916 1 0 22:20 ? 00:00:00 eggcups --sm-client-id default4
maint01 2919 1 0 22:20 ? 00:00:00 gnome-volume-manager --sm-client
maint01 2926 1 0 22:20 ? 00:00:00 bt-applet --sm-disable
maint01 2930 1 0 22:20 ? 00:00:00 nm-applet --sm-disable
maint01 2934 1 0 22:20 ? 00:00:00 /usr/bin/python -tt /usr/bin/pup
maint01 2942 1 0 22:20 ? 00:00:00 pam-panel-icon --sm-client-id de
root 2945 2942 0 22:20 ? 00:00:00 /sbin/pam_timestamp_check -d roo
maint01 2947 1 0 22:20 ? 00:00:00 gnome-power-manager
maint01 2948 1 0 22:20 ? 00:00:00 ./escd --key_Inserted="/usr/bin/
maint01 2951 1 0 22:20 ? 00:00:00 /usr/libexec/wnck-applet --oaf-a
maint01 2956 1 0 22:20 ? 00:00:00 /usr/libexec/gam_server
maint01 2958 1 0 22:20 ? 00:00:00 /usr/libexec/trashapplet --oaf-a
root 2961 1 0 22:20 ? 00:00:00 /usr/sbin/nm-system-settings --c
maint01 2969 2891 0 22:20 ? 00:00:00 sshd: maint01@pts/1
maint01 2970 2969 0 22:20 pts/1 00:00:00 -bash
maint01 3000 1 0 22:20 ? 00:00:00 /usr/libexec/mapping-daemon
maint01 3011 1 0 22:20 ? 00:00:00 /usr/libexec/notification-area-a
maint01 3013 1 0 22:20 ? 00:00:00 /usr/libexec/clock-applet --oaf-
maint01 3015 1 0 22:20 ? 00:00:00 /usr/libexec/mixer_applet2 --oaf
maint01 3021 1 0 22:20 ? 00:00:00 /usr/libexec/notification-daemon
maint01 3025 1 0 22:20 ? 00:00:00 gnome-screensaver
maint01 3037 2970 0 22:27 pts/1 00:00:00 ps -ef
[maint01@localhost ~]$ ps -e
PID TTY TIME CMD
1 ? 00:00:01 init
2 ? 00:00:00 migration/0
3 ? 00:00:00 ksoftirqd/0
4 ? 00:00:00 watchdog/0
5 ? 00:00:00 events/0
6 ? 00:00:00 khelper
7 ? 00:00:00 kthread
10 ? 00:00:00 kblockd/0
11 ? 00:00:00 kacpid
47 ? 00:00:00 cqueue/0
50 ? 00:00:00 khubd
52 ? 00:00:00 kseriod
114 ? 00:00:00 khungtaskd
115 ? 00:00:00 pdflush
116 ? 00:00:00 pdflush
117 ? 00:00:00 kswapd0
118 ? 00:00:00 aio/0
267 ? 00:00:00 kpsmoused
291 ? 00:00:00 ata/0
292 ? 00:00:00 ata_aux
295 ? 00:00:00 scsi_eh_0
300 ? 00:00:00 kstriped
309 ? 00:00:00 ksnapd
320 ? 00:00:00 kjournald
346 ? 00:00:00 kauditd
379 ? 00:00:01 udevd
1209 ? 00:00:00 kmpathd/0
1210 ? 00:00:00 kmpath_handlerd
1266 ? 00:00:00 kjournald
1397 ? 00:00:00 iscsi_eh
1436 ? 00:00:00 ib_addr
1444 ? 00:00:00 ib_mcast
1445 ? 00:00:00 ib_inform
1446 ? 00:00:00 local_sa
1449 ? 00:00:00 iw_cm_wq
1452 ? 00:00:00 ib_cm/0
1455 ? 00:00:00 rdma_cm
1469 ? 00:00:00 brcm_iscsiuio
1475 ? 00:00:00 iscsid
1476 ? 00:00:00 iscsid
1745 ? 00:00:00 dhclient
1843 ? 00:00:00 auditd
1845 ? 00:00:00 audispd
1867 ? 00:00:00 syslogd
1870 ? 00:00:00 klogd
1934 ? 00:00:00 portmap
1960 ? 00:00:00 rpciod/0
1966 ? 00:00:00 rpc.statd
1990 ? 00:00:00 rpc.idmapd
2005 ? 00:00:00 dbus-daemon
2014 ? 00:00:00 hcid
2018 ? 00:00:00 sdpd
2041 ? 00:00:00 krfcommd
2076 ? 00:00:00 pcscd
2086 ? 00:00:00 acpid
2099 ? 00:00:00 hald
2100 ? 00:00:00 hald-runner
2108 ? 00:00:00 hald-addon-acpi
2112 ? 00:00:00 hald-addon-keyb
2122 ? 00:00:00 hald-addon-stor
2138 ? 00:00:00 hidd
2171 ? 00:00:00 automount
2188 ? 00:00:00 hpiod
2193 ? 00:00:00 hpssd.py
2208 ? 00:00:00 sshd
2219 ? 00:00:00 cupsd
2245 ? 00:00:00 sendmail
2255 ? 00:00:00 sendmail
2265 ? 00:00:00 gpm
2274 ? 00:00:00 crond
2307 ? 00:00:00 xfs
2316 ? 00:00:00 anacron
2324 ? 00:00:00 atd
2351 ? 00:00:00 avahi-daemon
2352 ? 00:00:00 avahi-daemon
2418 ? 00:00:00 smartd
2423 tty1 00:00:00 mingetty
2424 tty2 00:00:00 mingetty
2432 tty3 00:00:00 mingetty
2439 tty4 00:00:00 mingetty
2442 tty5 00:00:00 mingetty
2445 tty6 00:00:00 mingetty
2446 ? 00:00:00 gdm-binary
2522 ? 00:00:00 gdm-binary
2524 ? 00:00:00 gdm-rh-security
2527 tty7 00:00:01 Xorg
2789 ? 00:00:00 yum-updatesd
2791 ? 00:00:00 gam_server
2797 ? 00:00:00 gnome-session
2829 ? 00:00:00 Xsession <defunct>
2832 ? 00:00:00 ssh-agent
2855 ? 00:00:00 dbus-launch
2857 ? 00:00:00 dbus-daemon
2863 ? 00:00:00 gconfd-2
2864 ? 00:00:00 scim-launcher
2868 ? 00:00:00 gnome-keyring-d
2870 ? 00:00:00 gnome-settings-
2876 ? 00:00:00 scim-helper-man
2877 ? 00:00:00 scim-panel-gtk
2879 ? 00:00:00 scim-launcher
2891 ? 00:00:00 sshd
2900 ? 00:00:00 metacity
2904 ? 00:00:00 gnome-panel
2906 ? 00:00:00 nautilus
2910 ? 00:00:00 bonobo-activati
2912 ? 00:00:00 gnome-vfs-daemo
2916 ? 00:00:00 eggcups
2919 ? 00:00:00 gnome-volume-ma
2926 ? 00:00:00 bt-applet
2930 ? 00:00:00 nm-applet
2934 ? 00:00:00 puplet
2942 ? 00:00:00 pam-panel-icon
2945 ? 00:00:00 pam_timestamp_c
2947 ? 00:00:00 gnome-power-man
2948 ? 00:00:00 escd
2951 ? 00:00:00 wnck-applet
2956 ? 00:00:00 gam_server
2958 ? 00:00:00 trashapplet
2961 ? 00:00:00 nm-system-setti
2969 ? 00:00:00 sshd
2970 pts/1 00:00:00 bash
3000 ? 00:00:00 mapping-daemon
3011 ? 00:00:00 notification-ar
3013 ? 00:00:00 clock-applet
3015 ? 00:00:00 mixer_applet2
3021 ? 00:00:00 notification-da
3025 ? 00:00:00 gnome-screensav
3038 pts/1 00:00:00 ps
[maint01@localhost ~]$ ps -f
UID PID PPID C STIME TTY TIME CMD
maint01 2970 2969 0 22:20 pts/1 00:00:00 -bash
maint01 3039 2970 0 22:27 pts/1 00:00:00 ps -f
[maint01@localhost ~]$
のようになる。
その中からひっかかるプロセスを表示するために半角スペ|
半角スペGREP ssh
とかすんと
[maint01@localhost ~]$ ps -ef |grep ssh
root 2208 1 0 22:16 ? 00:00:00 /usr/sbin/sshd
maint01 2832 2797 0 22:20 ? 00:00:00 /usr/bin/ssh-agent /bin/sh -c exec -l /bin/bash -c "/usr/bin/dbus-launch --exit-with-session /etc/X11/xinit/Xclients"
root 2891 2208 0 22:20 ? 00:00:00 sshd: maint01 [priv]
maint01 2969 2891 0 22:20 ? 00:00:00 sshd: maint01@pts/1
maint01 3044 2970 0 22:29 pts/1 00:00:00 grep ssh
と表示される。
で?
https://www.google.com/webhp#sclient=psy-ab&hl=ja&site=webhp&source=hp&q=LINX%E3%80%80%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%80%80ps&pbx=1&oq=LINX%E3%80%80%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%80%80ps&aq=f&aqi=&aql=&gs_sm=e&gs_upl=2251l2886l1l3028l3l3l0l0l0l0l151l365l1.2l3l0&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=eb41954a4eb0078b&biw=1024&bih=1164
あとプロの人は
ls -ltrとやっていた、タイムスタンプリバース昇順一覧詳細ロングでー
みたいなの、これすげー
あ、これはリストか
ps -aux |grep hogehoge
とかかね
0 件のコメント:
コメントを投稿