LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-25-2013, 01:38 AM   #1
lalitshaktawat
LQ Newbie
 
Registered: Apr 2013
Posts: 3

Rep: Reputation: Disabled
How to find a file which having same name and created on different date on different


I am using

find ../../ -type f -name <filename>*.PDF -print0 | xargs -0 cp --target-directory=Directory name with path>;

but it is copy only one file.It doesn't copy all files which is having same name. I need number of files to be searched and copied which is having same name but it it created on different date and different folder. how to solve this issue. Pl. do needful it's urgent....To-day I have to finish searching scripts. I have already created lot's more I am facing the problem on this regards.

Thanks in advanced.

lalit
 
Old 04-25-2013, 04:25 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Why are you piping the result into xargs? Make use of the -exec option in find
 
Old 04-25-2013, 06:09 AM   #3
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 594

Rep: Reputation: 141Reputation: 141
if you copy files with the same name to one directory they get over written. and you end up with one file.
 
  


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
shell script to find certain file created or not kshari8888 Linux - Newbie 2 12-13-2012 11:05 AM
[SOLVED] find only new created files from certain date => display folder and path only dragonetti Linux - Newbie 5 10-27-2011 10:38 AM
shell script to find modified date and last accessed date of any file. parasdua Linux - Newbie 6 04-22-2008 09:59 AM
find out the files created on a particular date. ZAMO Linux - General 3 02-08-2008 01:38 AM
Find if file system is already created on the RAW device g_johnsonsamuel Programming 2 07-16-2007 01:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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