Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > The Community > Everything BSD > help this poor guy please!

Forgot Password?
 Everything BSD   For all discussions regarding Free/NetBSD and OpenBSD.

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 02-11-2006   #1 (permalink)
Just Joined!
 
Join Date: Feb 2006
Posts: 4
help this poor guy please!

Iam working on Free BSD 5.3 version. U all know that the output of 'df' command looks as follows:

Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/ad0s1a 253678 59116 174268 25% /
devfs 1 1 0 100% /dev
/dev/ad0s1e 253678 24280 209104 10% /tmp
/dev/ad0s1f 8913022 2615376 5584606 32% /usr
/dev/ad0s1d 253678 30246 203138 13% /var
devfs 1 1 0 100% /var/named/dev


Now i want to check which partition if greater than 90% full without scanning the first row of record. How to do this using awk command? PLease anyone of u help me with this?
tadakamalla is offline  



Reply With Quote
Old 02-13-2006   #2 (permalink)
Linux User
 
muha's Avatar
 
Join Date: Jan 2006
Posts: 290
depending on what you are trying to do:
df |sed '1d'|awk '{if ($5 > 90) print $5,$6}'|sort -r
99% /harddisk/C
96% /harddisk/E

df |sed '1d'|awk '{if ($5 > 90) print $6}'|sort -r
/harddisk/C
/harddisk/E

or unsorted:
df |sed '1d'|awk '{if ($5 > 90) print $5,$6}'
96% /harddisk/E
99% /harddisk/C

/edit: df |sed '1d'| awk '$5 > 90 {print $5,$6}'
also works ..
muha is offline   Reply With Quote
Old 02-13-2006   #3 (permalink)
Linux Guru
 
bryansmith's Avatar
 
Join Date: Nov 2004
Location: /Ontario/Canada
Posts: 2,622
Does this have anything to do with your homework sounding question?

Bryan
__________________
Looking for a distro? Look here.
"There can be no doubt that all our knowledge begins with experience." - Immanuel Kant (Critique of Pure Reason)
Queen's University - Arts and Science 2008 (Sociology)
Registered Linux User #386147.
bryansmith is offline   Reply With Quote
Old 02-14-2006   #4 (permalink)
Just Joined!
 
Join Date: Feb 2006
Posts: 4
Its not working Muha, i have tried urs but is not working.

And actually i have to compare the 5th field with greater than 90% from the output o fthe df command. So give me a clue to accept this % symbol.
tadakamalla is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
A Newbie's Getting Started Guide to Linux
Learn the basics of the Linux operating systems. Get to know what it is all about, and familiarize yourself with the practical side. Basically, if you're a complete Linux newbie and looking for a quick and easy guide to get you started this is it.
subscribe
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 02:40 PM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1