Answer the question
In order to leave comments, you need to log in
Is it possible to display the size of all disks in json format using one command?
Hello everyone,
I'm displaying the size of the disks attached to the instance:
[email protected]:# df -hT | grep -v overlay | grep -v shm | grep \/dev | grep -v devtmpfs
/dev/nvme0n1p2 ext4 120G 55G 61G 48% /
/dev/nvme4n1 ext4 99G 291M 94G 1% /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/vol-0b3037141a35cb423
/dev/nvme3n1 ext4 493G 426G 46G 91% /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/vol-0aca325ffd5059834
/dev/nvme1n1 ext4 20G 693M 18G 4% /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/vol-060825f3bf5c1f862
/dev/nvme2n1 ext4 246G 189G 47G 81% /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/vol-0d94c8142d28f9753
Answer the question
In order to leave comments, you need to log in
Googled it:
https://stackoverflow.com/questions/35211716/store...
Also, excerpt from man df
:
--output[=FIELD_LIST] use the output format defined by FIELD_LIST, or print all fields if FIELD_LIST is omitted. И далее внизу: FIELD_LIST is a comma-separated list of columns to be included. Valid field names are: 'source', 'fstype', 'itotal', 'iused', 'iavail', 'ipcent', 'size', 'used', 'avail', 'pcent', 'file' and 'target' (see info page).
df -h --output="source,pcent" | tr -s ' ' | csvjson -d' '
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question