Linux Move Directory Command

by on April 2, 2012 · 2 comments· last updated at April 2, 2012

I am new to Linux and command line. How do I move a directory under Linux operating systems?

To move SOURCE directory to a DEST directory use the mv command as follows:

 
mv source dest
mv /path/to/source /path/to/dest
 

In this example, move /home/vivek/data/ directory to /nas/home/vivek/archived/ directory:
$ mv /home/vivek/data/ /nas/home/vivek/archived/
OR
$ cd /home/vivek
$ mv data/ /nas/home/vivek/archived/

To get verbose output (explain what is being done), type:
$ mv -v /home/vivek/data/ /nas/home/vivek/archived/

How do I Move Multiple Directories?

Use the following syntax to move dir1 and dir2 to /path/to/dest/ directory:
$ mv -v dir1 dir2 /path/to/dest/
$ ls -l /path/to/dest/

OR use the following syntax:
$ mv -v /home/vivek/dir1/ /home/vivek/dir2/ -t /nas/home/vivek/archived/



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 2 comments… read them below or add one }

1 sylvainulg April 3, 2012 at 12:05 pm

and if for some reasons, you hadn’t the “-v” option enabled at first or would rather be happy with some periodic updates, you can use something like

watch “lsof -n | grep ‘mv .* /path/to/dest/’ “

Reply

2 Ilan Ben-Shmuel April 24, 2013 at 12:44 am

Also openjdk-6 libraries works for me

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as: , , , , , , , , , , , ,

Previous Faq:

Next Faq: