- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: df command
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 06:07 PM
03-30-2004 06:07 PM
I am using df -k to show all the disk space and usage of the filesystem. Is there anyway that I can display the disk space in MB format rathan KB
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 06:15 PM
03-30-2004 06:15 PM
Solutionmodify this which parses bdf output.
#!/usr/bin/ksh
echo "Filesystem Mbytes used avail %used Mounted on"
bdf $1 | grep -v Filesystem | awk '{ printf("%s %10d %10d %10d %4s %s\n",$1,$2/1024,$3/1024,$4/1024,$5,$6)}'
#!/usr/bin/ksh
echo "Filesystem Mbytes used avail %used Mounted on"
df -k $1 | grep -v Filesystem | awk '{ printf("%s %10d %10d %10d %4s %s\n",$1,$2/1024,$3/1024,$4/1024,$5,$6)}'
You have to mess with it so that it gets the kb figure divided by 1024. It can be done.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 06:17 PM
03-30-2004 06:17 PM
Re: df command
I suppose with enough contortions my poorly explained post can be useful.
LOL
SEP@conference.my.pillow
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 06:21 PM
03-30-2004 06:21 PM
Re: df command
what is the O.S.
In Hp try bdf or
in Linux try
df -H
Reg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 06:22 PM
03-30-2004 06:22 PM
Re: df command
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 06:28 PM
03-30-2004 06:28 PM
Re: df command
Thanks for the reply I have notice your script is very useful but not easy to parse
echo "Filesystem Mbytes used avail %used Mounted on"
df -k $1 | grep -v Filesystem | awk '{ printf("%s %10d %10d %10d %4s %s\n",$1,$2/1024,$3/1024,$4/1024,$5,$6)}'
I need to convert the output to a CSV file but the output simply generate too much spaces in between the field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 07:15 PM
03-30-2004 07:15 PM
Re: df command
I get confuse when you say disk space because it is not equal to filesystem space.
Anyway bdf is the best command in order to see the filesystem space (total size, used and available space).
Anyway the best command in order to see the used space is 'du -sk'; option -k stands for Kbytes. It is more reliable about the used space of a filesystem than bdf.
HTH.
Best regards,
Ettore
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2004 11:28 PM
03-31-2004 11:28 PM
Re: df command
If you want to see the file system size in MB, you can use lvdisplay. For finding out freespace, used space, available etc. bdf is best.
Cheers
Shyjith