LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 05-27-2010, 02:57 PM   #1
KBriggs
Member
 
Registered: Jun 2009
Posts: 35

Rep: Reputation: 15
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"?
 
Old 05-27-2010, 03:01 PM   #2
LouRobytes
Member
 
Registered: Mar 2010
Location: Nova Scotia, Canada
Distribution: Ubuntu & Fedora
Posts: 189

Rep: Reputation: 44
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.

Last edited by LouRobytes; 05-27-2010 at 03:04 PM.
 
Old 05-27-2010, 03:05 PM   #3
KBriggs
Member
 
Registered: Jun 2009
Posts: 35

Original Poster
Rep: Reputation: 15
Alright, in that case, how do I move directories? ^_^

Is it just mvdir?
 
Old 05-27-2010, 03:07 PM   #4
someshpr
Member
 
Registered: Jul 2009
Location: WI, USA
Distribution: Debian 8, Ubuntu 16.04, CentOS 7
Posts: 141

Rep: Reputation: 28
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
 
1 members found this post helpful.
Old 05-27-2010, 03:12 PM   #5
LouRobytes
Member
 
Registered: Mar 2010
Location: Nova Scotia, Canada
Distribution: Ubuntu & Fedora
Posts: 189

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

Cheers, Lou
 
Old 05-27-2010, 03:13 PM   #6
KBriggs
Member
 
Registered: Jun 2009
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks, guys
 
Old 05-27-2010, 08:13 PM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,565

Rep: Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901
Please mark as SOLVED if you have your solution.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Juggling HTTP and HTTPS content for multiple virtual hosts. vesperto Linux - Server 10 10-12-2009 11:34 AM
LXer: File Juggling with Krusader LXer Syndicated Linux News 0 01-13-2008 12:50 PM
LXer: File Juggling with Krusader LXer Syndicated Linux News 0 01-11-2008 04:11 AM
Partition Juggling prj SUSE / openSUSE 1 03-06-2005 01:37 PM
Juggling USB devices (fstab related) leiavoia Debian 7 01-28-2005 06:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration