filesystems > 70%


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting filesystems > 70%
# 1  
Old 06-14-2011
filesystems > 70%

I need a scrip that will show me the filesystems that are greater than 70%...but not sure how to filter using the df -h | grep

Thank you for your help!!
# 2  
Old 06-14-2011
Grep doesn't understand numerals. Doing that in grep would be awkward at best.

In any case we don't know what your df -h output looks like. It's not the same everywhere.
# 3  
Old 06-14-2011
This is just an example of what it looks like..
Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/rootvg-rootlv
                      5.0G  3.3G  1.4G  71% /
tmpfs                 4.0K     0  4.0K   0% /dev/vx
/dev/cciss/c0d0p1     251M   87M  152M  37% /boot
none                  7.9G     0  7.9G   0% /dev/shm
/dev/mapper/rootvg-homelv
                     1008M   34M  923M   4% /home
/dev/mapper/rootvg-optlv
                      2.0G 1021M  894M  54% /opt
/dev/mapper/rootvg-tmplv
                      3.0G  473M  2.4G  17% /tmp

# 4  
Old 06-14-2011
How about this

Code:
 
df -h | perl -ne 'print if (/(\d+)%/ && $1>70)'

This User Gave Thanks to getmmg For This Post:
# 5  
Old 06-14-2011
Something like this:

Code:
 
df -h | awk 'NR == 1 { print ; next }
NF==6 { gsub("%",""); if ($5 > 35)  print ;next }
NF==1 { gsub(" ",""); a=$0;next}
{ gsub("%",""); $1=$1; if ($4 > 35)  print a" "$0 }'

This User Gave Thanks to panyam For This Post:
# 6  
Old 06-14-2011
Code:
df -h|nawk '{gsub(/%/,"");if($5>70)print}'

Thanks
Sha
This User Gave Thanks to Shahul For This Post:
# 7  
Old 06-14-2011
Code:
df -h|nawk 'int($5)>70'

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Clustering filesystems

SunOS 5.10 Generic_142900-15 sun4u sparc SUNW,SPARC-Enterprise How can I tell if "clustering" is being used in my shop? I have to file systems that are identical. These filesystems are nfs mounted. But how can I tell if they are being kept in sync as a result of clustering or some other... (2 Replies)
Discussion started by: Harleyrci
2 Replies

2. Shell Programming and Scripting

Filesystems using more than 75% capacity

i need to write a shell script for printing the list of filesystems whose disk utilization is more than 75%...i tried using df -h along with awk but cud'nt make the combination work.....:wall: when we do df -h then the filesystems which are using more than 75% capacity shud be printed according to... (11 Replies)
Discussion started by: xtatic
11 Replies

3. UNIX for Dummies Questions & Answers

Read only filesystems

hi guys suse 10.2 today some guys are adding some luns from a SAN so in order to add them I followed this command echo 1 > /sys/class/fc_host/host1/issue_lip echo "- - -" > /sys/class/scsi_host/host<number>/scan nice now after that I tried to create a folder in / but it won't let... (2 Replies)
Discussion started by: karlochacon
2 Replies

4. UNIX for Dummies Questions & Answers

mounted filesystems

how to check the record of previously mounted remote filesystems after the filesystems are unmounted .operating system is solaris 10 (0 Replies)
Discussion started by: ravijanjanam12
0 Replies

5. AIX

Filesystems cmd

hi is that any command to find out which filesystems occupying more process in cpu utilisation (4 Replies)
Discussion started by: senmak
4 Replies

6. AIX

Extending filesystems

Hi to all i want to increase the /usr size. but, it is mirrored on hdisk0 and hdisk1. i know that chfs will work, but i am not confident about mirroring. can anyone tell me the procedure. thanks (2 Replies)
Discussion started by: honeym210
2 Replies

7. UNIX for Advanced & Expert Users

resize filesystems

Dear All We have HP9000 rp7400 Server running with hp-ux 11i. Our Disk storage has two volume groups and are allocated as follows: 1. /#vgdisplay -v --- Volume groups --- VG Name /dev/vg00 VG Write Access read/write VG Status available... (1 Reply)
Discussion started by: mhbd
1 Replies

8. Shell Programming and Scripting

Filesystems GT 95%

Hi How can I only print the file systems that are more than 95% full. I used the df -k output and tried to check for each file system and then print only the ones that meet the criteria... But my solution seems cloodgie ... (3 Replies)
Discussion started by: YS2002
3 Replies

9. UNIX for Dummies Questions & Answers

mounted filesystems

If you have multiple hard drives and multiple mounted filesystems, how can you tell which filesystem resides on which disk? (3 Replies)
Discussion started by: jalburger
3 Replies

10. UNIX for Advanced & Expert Users

Filesystems

my partner change the server's ip address and now i can't to mount the oracle's filesystem, what i do? i don't want to reinstall Unix. My unix is SCO UNIX 5.0.5 (9 Replies)
Discussion started by: marun
9 Replies
Login or Register to Ask a Question