LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   juggling directories (https://www.linuxquestions.org/questions/linux-newbie-8/juggling-directories-810521/)

KBriggs 05-27-2010 01:57 PM

juggling directories
 
Hey all,

I have a directory that has a another directory inside it. The top directory is rather redundant since it only contains the one other one. Is there a way to delete the top level directory and have the contents simply "move up a level"?

LouRobytes 05-27-2010 02:01 PM

Whenever that happens to me, I just move the contents of the sub-directory up, then delete the sub-dir.

Cheers, Lou

EDIT: Be mindful of any links into the sub-dir.

KBriggs 05-27-2010 02:05 PM

Alright, in that case, how do I move directories? ^_^

Is it just mvdir?

someshpr 05-27-2010 02:07 PM

As far as I know, there is no mvdir command. you have to use rm and rmdir command.
If your top level directory is TOP and sub-directory is SUB

user@machine TOP$ mv SUB/* .
user@machine TOP$ rmdir SUB

LouRobytes 05-27-2010 02:12 PM

Thanks Somesh. I usually do it in a GUI but your command line method looks easier.

Cheers, Lou

KBriggs 05-27-2010 02:13 PM

Thanks, guys

grail 05-27-2010 07:13 PM

Please mark as SOLVED if you have your solution.


All times are GMT -5. The time now is 08:04 PM.