Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-23-2008, 03:20 PM   #1
Registered: Sep 2005
Location: New Jersey, USA
Distribution: Centos 7 , Linux Mint 18.1 Under VMware in Win7
Posts: 548

Rep: Reputation: 34
MV command question.


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.

Old 04-23-2008, 03:31 PM   #2
Registered: Oct 2005
Distribution: Manjaro
Posts: 963

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
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
Registered: Sep 2005
Location: New Jersey, USA
Distribution: Centos 7 , Linux Mint 18.1 Under VMware in Win7
Posts: 548

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

Rep: Reputation: 38
ls -l /mnt/floppy/testdir/

What do you get?

Perhaps you are not moving to the right directory?



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 > Forums > Linux Forums > Linux - Newbie

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

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