[Linux]awkで段落を指定して出力

LINEで送る
Pocket

# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        237M     0  237M   0% /dev
tmpfs           244M     0  244M   0% /dev/shm
tmpfs           244M  4.6M  239M   2% /run
tmpfs           244M     0  244M   0% /sys/fs/cgroup
/dev/sda1        40G  4.1G   36G  11% /
tmpfs            49M     0   49M   0% /run/user/1000
tmpfs            49M     0   49M   0% /run/user/1001
  • 1段落、5段落目を出力
# df -h |grep dev |awk '{print $1,$5}'
devtmpfs 0%
tmpfs 0%
/dev/sda1 10%

Was this helpful?

0 / 0

コメントを残す 0

Your email address will not be published. Required fields are marked *