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 12-05-2003, 08:23 PM   #1
mymojo
Member
 
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 http://gd.tuwien.ac.at/linuxcommand.org/lts0050.php

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!

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

Rep: Reputation: 30
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
mymojo
Member
 
Registered: Oct 2003
Distribution: Slackware 9.1
Posts: 176

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


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
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


All times are GMT -5. The time now is 11:55 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration