Linux script that reads thru folders and execute command
how to write a script that reads thru the bunch of folders using while loop.
Please let me know. Thanks! |
where are you stuck ?
i would use the find command to get a list of the directories then pipe it into whatever program i would want to run. the basic structure would be: Code:
while read line |
Thank you for the reply.
I have one command as below which will sum the file size in each folder, want to execute in 50 folders and get the size of all folders. instead of executing the command in each folder. find . -type f -newer folder1 -not -newer folder2 -printf "%s\n" | awk '{sum += $0} END{print sum}' |
Quote:
Code:
find . -type d | while read dir |
All times are GMT -5. The time now is 07:01 PM. |