[root@keymaster me]# cat find1.tcl
#!/usr/local/bin/tclsh
#needs tcllib, I used 1.13
package require fileutil
foreach file [fileutil::find /export/home/me {string match -nocase *}] {
set filesize [file size $file]
if {$filesize > 1073741824} {
set gigs [expr {$filesize / 1073741824}]
puts "$gigs G $file"
} elseif {$filesize > 1048576} {
set megs [expr {$filesize / 1048576}]
puts "$megs M $file"
}
}
Thursday, March 24, 2011
find1.tcl
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment