Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Loop through all files in folder and append a random string to end of filename
- for file in *.*
- do
- name=${file%.*}
- ext=${file##*.}
- random=$(LC_CTYPE=C tr -cd 'a-zA-Z0-9' < /dev/urandom | head -c 10)
- mv "$file" "${name}_${random}.${ext}"
- done
- # Loop through and transform spaces to underscores
- for file in *.*
- do
- mv -- "$file" "${file// /_}"
- done
- # Create a csv of all the filenames in a directory
- "ls" > files.csv
Add Comment
Please, Sign In to add comment