This PHP script allows you to rename files in a directory by adding a prefix to their names.
-
Make sure you have PHP installed on your system.
-
Open a terminal or command prompt.
-
Navigate to the directory where the PHP script is located using the
cd
command. For example, if the script is saved in theDownloads
folder:cd Downloads
-
php rename_files.php <directory> <prefix>