parted /dev/sda print

See size of partitions as human readable

See size of partitions as human readable and get extra informations about hdd and partitions
Sample Output
Model: ATA ST3160811AS (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  2000MB  1999MB  primary   ext3            boot
 2      2001MB  160GB   158GB   extended
 5      2001MB  22.0GB  20.0GB  logical   ext3
 6      22.0GB  26.0GB  3999MB  logical   ext3
 7      26.0GB  29.0GB  2999MB  logical   ext3
 8      29.0GB  33.0GB  3999MB  logical   ext3
 9      33.0GB  37.0GB  3999MB  logical   linux-swap(v1)
10      37.0GB  57.0GB  20.0GB  logical   ext3

5
By: mesuutt
2012-06-05 09:11:06

1 Alternatives + Submit Alt

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: