LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 10-17-2010, 07:30 AM   #1
1234rewq
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Rep: Reputation: -11
Moving a file to the root of the drive via command line


How can I move a directory to the root of a drive via command line?

In MS-DOS it would be 'move C:/GAMES/QUAKE C:/'

What is the equivilent in Linux?
 
Old 10-17-2010, 07:33 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Use the command mv: mv source destination, where source and destination are the obvious. Read the man page for mv ("man mv") for more info. This works for directories, as well as regular files.
 
Old 10-17-2010, 07:34 AM   #3
1234rewq
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: -11
Could you please give me and example of the command?
 
Old 10-17-2010, 07:36 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
It's not difficult:

mv stuff /tmp

will move the file stuff in the current directory to the directory /tmp.
 
Old 10-17-2010, 07:37 AM   #5
1234rewq
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: -11
Cool, I figured it out..

mv [DIRECTORY] /
 
Old 10-17-2010, 07:37 AM   #6
1234rewq
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: -11
It might not be difficult, but the question was moving it to the root of the drive, not the tmp directory.. thanks anyway.
 
Old 10-17-2010, 07:39 AM   #7
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You asked for an example..

In any case, please mark your thread as "solved" if you consider the question answered.
 
Old 10-17-2010, 07:40 AM   #8
1234rewq
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: -11
Where is the solved button?
 
Old 10-17-2010, 07:40 AM   #9
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
It should be under "Thread tools" at the top of this thread.
 
  


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
Moving file which it's name contain spaces by command line??? Mr.mick-duck Linux - General 6 03-14-2009 05:30 AM
Saving a file to a USB thumb drive from the command line dbough Linux - Newbie 7 04-17-2007 07:21 PM
Moving files from the command line adam-red Linux - Newbie 5 12-06-2004 04:42 AM
Copy A File Off A CD To The Hard Drive In Command Line nickae77 Linux - Newbie 4 05-21-2004 04:38 AM
moving files and folders thru command line JROCK1980 Linux - General 2 02-16-2004 06:55 PM


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