Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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