Problem using find with prune on large number of files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problem using find with prune on large number of files
# 1  
Old 10-15-2008
Problem using find with prune on large number of files

Hi all;

I'm having a problem when want to list a large number of files in current directory using find together with the prune option.

First i used this command but it list all the files including those in sub directories:

Code:
find . -name "*.dat" | xargs ls -ltr

Then i modified the command as below but it only works with small number of files:

Code:
find *.dat -prune | xargs ls -ltr

It throws error when i executed it in the directory that have a large number of files.

ksh: /usr/bin/find: 0403-027 The parameter list is too long.

Can someone help me to modify this code?Thank you in advance.
# 2  
Old 10-15-2008
can you post the output of following commands..
Code:
getconf LINE_MAX

getconf ARG_MAX

and to long list files use

Code:
find . -name "*.date" -ls -long

# 3  
Old 10-15-2008
vidyadhar85;

i try
Code:
find . -name "*.date" -ls -long

but it still list the files in subdirectory and it's not in the datetime order, and i'm not very sure to use

Code:
getconf LINE_MAX

getconf ARG_MAX


Any suggestions?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash find : another problem with prune

Hello. I am searching file between dates and try to apply the comments from Chubler_XL in my thread : Linux find command : how to use multiple conditions But i get a null result as i am expecting to find 32 files. Setting my computer date to the date of the thread ( 30/05/2019 ) and... (4 Replies)
Discussion started by: jcdole
4 Replies

2. Shell Programming and Scripting

Removing large number of temp files

Hi All, I am having a situation now to delete a huge number of temp files created during run times approx. 16700+ files. We have never imagined that we will get this this much big list of files during run time. It worked fine for lesser no of files in the list. But when list is huge we are... (7 Replies)
Discussion started by: mad man
7 Replies

3. Shell Programming and Scripting

Sftp large number of files

Want to sftp large number of files ... approx 150 files will come to server every minute. (AIX box) Also need make sure file has been sftped successfully... Please let me know : 1. What is the best / faster way to transfer files? 2. should I use batch option -b so that connectivity will be... (3 Replies)
Discussion started by: vegasluxor
3 Replies

4. UNIX for Dummies Questions & Answers

Rename a large number of files in subdirectories

Hi, I have a large number of subdirectories (>200), and in each of these directories there is a file with a name like "opp1234.dat". I'd like to know how I could change the names of these files to say "out.dat" in all these subdirectories in one go. Thanks! (5 Replies)
Discussion started by: lost.identity
5 Replies

5. Shell Programming and Scripting

Using find in a directory containing large number of files

Hi All, I have searched this forum for related posts but could not find one that fits mine. I have a shell script which removes all the XML tags including the text inside the tags from some 4 million XML files. The shell script looks like this (MODIFIED): find . "*.xml" -print | while read... (6 Replies)
Discussion started by: shoaibjameel123
6 Replies

6. UNIX for Dummies Questions & Answers

Delete large number of files

Hi. I need to delete a large number of files listed in a txt file. There are over 90000 files in the list. Some of the directory names and some of the file names do have spaces in them. In the file, each line is a full path to a file: /path/to/the files/file1 /path/to/some other/files/file 2... (4 Replies)
Discussion started by: inakajin
4 Replies

7. Shell Programming and Scripting

Find line number of bad data in large file

Hi Forum. I was trying to search the following scenario on the forum but was not able to. Let's say that I have a very large file that has some bad data in it (for ex: 0.0015 in the 12th column) and I would like to find the line number and remove that particular line. What's the easiest... (3 Replies)
Discussion started by: pchang
3 Replies

8. Shell Programming and Scripting

Concatenation of a large number of files

Hellow i have a large number of files that i want to concatenate to one. these files start with the word 'VOICE_' for example VOICE_0000000000 VOICE_1223o23u0 VOICE_934934927349 I use the following code: cat /ODS/prepaid/CDR_FLOW/MEDIATION/VOICE_* >> /ODS/prepaid/CDR_FLOW/WORK/VOICE ... (10 Replies)
Discussion started by: chriss_58
10 Replies

9. UNIX for Dummies Questions & Answers

questing regarding tar large number of files

I want to tar large number of files about 150k. i am using the find command as below to create a file with all file names. & then trying to use the tar -I command as below. # find . -type f -name "gpi*" > include-file # tar -I include-file -cvf newfile.tar This i got from one of the posts... (2 Replies)
Discussion started by: crux123
2 Replies

10. Shell Programming and Scripting

moving large number of files

I have a task to move more than 35000 files every two hours, from the same directory to another directory based on a file that has the list of filenames I tried the following logics (1) find . -name \*.dat > list for i in `cat list` do mv $i test/ done (2) cat list|xargs -i mv "{}"... (7 Replies)
Discussion started by: bryan
7 Replies
Login or Register to Ask a Question