Advertisement
Guest User

Untitled

a guest
Oct 12th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. for dir in `ls -d -- */`
  4. do
  5. #Go to folder
  6. echo "\Folder: $dir"
  7. cd $dir
  8.  
  9. #move files
  10. find . -type f -print0 -exec mv {} . \;
  11.  
  12. #remove all empty folders
  13. for i in `ls -d -- */`;do if [ -d $i ]; then rm -r $i;fi;done
  14.  
  15. #go back to start dir
  16. cd ..
  17. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement