LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-16-2005, 11:42 AM   #1
Leonig Mig
LQ Newbie
 
Registered: Sep 2003
Posts: 14

Rep: Reputation: 0
Talking how to move the contents of /mnt/gentoo/k to /mnt/gentoo/


i made a bit of a foul up and i need to copy everything under /mnt/gentoo/k/ to /mnt/gentoo.

is there one command which will move every single directory and file under /mnt/gentoo/k (there is a complete linux filesystem, i.e. usr, sbin, etc, var...) to /mnt/gentoo/?

so that /mnt/gentoo/k/etc/fstab will be /mnt/gentoo/etc/fstab when I finished?

can you even do this in linux?
 
Old 06-16-2005, 11:48 AM   #2
hellfish
LQ Newbie
 
Registered: Jun 2005
Location: Germany, black forest
Distribution: Slackware, Open/FreeBSD
Posts: 13

Rep: Reputation: 0
Re: how to move the contents of /mnt/gentoo/k to /mnt/gentoo/

I am not sure if i got you right.

mv /mnt/gentoo/k/ /mnt/gentoo.
 
Old 06-16-2005, 11:50 AM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
I always use the power of . and ..

For instance..

cd /mnt/gentoo
mv k/* .

That would move everything out of k/ into the present working directory..
 
Old 06-16-2005, 04:49 PM   #4
Leonig Mig
LQ Newbie
 
Registered: Sep 2003
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by trickykid
I always use the power of . and ..

For instance..

cd /mnt/gentoo
mv k/* .

That would move everything out of k/ into the present working directory..

perfect, nice one.
 
Old 06-17-2005, 08:38 AM   #5
hellfish
LQ Newbie
 
Registered: Jun 2005
Location: Germany, black forest
Distribution: Slackware, Open/FreeBSD
Posts: 13

Rep: Reputation: 0
btw

What about reading the documentations first?
Especially when you have such a *very* *very* basic question!
 
Old 06-18-2005, 06:49 AM   #6
Leonig Mig
LQ Newbie
 
Registered: Sep 2003
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by hellfish
btw

What about reading the documentations first?
Especially when you have such a *very* *very* basic question!

well mate, considering the answer you gave was *wrong*, perhaps it's not so basic.
 
Old 06-18-2005, 09:22 AM   #7
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally posted by Leonig Mig
well mate, considering the answer you gave was *wrong*, perhaps it's not so basic.
Well, on a small technical note he most likely made a mistake.. his command would actually move the k directory back into the same place it already is.. his command should have included an * after the k/* like this to work properly:

mv /mnt/gentoo/k/* /mnt/gentoo/

Then that would leave you with all the files in k in /mnt/gentoo and leave you with an empty k/ directory..
 
Old 06-19-2005, 09:10 AM   #8
hellfish
LQ Newbie
 
Registered: Jun 2005
Location: Germany, black forest
Distribution: Slackware, Open/FreeBSD
Posts: 13

Rep: Reputation: 0
Oh well,
yes of course. Just have seen it myself.



Keep cool, boy!
 
Old 06-19-2005, 07:05 PM   #9
Leonig Mig
LQ Newbie
 
Registered: Sep 2003
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by trickykid
Well, on a small technical note he most likely made a mistake.. his command would actually move the k directory back into the same place it already is.. his command should have included an * after the k/* like this to work properly:

mv /mnt/gentoo/k/* /mnt/gentoo/

Then that would leave you with all the files in k in /mnt/gentoo and leave you with an empty k/ directory..

exactly, "cannot copy k as file k already exists". i had already tried that and got exactly that response. that is why I was so careful to describe my problem.

it was the * syntax which I was looking for. the way I was attempting it was copying the file which represented k to the gentoo directory it was alrady in.

the * takes the contents of that directory, leaving k as a directory pointer competely untouched.

in any case, it does seem *very* *very* simple,

but to me it wasn't., and i could not find the answer in the documentation.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mnt cd-rw in 2.6.9-gentoo-r9 CalicoG33X Linux - Hardware 2 02-01-2005 02:36 PM
gentoo: When mounting second cdrom I cant view its contents... ebenh Linux - Hardware 0 11-13-2004 12:39 PM
i changed /mnt/cdrom to /mnt/CD-RW - now i've got a problem?!?! spyghost Linux - Software 7 09-30-2003 02:06 PM
/mnt/cdrom & /mnt/scd0 locks up machine RIgimp75 Mandriva 7 09-01-2003 09:32 PM
mount -t //192.168.0.1/mnt /mnt/windows -o password='' generates error broadsoft Linux - Networking 3 08-07-2003 04:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:04 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
Open Source Consulting | Domain Registration