Unix Command To Rename A Folder

by Vivek Gite on January 2, 2009 · 1 comment

How do I rename a folder under UNIX operating systems using a command line tools?

You need to use the mv command to rename a folder under UNIX operating systems. You must have write permission for all folders.

Syntax

The syntax is as follows:

mv old-folder-name new-folder-name
mv /path/to/old /path/to/new

Example

In this example, a folder called drivers is renamed as olddrivers. Open a terminal (shell prompt) and type the following commands:

ls
mv drivers oldrivers
ls

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 1 comment… read it below or add one }

1 Rogelio September 25, 2011

I how do I move a file or folder into another directory? I have tried mv file.rtf ~/Documents mv ~/file.rtf ~/Documents and mv ~/file.rtf ~/Documents/ none of these work.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 6 + 10 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: