Changing filename or folder name in UNIX with Terminal.


Renaming a file/folder syntax:

-----------------

mv [from] [to]


Example for filename:

----------------------

  • mv text1 text2
  • mv "text with space.txt" text_with_no_space.txt

Example for folder name:
-------------------------

  • mv folder1 folder2

For restricted folders, just put sudo before the command e.g. sudo mv /srv/www/index.php /srv/www/index.phtml


In case you need help with command mv, on your command line or terminal, just type either mv --help, mv -help, mv -h, or man mv depending on the distro you are using.


NOTICE:
-------------

For newbie, please refrain using wild characters on your commands because you might mess up everything. To added, do this on regular user and not as a root.

UNIX: How do I change the name of a file or folder?

Posted on

Wednesday, September 25, 2013

Leave a Reply

I love comments hopefully you can put one.