Skip to content

Instantly share code, notes, and snippets.

@wincentbalin
Last active September 25, 2016 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wincentbalin/4bdeaaec38ec8ffe26c6034892229e89 to your computer and use it in GitHub Desktop.
Save wincentbalin/4bdeaaec38ec8ffe26c6034892229e89 to your computer and use it in GitHub Desktop.
Remove prepended 4-digits numbers from filenames.
#!/bin/sh
#
# Denumerate all files
for weekday in [0-9]*
do
cd "$weekday"
for file in *
do
if [ "$file" == "url.txt" ]
then
echo Disregarding url.txt
continue
fi
echo Renaming $file...
old="$file"
new=`echo "$file" | cut -b 4-`
mv "$old" "$new"
done
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment