LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 02-07-2011, 06:15 AM   #1
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Rep: Reputation: 0
Question [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?

Last edited by MODYSAMA; 02-07-2011 at 03:08 PM. Reason: I appened to the origional question.
 
Old 02-07-2011, 06:31 AM   #2
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,672

Rep: Reputation: 486Reputation: 486Reputation: 486Reputation: 486Reputation: 486
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!
 
Old 02-07-2011, 06:35 AM   #3
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
I mean the folder contain just *.jpg files (pictures) not image source .iso.
 
Old 02-07-2011, 06:36 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
You can do it using the absolute paths

Code:
mv /path/to/folder/*.jpg /source/to/destination
 
1 members found this post helpful.
Old 02-07-2011, 06:40 AM   #5
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
Thank you but, I need a cmd to recursively mv all the contain to the other folder with no overwriting the destination folder contains.
 
Old 02-07-2011, 07:03 AM   #6
Ashkan_s
Member
 
Registered: Jul 2008
Distribution: Fedora
Posts: 77

Rep: Reputation: 22
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.
 
1 members found this post helpful.
Old 02-07-2011, 07:12 AM   #7
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
Many thanks, thats exactly what I need.
 
Old 02-07-2011, 03:05 PM   #8
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
Exclamation 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.

Last edited by MODYSAMA; 02-07-2011 at 05:31 PM.
 
Old 02-07-2011, 05:33 PM   #9
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
Is that available?
 
Old 02-07-2011, 05:49 PM   #10
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Please read the man page for zip and search for the move option
 
1 members found this post helpful.
Old 02-07-2011, 11:30 PM   #11
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
tar can help you create the archives and compressed files. Look at man tar
 
1 members found this post helpful.
  


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
Copying folder content and not folder NevadaSam Linux - Newbie 4 11-26-2008 07:58 AM
How can I rename a folder's content to the name of the folder itself? xmrkite Linux - Software 7 07-25-2008 12:28 PM
A script within a folder to delete the folder, script, and the folder's contents Cyberman Programming 15 10-17-2007 07:32 AM
reading contents of a folder and moving that content vb.net mrobertson Programming 0 02-17-2006 08:14 AM
Playing Real Network Content with Mplayer brokenflea Fedora 1 03-17-2004 11:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:10 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
Open Source Consulting | Domain Registration