Skip to content

Instantly share code, notes, and snippets.

@hotakasaito
Last active March 16, 2016 03:08
Show Gist options
  • Save hotakasaito/0eaec84f2bcfdd2f5e26 to your computer and use it in GitHub Desktop.
Save hotakasaito/0eaec84f2bcfdd2f5e26 to your computer and use it in GitHub Desktop.
意外と知られてないかもしれないlinuxコマンドのオプション ref: http://qiita.com/hotakasaito/items/9387709f75e7a2c69d92
ps -Cruby ufw
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
webapp 19078 0.0 2.6 113468 26572 ? Ssl 22:08 0:00 puma 2.10.2 (unix:///var/run/puma/my_app.sock)
webapp 19084 0.3 18.3 845408 186564 ? Sl 22:08 0:16 \_ puma: cluster worker 0: 19078
healthd 2410 0.0 2.6 686832 27316 ? Ssl 2015 50:45 puma 2.11.1 (tcp://127.0.0.1:22221) [healthd]
ps -Cruby,nginx ufw
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
webapp 19078 0.0 2.6 113468 26572 ? Ssl 22:08 0:00 puma 2.10.2 (unix:///var/run/puma/my_app.sock)
webapp 19084 0.3 18.3 845408 186564 ? Sl 22:08 0:16 \_ puma: cluster worker 0: 19078
healthd 2410 0.0 2.6 686832 27320 ? Ssl 2015 50:45 puma 2.11.1 (tcp://127.0.0.1:22221) [healthd]
root 2672 0.0 0.8 112852 8816 ? Ss 2015 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx 18721 0.0 0.9 113016 9644 ? S 22:07 0:00 \_ nginx: worker process
ps -Uwebapp ufw
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
webapp 6270 0.0 1.9 113428 20328 ? Ssl Mar01 0:24 puma 2.10.2 (unix:///var/run/puma/my_app.sock)
webapp 6291 0.2 16.9 847548 172956 ? Sl Mar01 45:58 \_ puma: cluster worker 0: 6270
ps -Uwebapp,ec2-user ufw
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
ec2-user 32296 0.0 0.3 115656 3780 ? S 12:05 0:00 sshd: ec2-user@pts/0
ec2-user 32297 0.0 0.3 115564 3544 pts/0 Ss 12:05 0:00 \_ -bash
ec2-user 32375 0.0 0.2 117152 2472 pts/0 R+ 12:07 0:00 \_ ps -Uwebapp,ec2-user ufw
webapp 6270 0.0 1.9 113428 20332 ? Ssl Mar01 0:24 puma 2.10.2 (unix:///var/run/puma/my_app.sock)
webapp 6291 0.2 16.9 847548 172960 ? Sl Mar01 45:59 \_ puma: cluster worker 0: 6270
sudo netstat -lnatp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2230/sshd
tcp 0 0 127.0.0.1:8600 0.0.0.0:* LISTEN 19044/consul
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2270/sendmail
tcp 0 0 0.0.0.0:24224 0.0.0.0:* LISTEN 19013/ruby
tcp 0 0 127.0.0.1:22221 0.0.0.0:* LISTEN 2410/puma 2.11.1 (t
tcp 0 0 0.0.0.0:40781 0.0.0.0:* LISTEN 2084/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2067/rpcbind
tcp 0 0 127.0.0.1:8400 0.0.0.0:* LISTEN 19044/consul
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2672/nginx
tcp 0 0 127.0.0.1:8500 0.0.0.0:* LISTEN 19044/consul
dmesg -T
...
[Tue Nov 24 23:22:27 2015] evbug: Connected device: input0 (AT Translated Set 2 keyboard at isa0060/serio0/input0)
[Tue Nov 24 23:22:27 2015] evbug: Connected device: input2 (Power Button at LNXPWRBN/button/input0)
[Tue Nov 24 23:22:27 2015] evbug: Connected device: input3 (Sleep Button at LNXSLPBN/button/input0)
[Tue Nov 24 23:22:28 2015] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input4
[Tue Nov 24 23:22:28 2015] evbug: Connected device: input4 (ImExPS/2 Generic Explorer Mouse at isa0060/serio1/input0)
[Tue Nov 24 23:22:31 2015] EXT4-fs (xvda1): re-mounted. Opts: (null)
[Tue Nov 24 23:22:31 2015] NET: Registered protocol family 10
ip -f inet -o addr show
1: lo inet 127.0.0.1/8 scope host lo\ valid_lft forever preferred_lft forever
2: eth0 inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0\ valid_lft forever preferred_lft forever
3: eth1 inet 192.168.10.3/24 brd 192.168.10.255 scope global eth1\ valid_lft forever preferred_lft forever
top -b -n 1 | head
top - 18:19:13 up 11 days, 11:36, 1 user, load average: 0.00, 0.01, 0.05
Tasks: 129 total, 1 running, 128 sleeping, 0 stopped, 0 zombie
%Cpu(s): 2.1 us, 0.8 sy, 0.0 ni, 97.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 501736 total, 463892 used, 37844 free, 3620 buffers
KiB Swap: 4194300 total, 498476 used, 3695824 free. 34032 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
935 app 20 0 900316 166816 1012 S 6.3 33.2 7:22.24 ruby
1 root 20 0 33632 244 220 S 0.0 0.0 0:01.41 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.04 kthreadd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment