| Blogs | Classifieds | Downloads | FlashChat | Gallery | Googlemap | Invite Friends | Links | Projects | Reviews | Wiki |
| |||||||||
Welcome to the pSeries Tech Forums,
our free peer-based support site for administrators, engineers and architects working with IBM pSeries servers and software. You are currently viewing our site as a guest which gives you limited access to view most discussions, articles, tutorials and access our other free features. By joining our community you will be able to collaborate with administrators, engineers and architects charged with designing, delivering or maintaining IBM pSeries server environments. Founded by a recognized IBM pSeries consultant and IBM Redbook author, pSeries Tech Forums was developed with the single mission of bringing IBM pSeries professionals together into a single self-help community. Registration is fast, simple and absolutely free to all IT professionals with responsibility for or interest in IBM pSeries servers. We invite you to join our community today! If you have any problems with the registration process or your account login, please contact contact support. |
| Our Sponsors | |
| | |
| Want to advertise? | |
![]() |
| | LinkBack | Thread Tools |
|
#1
| ||||
| ||||
I'm looking for a script that will find the 20 largest files in the root filesystem, but will ignore mounted filesystems. I need to do some root cleanup, but I can't see the largest files. Dave |
|
#2
| ||||
| ||||
A standard du should work. It could get more advanced, but you're just asking for problems. -k for kilobytes. -x for not hopping filesystems. and sort the output numerically. # du -kx / | sort -n |
|
#3
| ||||
| ||||
I use this for my users, it works pretty good $ shrimp /usr/users/alexisl> cat get_du # This is get_du cd /usr/users oper=/usr/users/operator larry=/usr/users/alexisl ls > $larry/dir_list num_dir=`wc -l $larry/dir_list|cut -c 5-8` echo $num_dir $larry/du_report < $larry/dir_list $ shrimp /usr/users/alexisl> cat du_report # This is du_report, it report on disk use in the /usr directory cd /usr/users oper=/usr/users/operator larry=/usr/users/alexisl rm $larry/full_du.txt num_dir=`wc -l $larry/dir_list|cut -c 5-8` echo $num_dir read dir_name set `date` today="$1 $2 $3 $4" echo "\t The top offenders as of $today \n" > $larry/top_offenders.txt echo " MB \t Directory/file " >> $larry/top_offenders.txt echo "\t This is the Disk Usage Report for the /usr/users directory as of $today" > $larry/disk_usag e.txt echo "_________________________________________________ ___________________________" >> $larry/disk_u sage.txt echo " " >> $larry/disk_usage.txt let x=1 while [ $x -le $num_dir ] do echo "List of files and sizes for $dir_name" >> $larry/disk_usage.txt echo "MB \t Filename " >> $larry/disk_usage.txt echo "______________________________________" >> $larry/disk_usage.txt du -am $dir_name >> $larry/disk_usage.txt wait du -am $dir_name >> $larry/full_du.txt echo " " >> $larry/disk_usage.txt x=$x+1 read dir_name done sort -n $larry/full_du.txt > $larry/full_du.sort tail -20 $larry/full_du.sort >> $larry/top_offenders.txt cat $larry/top_offenders.txt |
|
#4
| ||||
| ||||
Hi There find . -type f -xdev | xargs ls -ld | sort -rnk 5 | head -20 the -xdev will ensure the command does not traverse filesystems If you want a list from / of all files on the server find . -type f -ls | sort -rnk 7 | head -20 HTH Steve
__________________ Take your time and think things through !! To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NIM server and client operations | steevojb | Tutorials | 22 | 2 Weeks Ago 01:35 |
| Using Secure Rsync to Synchronize Files Between Servers | FASherman | Tutorials | 1 | October 10th, 2006 20:59 |