LinuxQuestions.org
Help answer threads with 0 replies.
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 07-07-2005, 03:11 AM   #1
dtra
Member
 
Registered: Nov 2004
Distribution: fc4
Posts: 104

Rep: Reputation: 15
cp lots of files argument list too long


hi all

just trying to copy files from one directory to another
eg.
Code:
cp *-tb.jpg ../tbdir/
but i get the error argument list too long
i try [a-c]*-tb.jpg, i'm not sure, but it seems to be case-sensitive
which means i have to do for both

file names in the directory are eg.
file-123456.jpg
file-123456-tb.jpg
file-123456-pt.jpg
file-123456-diff15.jpg

is there an easier way to do this
using redhat es 3
we want to move only the -tb.jpg and -diff15.jpg files

file size of the whole directory is in the order of 5GB
number of files is in the order of 100 000 for each file set of four

any tips

thanks
dave

Last edited by dtra; 07-07-2005 at 03:25 AM.
 
Old 07-07-2005, 05:21 AM   #2
windowsrefugeeX
Member
 
Registered: Apr 2004
Posts: 272

Rep: Reputation: 30
did u try
cp *tb.jpg ../tbdir/ <-- no -


see if that works
 
Old 07-07-2005, 06:54 AM   #3
Nobber
Member
 
Registered: Jun 2002
Location: Nova Scotia
Distribution: Debian (home), Kubuntu 7.04 (work)
Posts: 265

Rep: Reputation: 30
Try

Code:
find . -name "*-tb.jpg" -exec cp "{}" ../tbdir \;
 
Old 07-07-2005, 07:07 AM   #4
dtra
Member
 
Registered: Nov 2004
Distribution: fc4
Posts: 104

Original Poster
Rep: Reputation: 15
thanks guys
i'll give it a try
 
Old 07-07-2005, 10:14 AM   #5
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Or:
Code:
for i in `ls *tb.jpg`; do cp $i ../tbdir/; done
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
argument list to long for linux commands supersucker Linux - Newbie 1 05-10-2005 08:36 AM
bash: /bin/rm: Argument list too long? FiveFlat Linux - General 5 08-12-2004 12:29 AM
-bash: /bin/mv: Argument list too long balanagireddy Linux - General 2 07-28-2004 12:19 AM
Argument list too long trutnev Linux - General 3 04-22-2004 05:32 PM
/bin/rm: Argument list too long dragon49 Linux - Software 1 09-02-2003 01:27 PM


All times are GMT -5. The time now is 04:46 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration