LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-16-2010, 05:02 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 37
Little scripting required.


How would i display the output of /proc/partitions in gb representation/
Please help.
Also eager to know what is dm-0 and dm-1?

Code:
# cat /proc/partitions
major minor  #blocks  name

   3     0    8388608 hda
   3     1     104391 hda1
   3     2    8281507 hda2
   3    64     102400 hdb
   3    65      25168 hdb1
 253     0    7208960 dm-0
 253     1    1048576 dm-1
 
Old 07-16-2010, 05:16 AM   #2
smotsie
LQ Newbie
 
Registered: Oct 2009
Location: South West UK
Distribution: Ubuntu
Posts: 2

Rep: Reputation: 1
If you want the gigabyte size of partitions why not use df? This shows filesystem, size, used and available together with where it is mounted. If you want it to miss off the less useful ones and still keep the header use it with a pipe to grep -v "^none":

$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 29G 3.9G 23G 15% /
none 1.9G 280K 1.9G 1% /dev
none 2.0G 2.0M 2.0G 1% /dev/shm
none 2.0G 116K 2.0G 1% /var/run
none 2.0G 0 2.0G 0% /var/lock
none 2.0G 0 2.0G 0% /lib/init/rw
/dev/sda6 170G 61G 100G 38% /home

$ df -h | grep -v "^none"
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 29G 3.9G 23G 15% /
/dev/sda6 170G 61G 100G 38% /home
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Little scripting help required. pinga123 Linux - Newbie 4 07-14-2010 01:10 AM
Linux scripting documentation required morad_dba Linux - Newbie 2 06-10-2010 05:54 AM
Help Required With Shell Scripting bigbadbo Programming 4 03-20-2007 06:30 AM
Help Required With Shell Scripting bigbadbo Linux - General 3 03-19-2007 08:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration