- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Displaying output from df -k in GB instead of ...
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
тАО09-15-2007 08:42 AM
тАО09-15-2007 08:42 AM
Re: Displaying output from df -k in GB instead of KB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2007 09:10 AM
тАО09-15-2007 09:10 AM
Re: Displaying output from df -k in GB instead of KB
"RE" is a common abbreviation for Regular Expression. A more descriptive abbreviation is 'regexp'. In fact, the manpges for 'regexp(5)' provide a good introduction.
http://www.docs.hp.com/en/B2355-60105/regexp.5.html
Regular expressions exist in many languages and utilities. 'grep' is the most familiar case to many. The C language, 'awk', 'sed' and particularly Perl offer regular expressions, Perl having one of the most robust engines built naturally into it.
Regards!
...JRF...
- Tags:
- regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2007 11:12 AM
тАО09-15-2007 11:12 AM
Re: Displaying output from df -k in GB instead of KB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-16-2007 08:42 AM
тАО09-16-2007 08:42 AM
Re: Displaying output from df -k in GB instead of KB
Excellent! Did you already get to the chanter on arrays?
Check this out....
df -l -k | awk -f df.awk
------- df.awk --------------
BEGIN {
header["/ora"]="Oracle Filesystems";
header["/ebr"]="EBR Filesystems";
header["none"]="Flat Files";
}
END {
for (name in header) {
t = 0;
print "\n\n" header[name] "\n-------------\n";
for (j=0; j
printf ("%-20s is %5.1f Gb\n",mount[name,j],size[name,j]/1024/1024)
}
grand += t;
printf ("\nTotal %5.1f Tb\n",t/1024/1024/1024);
}
printf ("\nGrand Total %5.1f Tb\n",grand/1024/1024/1024);
}
/total/ && !/vg00/ {
kb = $(NF-3);
name = "none";
for (x in header) {
if ($1 ~ x) name = x;
}
j = lines[name]++;
mount[name,j] = $1;
size[name,j] = kb;
}
------------------
Cheers,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2007 04:08 AM
тАО09-17-2007 04:08 AM
Re: Displaying output from df -k in GB instead of KB
- « Previous
- Next »