Skip to content

Instantly share code, notes, and snippets.

@hgascon
Created June 11, 2015 14:25
Show Gist options
  • Save hgascon/74269c2670cc3c7d1fcb to your computer and use it in GitHub Desktop.
Save hgascon/74269c2670cc3c7d1fcb to your computer and use it in GitHub Desktop.
Move files and files with new extension to a new dir
for FILE in $(ls *.foo); do
NAME=$(echo $FILE | cut -d '_' -f 1)
NAMEBAR=$NAME.bar
mv $FILE DONE/
mv $NAMEBAR DONE/
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment