LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-23-2008, 03:20 PM   #1
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, (Which Exit LOL), USA
Distribution: Centos 6.7 Under VMware in Win7
Posts: 455

Rep: Reputation: 34
MV command question.


Hello,

I have a question regarding the MV command.

I have a file in the root directory that I have to move to a directory on my floppy drive.

The floppy is mounted correctly now and I can see the target directory called 'testdir' and another file in it.

I can't seem to get the 'mv' correctly set up as the file seems to wind up some place else. I was doing the following:

mv /testfile.txt (which is in the root) /mnt/floppy/testdir

I also tried to mv another file from the floppy to the /root directory and that also go messed up as the file got placed into the '/' directory.

I'm new at this but slowly getting the hang of things.

Thanks.
 
Old 04-23-2008, 03:31 PM   #2
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 958

Rep: Reputation: 35
to do the first thing try

mv /testfile.txt /mnt/floppy/testdir/testfile.txt

and the second

from the floppy dir
mv ./testfile.txt /root

(you need to do that one as root as only root can acsess /root)

if you are just learning command line skills i would STRONGLY recommend not doing this as root but as a normal user.
there is too much chance of messing things up as root
 
Old 04-23-2008, 03:33 PM   #3
jei
LQ Newbie
 
Registered: Jul 2006
Posts: 29

Rep: Reputation: 16
I usually cd into the dir i'm going to move the file FROM.

mv file.txt /mnt/floppy/testdir/

In rare occasions I have seen leaving off the trailing / to actually put the file in the root of the /floppy/ folder as a file named testdir or give an error

You could also use cp file.txt /mnt/floppy/testdir/ then rm file.txt if it just won't work, but it should.

One more method cd into the testdir and do mv /path-to-file/file.txt .
that should put the file into the dir your in.
 
Old 04-23-2008, 06:40 PM   #4
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, (Which Exit LOL), USA
Distribution: Centos 6.7 Under VMware in Win7
Posts: 455

Original Poster
Rep: Reputation: 34
Thanks Jei...
 
Old 04-23-2008, 08:56 PM   #5
okos
Member
 
Registered: May 2007
Location: California
Distribution: Slackware/Ubuntu
Posts: 609

Rep: Reputation: 37
Try
ls -l /mnt/floppy/testdir/

What do you get?

Perhaps you are not moving to the right directory?

okos
 
  


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
command question satimis Debian 2 07-27-2006 04:41 PM
command question simple2 Programming 4 04-09-2006 08:52 PM
Command question satimis Linux - General 8 06-23-2004 03:43 AM
Command Question Siki Linux - General 3 07-29-2003 04:34 PM
Command Question gauge73 Linux - Newbie 2 02-13-2003 09:18 PM


All times are GMT -5. The time now is 08:07 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