Adding a Prefix to all files in a folder

In my sample folder I have 5 text files that I would like to add a prefix to the file name.


Folder Before

First you change directory to where my folder is located. In my example is a folder called "Folder" at the root of my hard drive.

Change Directory

Then I run a "For in" loop to read all file in the directory.
for FILE in * ; do mv $FILE Reboot_$FILE ; done

Command

 
Here is our end result. You can modify the prefix to almost anything.





Tags

  • Apple
  • Macbook
  • SSD
  • Linux

Categories

  • Hints 210