-2

I am looking for a script to discover disk usage/total size, its partition info. I understand commands like 'df', 'fdisk', 'blkid' will produce such information, and a lot of more than I need. So I am wondering whether there is a script to cut info to just show something like: Disk=/dev/sdb3; total=3000 GB; used=30%; system=Linux; TYPE = "ext3" ... ...

And also need such info for both mounted and unmounted disks.

I did some search in stackoverflow, but didn't find such script although I am pretty such experts here know this is an easy question. well, I am not a linux person... that is something I need to learn. :-)

thanks

nidm

Demai Ni
  • 79
  • 1
  • 1
  • 2

1 Answers1

1

If you want to see limited output from, say df, you could try using grep:

df -h | grep /dev/sd

This will show only the lines from df that match "/dev/sd", thus showing your mounted disks.

Robert Gomez
  • 1,269
  • 9
  • 9