Skip to content

Instantly share code, notes, and snippets.

@miikka
Created December 14, 2012 16:44
Show Gist options
  • Save miikka/4286806 to your computer and use it in GitHub Desktop.
Save miikka/4286806 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Etsitään tiedostot hakemistosta foo ja siirretään ne hakemistoon bar
find foo -type f -exec mv {} bar \;
# Vaihtoehtoinen tapa, joka lienee nopeampi jos on paljon tiedostoja:
find foo -type f -print0 | xargs -0 -n 25 mv -t bar
# Tiedostot on siirrety pois foosta, poistetaan foo
rm -r foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment