0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

duコマンドの全合計値を算出する(awk)

Last updated at Posted at 2021-02-15

duコマンドの全合計値を算出する(awk)

awk使えば合計値出せることを知ったのでメモメモ

$ df -m | awk '{sum+=$2; print $0}  END{print "合計:"sum}'
Filesystem     1M-blocks   Used Available Use% Mounted on
rootfs            227872 218097      9775  96% /
none              227872 218097      9775  96% /dev
none              227872 218097      9775  96% /run
none              227872 218097      9775  96% /run/lock
none              227872 218097      9775  96% /run/shm
none              227872 218097      9775  96% /run/user
tmpfs             227872 218097      9775  96% /sys/fs/cgroup
C:\               227872 218097      9775  96% /mnt/c
合計:1822977
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?