Linux Admin
Pages
Home
Wednesday, 12 September 2012
Looping: Loop through a directory
for i in $(ls);
do
process $i
done
for i in `ls`;
do
process $i
done
Loop to find the total size of a list of files
total=0
for size in `ll | gawk '{print $5}'`;
do
let total=$total+$size;
done
echo $total
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment