LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   [APPENDED]Real moving of a folder's content to another folder. (https://www.linuxquestions.org/questions/linux-newbie-8/%5Bappended%5Dreal-moving-of-a-folders-content-to-another-folder-861152/)

MODYSAMA 02-07-2011 06:15 AM

[APPENDED]Real moving of a folder's content to another folder.
 
Hello!
Is there a Commend to move the content of a folder -only image files no subfolders- to another destination folder?

Actully, I had a look on the following post:
Post tilte:Using mv to move the content of one directory into another
From it, I tried that:
Code:

# rsync -a SOURCE/ DEST/
But, it copy a folder as all to the distination.
Code:

mv -i SOURCE/ DEST/
But, that moves the Folder as a folder to the distination.

What is the correct commend doing what I need?

Soadyheid 02-07-2011 06:31 AM

Depends what you mean by image. A photographic one or something like a .iso. Lets assume...

Code:

mv /home/directory/*.iso /home/new directory/*
I think :)

If all the contents of your disk disappear to /dev/null...

"It wiznae me, a big boy did it and ran away!" (Scottish excuse)

Play Bonny! :hattip:

MODYSAMA 02-07-2011 06:35 AM

I mean the folder contain just *.jpg files (pictures) not image source .iso.

linuxlover.chaitanya 02-07-2011 06:36 AM

You can do it using the absolute paths

Code:

mv /path/to/folder/*.jpg /source/to/destination

MODYSAMA 02-07-2011 06:40 AM

Thank you but, I need a cmd to recursively mv all the contain to the other folder with no overwriting the destination folder contains.

Ashkan_s 02-07-2011 07:03 AM

try this:

Code:

touch /path/to/destination/*.jpg
mv -u /path/to/source/*.jpg /path/to/destination/

It should first update access and modification times of files in destination folder. Then moves the content of the source folder to the destination if they are newer than the files in the destination folder and in this case it shouldn't happen.

MODYSAMA 02-07-2011 07:12 AM

Many thanks, thats exactly what I need.

MODYSAMA 02-07-2011 03:05 PM

Inquire
 
Hello,
I need help,
If I want the code to do that, while moving that contents zipping them and don't keep the sources.
Q: Is there a zip option do that?!



Thanks in advance.

MODYSAMA 02-07-2011 05:33 PM

Is that available?

gilead 02-07-2011 05:49 PM

Please read the man page for zip and search for the move option

linuxlover.chaitanya 02-07-2011 11:30 PM

tar can help you create the archives and compressed files. Look at man tar


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