Reputation: 11259
mv command doesnt accept pattern matching like grep !
Whats the good way to handle this and similar kind of operations ?
Upvotes: 2
Views: 365
Reputation: 37441
There's the rename
tool, but if that's not what you want, you can do:
for file in *; do
new_file="${file##[0-9]}" # Strip all leading numbers
mv "$file" "$newfile"
done
Upvotes: 2