Help answer threads with 0 replies.
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 12-05-2003, 08:23 PM   #1
Registered: Oct 2003
Distribution: Slackware 9.1
Posts: 176

Rep: Reputation: 30
noob MV question

files and dirs..

file1 folder1

how would I move file1 to folder1?

and file1 to ../folder2

thanks... I checked man pages... and

but it's so confusing...

(look and see)

mv file1 file2
If file2 does not exist, then file1 is renamed file2. If file2 exists, its contents are replaced with the contents of file1.

mv -i file1 file2
Like above however, since the "-i" (interactive) option is specified, if file2 exists, the user is prompted before it is overwritten with the contents of file1.

mv file1 file2 file3 dir1
The files file1, file2, file3 are moved to directory dir1. dir1 must exist or mv will exit with an error.

mv dir1 dir2
If dir2 does not exist, then dir1 is renamed dir2. If dir2 exists, the directory dir1 is created within directory dir2.

I don't know how to simply move one file to another directory!

Old 12-05-2003, 09:19 PM   #2
Registered: Aug 2003
Location: Atlanta
Distribution: Debian, OS X
Posts: 711

Rep: Reputation: 31
To move file1 into folder1 you would do this, provided they were both in the same directory.

$ mv file1 folder1

If folder1 is a directory up (..) from file1 you would do this:

$ mv file1 ../folder1

What I would recommend is just make some empty files (touch omg will create an empty file called omg) and empty directories and just mess around with it. The best way to learn is through experimentation, provided your system doesn't become fubar'd
Old 12-08-2003, 04:32 AM   #3
Registered: Oct 2003
Distribution: Slackware 9.1
Posts: 176

Original Poster
Rep: Reputation: 30
been tinkering around now with it, thanks


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
nOOb question hammernh Linux - Networking 4 11-06-2004 06:26 AM
noob with a noob question phoonerorlater Linux - Newbie 2 09-29-2004 04:43 PM
noob question.... slivuh Linux - Newbie 2 03-11-2004 05:31 PM
Complete noob question from a noob noob_hampster Linux - Software 2 09-04-2003 01:03 AM
Another Noob Question? BajaNick Linux - Software 5 07-28-2003 02:43 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:30 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration