LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-28-2007, 07:32 AM   #1
shorun
Member
 
Registered: Mar 2006
Location: belguim
Distribution: fedora, mandriva, suse
Posts: 148

Rep: Reputation: 15
Question simple "mv" problem


hi all
i'm a bit confused.

ok, i'm in the dir "/data/temp/new/"
and i want to move all the files in this drive to "/data/etc/multimedia/"
i've done "mv * /data/etc/multimedia/" and he asks me if i want to overwrite the directory /data/etc/multimedia

what did i do wrong?
how can i move all the files from the folder i'm in to another folder on the hard drive?

i've checked "man mv" but i can't seem to find this exact problem.

thnx
 
Old 03-28-2007, 09:10 AM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
mv /data/temp/new/* /data/etc/multimedia

You don't need to be in the directory of the files you wish to move. As long as you know where they are and where they need to go, you can use the mv command.

Last edited by {BBI}Nexus{BBI}; 03-28-2007 at 09:16 AM.
 
Old 03-28-2007, 09:19 AM   #3
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
The 'mv' command has the effect of re-naming files as well as moving the file to a different location. So, what that means is you have to use a name in the source file.

Say, for example you had files file1.mp3 file2.mp3 and file3.mp3 in the source directory. You want to move all in one command...

'mv /data/temp/new/*.mp3 /data/etc/multimedia/' should move all files with the extension of .mp3 to the destination directory and erase all copies in the source directory. They should keep the same permissions, and file names.

Move can be a little dangerous, so until you are sure of what you are doing, you could use the -i option. Mv will then prompt you on each move. A little safer...

You can also do this kind of thing with a graphical file manager. Knoqueror Krusader and Nautlius just to name three that will do what you want.
 
Old 03-28-2007, 11:07 AM   #4
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Quote:
Originally Posted by camorri
Move can be a little dangerous, so until you are sure of what you are doing, you could use the -i option. Mv will then prompt you on each move. A little safer...
This is very true, as an extra precaution you could use the cp (copy) command instead. If all copies correctly delete the source files after.
 
  


Reply



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
Simple bash problem: "until" morrolan Linux - Newbie 1 07-17-2006 08:42 AM
MIC Problem > "Unable to find simple control mic" Balarabay1 SUSE / openSUSE 3 04-09-2006 11:08 PM
Proposed solution for "status" (aka "problem solved") indicator demerson3 LQ Suggestions & Feedback 12 04-08-2006 02:15 PM
Simple Ooo BASIC Macro problem: "connot coerce argument type..." tredegar Linux - Software 0 08-14-2005 10:00 AM
problem "make"ing gtk+ "/usr/bin/env: perl -w" caid Linux - Newbie 8 07-29-2005 04:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:09 AM.

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
Open Source Consulting | Domain Registration