- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- bdf in one 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
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
04-06-2004 10:22 PM
04-06-2004 10:22 PM
I have bdf display like this :
/dev/vgx1dsbu01/lvol1
104837120 5162184 93445258 5% /u01
/dev/vgx1dsbu02/lvol1
104837120 28898601 71192430 29% /u02
/dev/vgx1dsbu03/lvol1
104837120 31605129 68654996 32% /u03
/dev/vgx1dsbu04/lvol1
104837120 55150449 46581321 54% /u04
/dev/vgx1dsbu05/lvol1
-----------
because I have long vgname then bdf did not display in one line.
How can I make bdf display each file system in one line cause my script to check file system will fail.
thanks in advance,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2004 10:25 PM
04-06-2004 10:25 PM
Re: bdf in one line
Or
you may store everyline in a var and then print the odd \n even
you want me to work out one for you ?
Regds,
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2004 10:26 PM
04-06-2004 10:26 PM
Re: bdf in one line
It's not just long volume group names that can cause you a problem. NFS mounts do to. Also, on solaris you have the additional problem of swap and /proc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2004 11:07 PM
04-06-2004 11:07 PM
Re: bdf in one line
Please help me.
Hi Mark,
Your script is excellent but it is too complicate for me.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2004 11:19 PM
04-06-2004 11:19 PM
Solutiondf -lk | awk '{if(match($1,"\/") == 1)
FSN = $1
LVOL = (substr($2,2,30))
KT = $(NF - 3)
getline;KA = $1
getline;KU = $1
getline;PU = $1
{printf "%-30s%10s%10s%10s%5s%% %-10s\n",LVOL,KT,KU,KA,PU,FSN}}' | sort -rnk 5
This reformats the df output into a bdf-like view, but with each filesystem only using a single line, sorted so that the filesystem with the highest % used is at the top of the list
eg:
/dev/vg00/lvol3 199242 115245 83997 57% /
/dev/vg00/lvol5 1994023 1136417 857606 56% /opt
/dev/vg00/lvol4 974962 239147 735815 24% /home
/dev/vg00/lvol7 3888053 767928 3120125 19% /usr
/dev/vg00/lvol1 272812 46358 226454 16% /stand
/dev/vg00/lvol8 3875707 564364 3311343 14% /var
/dev/vg00/lvol6 963360 44364 918996 4% /tmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2004 11:31 PM
04-06-2004 11:31 PM
Re: bdf in one line
thanks for your script but a little more help.
I am dump with scriping.
How can I have the heading like bdf
Filesystem kbytes used avail %used Mounted on
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2004 11:37 PM
04-06-2004 11:37 PM
Re: bdf in one line
grep -v Filesystem |awk '{if (NF == "1") printf $0 ;else printf $0 "\n"}'
i.e.
bdf |grep -v Used |awk '{if (NF == "1") printf $0 ;else printf $0 "\n"}'
I tried this on linux now let me know if it doesn't work there
Regds,
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2004 11:37 PM
04-06-2004 11:37 PM
Re: bdf in one line
printf "%-30s%10s%10s%10s%5s %-10s\n" Filesystem kbytes used avail %used Mounted_on
to the start of the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2004 11:45 PM
04-06-2004 11:45 PM
Re: bdf in one line
bdf | while read FS TOT USED AVAIL PERCENT MNT
do
if [ "$TOT" = "" ]
then
read TOT USED AVAIL PERCENT MNT
fi
echo $FS $TOT $USED $AVAIL $PERCENT $MNT
done
Of course, if your terminal width is not wide enough, long lines may get truncated or wrap at the right edge.
You might want to use bdfmegs (attached) which makes the fields smaller (Mbytes, not Kbytes) but still keeps each mountpoint on one line.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2004 01:17 AM
04-07-2004 01:17 AM
Re: bdf in one line
File System Mbytes Used Avail %Used Mounted on
/dev/vg00/lvol3 200 166 34 83% /
/dev/vg00/lvol1 292 53 209 20% /stand
/dev/vg00/lvol8 4600 1662 2917 36% /var
/dev/vg00/lvol13 2048 1005 978 51% /var/opt/perf/datafiles
/dev/vg01/lvol2 12288 4 11901 0% /var/adm/crash
/dev/vg00/lvol7 2048 1395 649 68% /usr
/dev/vg00/lvol14 512 167 324 34% /usr/openv
/dev/vg00/lvol4 512 54 455 11% /tmp
/dev/vg00/lvol6 2048 1462 582 72% /opt
/dev/vg00/lvol12 256 6 234 3% /opt/cctool
/dev/vg00/lvol10 24 2 21 8% /ops
/dev/vg00/lvol5 512 194 315 38% /home
/dev/vg00/lvol11 1024 167 803 17% /data
/dev/vg00/lvol9 1536 363 1100 25% /app
pctransf:/export/usr/sap/trans 6144 2006 3886 34% /usr/sap/trans
iprdbf:/export/sapmnt/IPR 10240 2853 7182 28% /sapmnt/IPR
iprdbf:/export/data/sap/IPR/ARCHIVE 129424 123001 6373 95% /data/sap/IPR/ARCHIVE
iprdbf:/export/sapmnt/IPR 10240 2853 7182 28% /sapmnt/IPR
/dev/vg57/lvol3 8192 69 7869 1% /var/adm/lp
/dev/vg57/lvol4 17176 2005 14939 12% /var/spool/lp
/dev/vg57/lvol1 256 126 122 51% /etc/lp
/dev/vg57/lvol2 256 188 64 75% /var/sam/lp
pctransf:/export/usr/sap/trans 6144 2006 3886 34% /usr/sap/trans
iprdbf:/export/data/sap/IPR/ARCHIVE 129424 123001 6373 95% /data/sap/IPR/ARCHIVE
Don't know if that will cut'n'paste nicely....
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2004 02:00 AM
04-07-2004 02:00 AM