Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-30-2003, 07:33 AM
|
#1
|
Member
Registered: Jul 2003
Posts: 60
Rep:
|
how do I move a directory in shell
HELP!!!! I accidentally moved my usr directory into the lost + found directory, now nothing works. I cant even open a terminal.
1. How do I open a terminal?
2. once opened, what commands do I use to move a directory?
|
|
|
07-30-2003, 07:54 AM
|
#2
|
Member
Registered: Jul 2003
Posts: 60
Original Poster
Rep:
|
okay, I figured out how to get a terminal.....now how do I move a directory?
|
|
|
07-30-2003, 08:01 AM
|
#3
|
LQ Newbie
Registered: Mar 2003
Posts: 8
Rep:
|
mv -r /path/to/mydir /path/to/where/it/should/be/.
In this example "mydir" and it's contents are moved into the directory "be"
The -r tells mv (move) to act recursively. You need this when moving a directory.
|
|
|
07-30-2003, 08:02 AM
|
#4
|
Member
Registered: Jul 2003
Posts: 60
Original Poster
Rep:
|
i just did it without the r....gulp
is that bad?
what does recursive mean?
Last edited by DKY; 07-30-2003 at 08:03 AM.
|
|
|
07-30-2003, 08:07 AM
|
#5
|
Member
Registered: Jul 2003
Posts: 60
Original Poster
Rep:
|
okay, I moved it back to lost+found directory, then went to the lost+found directory, and tried
mv -r usr /
only to have it say
mv: invalid option -- r
Try 'mv --help' for more information.
|
|
|
07-30-2003, 10:08 AM
|
#6
|
Senior Member
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Ubuntu Jaunty (9.04)
Posts: 1,044
Rep:
|
recursive means it calls itself over and over. If you dont use -r option than it may not transfer all the files(inside the directory). Normally, you use recursion when removing/deleting the directory but when you are simply moving it, you dont.
just do this:
mv /whatever/file /whatever/desitnation
coo
|
|
|
07-30-2003, 04:40 PM
|
#7
|
LQ Newbie
Registered: Mar 2003
Posts: 8
Rep:
|
Ah... it's removing directories when the -r is compulsory isn't it?
|
|
|
07-30-2003, 05:33 PM
|
#8
|
Senior Member
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Ubuntu Jaunty (9.04)
Posts: 1,044
Rep:
|
yes, thats correct
|
|
|
All times are GMT -5. The time now is 11:01 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|