Rename all the files within a folder with prefix “Unix_” i.e. suppose a folder has two files a.txt and b.pdf than they both should be renamed from a single command to Unix_a.txt and Unix_b.pdf
|
|
The rename command can rename files using regular expressions, which makes it very powerful. In your case, you could do
|
|||||
|
|
|
If you're using Zsh as your shell, you could also use the function Add this line to your
then you could run:
See |
|||
|
|
|
With the |
|||
|
|
|
In this particular you could do:
Edit: Retracted per Gilles' comment. For this situation this solution should be considered only a hack due to the caveats as pointed out by the cited article. The other answers are much better. I still think that |
|||||||
|
