I use the following command to rename all files with no spaces adding prefix "Hello"
for FILENAME in *; do mv $FILENAME Hello_$FILENAME; done
I use the following command to get unix datestamp
date +%s
How do I replace Hello with date +%s output?
If I understand your question, then you could use the $(date +%s) command substitution syntax to get the command output (and I suggest quotes) like
for i in *; do mv "$i" "$(date +%s)_$i"; done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With