Generate a readable UNIX disk free listing
Takeaway: TechRepublic asked members to submit their favorite network administration scripts and this is one of the responses. You can use this script to generate a readable UNIX disk free listing.
TechRepublic recently asked members to submit their favorite Network Administration scripts for possible publication. One of the first to make a submission was Milton Ingram. For his effort, Milton earned $100 and the satisfaction of seeing his script published on TechRepublic.
Earn $100 for your admin script
Let us pay you for your original scripts so that we can publish them as downloads on TechRepublic and allow your fellow IT professionals to benefit from your scripting savvy. We only ask that you put in the appropriate comments to your scripts so that it's easy to tell what the script is doing and which variables might need to be customized. Send us your original admin scripts and we'll pay you $100 for each one that we publish as a TechRepublic download.
In their own words
This script is called df2 (See Listing A). Please excuse the Win line splits, it provides a more readable list of your Linux disk usage in Megabytes, which is really handy when you have a RAID attached with lots of disks. df -k never really cut it for me. It (df2) uses awk and should work on any UNIX variant. Everyone that sees it wants a copy. We use it all the time.
Listing A
#!/bin/ksh
# Generate a readable disk free listing
# MWI 0310
#
echo
"=====================================================================
"
echo "File System Report in MB :" `date`
echo
"=====================================================================
"
echo "File System Device Total Used Avail Capacity
Mounted "
echo
"=====================================================================
"
df -k | sort -k6 |awk '$1!="swap" && $1!="Filesystem"
{tt+=$2;tu+=$3;tr+=$4;printf "%-20s
%10.2f %10.2f %10.2f %7s %-16s\n", $1, $2/1024, $3/1024, $4/1024, $5,
$6}
END{printf "\nTotal Storage is %10.2f %10.2f %10.2f\n", tt/1024,
tu/1024, tr/1024 }'
echo
"=====================================================================
Print/View all Posts Comments on this article
|
|
|
|
|
|
|
|
|
|
White Papers, Webcasts, and Downloads
- The True Costs of Virtual Server Solutions VMware Discover ways to streamline and simplify your assessment of the total acquisition costs of a server virtualization environment. Download Now
- VMware Infrastructure: A Guide to Bottom-Line Benefits VMware Frustrated by the high cost of maintaining or building ever-larger data centers? Get the facts you need to formulate your Virtualization Action Plan. Download Now
- Why Isn't Server Virtualization Saving Us More? A Few Small Changes May Dramatically Increase Your Efficiency VMware Ever wonder why your company isn't saving more from its server virtualization? Making a few small changes could dramatically increase your efficiency. Download Now
- The Scalable Enterprise: VMware ESX Server on the Dell PowerEdge 6650 Dell This paper introduces the server virtualization software, VMware ESX ... Download Now
- Tom Davenport Study: Linking decisions and information for organizational performance IBM Tom Davenport's new client study looks at approaches to linking ... Download Now
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET

