Rename all files in directory with random prefix

[1185 views]




In this article, we will learn how to add a random prefix to all files inside a particular folder using bash script.

Bash Script to Rename all files in directory with random prefix:

#!/bin/bash for f in *.jpg; do mv "$f" $RANDOM-"$f" done
                 





Comments








Search
Need any Help?


Hot Deals ends in





Earn Money While You Sleep. Join Now to avail Exclusive Bonus




Technical Quiz:



Search Tags

    Add Random prefix to all files inside a folder