Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script for du -k with file systems included

Status
Not open for further replies.

jmolson

MIS
Sep 30, 2002
7
0
0
US
I need help writing a script that will do a du -k and list the file system and space available each directory is in. I know if you do a dk -k . it will give the information I want but I cannot figure out how to combine that with the du -k information.

Thank you very much for your help.
 
Thanks for your help.

The one thing the dull script does not give me, that I need, is the File System that the directory is in. We have alot of directories that are listed in the du -k output that are actually links. We need to have the du -k output and then the File system for each directory. I think this is done by the df -k . command but I need to figure out how to write a script that pulls the du -k output in and excutes a df -k . on it.

Thanks again.
 
for dir in `find . -type d`
do ... #this is recursiv, you my be DON'T want
done

for file in `ls`
do [ -d $dir ] || continue # NOT a directory
....
done vox clamantis in deserto.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top