|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
how to move all file in a folder to another folder using unix command?
i'm new to linux. please help me ![]() |
|
#2
|
|||
|
|||
|
lol
haha
try cp -r /home/directory/ /home/new/dir good luck ![]() |
|
#3
|
|||
|
|||
|
if the destination directory contain file, this command also working?
|
|
#4
|
|||
|
|||
|
easiest way to find out is to try and see
but yes, it should. |
|
#5
|
||||
|
||||
|
Quote:
If the destination contains files, yes it will work. If it contains files named the same thing as files being moved, then it will prompt you to overwrite. If you want to overwrite them without prompting, add -f for example: cp -r -f /where/files/are/ /where/you/want/to/move/them/ -r means recursive... moves everything including subfolders. -f means force... which forces an overwrite without prompting. |
|
#6
|
|||
|
|||
|
if you're using force, make sure you don't overwrite any files that you might need, or simply make a backup of the target directory before you issue the cp command.
|
|
#7
|
||||
|
||||
|
By the way, if you want to move files rather than copy them, you should use mv instead of cp
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#8
|
||||
|
||||
|
I'm surprized that scorp's answer was the first to say 'mv' since you asked to 'move' the files.
cp for copying, makes copies mv moves them. Pick the one you want |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > How to move all file in a folder to another folder using unix command? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|