- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Script to list "df -h" output in a single Line...
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
Discussions
Discussions
Forums
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
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
тАО11-15-2012 06:34 AM - last edited on тАО11-15-2012 06:05 PM by Maiko-I
тАО11-15-2012 06:34 AM - last edited on тАО11-15-2012 06:05 PM by Maiko-I
Dear System Administrators:
On the HP-UX side of the house I have been using "bdfmegs.sh" script by Bill Hassel to obtain pleasant outputs in a single line. Is there anything similar to produce outputs on a LINUX Server? Any input from your end would be most appreciated.
Regards,
-Kennedy
P.S. This thread has been moved from HP-UX > System Administration to Linux > sysadmin - HP Forums Moderator
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-15-2012 07:06 AM
тАО11-15-2012 07:06 AM
Re: Script to list "df -h" output in a single Line - Similar to bdfmegs.sh on RHEL
No need for a special script. Just add the '-P' to your df command.
[root@rh6x ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_atl10rh6x-lv_root 5.5G 1.3G 4.0G 24% / tmpfs 1004M 0 1004M 0% /dev/shm /dev/sda1 485M 30M 430M 7% /boot [root@rh6x ~]# df -Ph Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_atl10rh6x-lv_root 5.5G 1.3G 4.0G 24% / tmpfs 1004M 0 1004M 0% /dev/shm /dev/sda1 485M 30M 430M 7% /boot
It's not quite as pretty, but the information is all on one line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-15-2012 07:24 AM
тАО11-15-2012 07:24 AM
Re: Script to list "df -h" output in a single Line - Similar to bdfmegs.sh on RHEL
Thanks a lot. That helps! Thanks for taking the time and writing back.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-15-2012 11:23 AM
тАО11-15-2012 11:23 AM
SolutionHi Kennedy,
You can try something like this , adding to Patrick's command, to get more alligned output with your df command:
(I dont have system to test it now , but you can give it a try, )
# df -Ph | awk '{printf "%-35s%-10s%-10s%-10s%-5s%s",$1,$2,$3,$4,$5,$6}'
Hth,
Raj D.
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-15-2012 11:25 AM - edited тАО11-15-2012 11:28 AM
тАО11-15-2012 11:25 AM - edited тАО11-15-2012 11:28 AM
Re: Script to list "df -h" output in a single Line - Similar to bdfmegs.sh on RHEL
You were close with:
df -Ph | awk '{printf "%-35s%-10s%-10s%-10s%-5s%s",$1,$2,$3,$4,$5,$6}'
You just need a "\n" to add a new line.
df -Ph | awk '{printf "%-35s%-10s%-10s%-10s%-5s%s\n",$1,$2,$3,$4,$5,$6}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-15-2012 11:54 AM
тАО11-15-2012 11:54 AM
Re: Script to list "df -h" output in a single Line - Similar to bdfmegs.sh on RHEL
Thanks a lot Patrick. Now my outputs look way better!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-15-2012 11:55 AM
тАО11-15-2012 11:55 AM