ksh: /bin/grep: arg list too long


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ksh: /bin/grep: arg list too long
# 1  
Old 07-27-2006
Error ksh: /bin/grep: arg list too long

when i run the command below in a directory which contains too
many files i got the error: ksh: /bin/grep: arg list too long

ls|grep AA*B*

how can i handle this problem?
# 2  
Old 07-27-2006
How many files do you have in that directory? The error is that grep is unable to handle the list of files sent in as there are too many of them.
# 3  
Old 07-27-2006
i have approximately 10000 files in the directory
# 4  
Old 07-27-2006
hi blowtorch,

Iam also getting the same problem,can u tell us the limit of ls command.
till how many file will it work.
# 5  
Old 07-27-2006
I did a search on this forum and came up with the following:
https://www.unix.com/search.php?searchid=89315
# 6  
Old 07-27-2006
What do you want to do ?

To find files matching the pattern AA*B* (ie. AA123B456) in current directory :
Code:
ls | grep '^AA.*B'

To find files matching regular expression AA*B* (ie (AAAAB) in current directory :
Code:
ls | grep 'AA*B*'

In all cases you must protect the pattern or regular expression with suotes to prevent an interpretation by the shell.

Jean-Pierre.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Arg list too long

Hello All, I am trying to find a file name with .sh exention from a list of .dat files inside a directory. find /app/folder1/* -name '*.dat'| xargs grep '.sh' ksh: /usr/local/bin/find: arg list too long Please help me finding the command. Thanks (3 Replies)
Discussion started by: tkhan9
3 Replies

2. Shell Programming and Scripting

ksh script throwing arg list too long for mv cp wc - everything

i have a ksh script which internally calls another ksh script. this inner script has simple commands like shown in the code window. In the script im trying to do a mv - it fails with arg list too long. then i try to perform cp and cat - and both are failing with similar error. :wall: How is... (4 Replies)
Discussion started by: nyc68
4 Replies

3. AIX

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

Hi, I am getting the below error message When i am trying to delete the files from the directory.Could you please guide me? rm *.aud ksh: /usr/bin/rm: 0403-027 The parameter list is too long. and find /oracle/admin/testP/adump/*.aud -mtime +5 -exec rm {} \; ksh: /usr/bin/find:... (3 Replies)
Discussion started by: nokiae63
3 Replies

4. AIX

gmake[1]: execvp: /bin/sh: Arg list too long

I am having a code which will create archive after build. Ibuild code on IBM AIX 5.3. It supposed to create 2 archive after build. I am getting 1st archive successfully but when build starts for second archive after some processing it throws an following error message- ar cq... (4 Replies)
Discussion started by: milindb
4 Replies

5. Shell Programming and Scripting

arg list too long

Hi, Help. I have a file that contains a list of users in a file. I want to cat the content of the file and feed it into sed to a preformated report. The error I got is "ksh: /usr/bin/sed: arg list too long" My method below. A=`cat FILE1.txt` B=`echo $A` sed "s#USERLIST#$B#" FILE2 >... (2 Replies)
Discussion started by: Zenwork
2 Replies

6. UNIX for Dummies Questions & Answers

ksh: /usr/bin/ls: arg list too long

I am using IBM AIX unix version 4.3.3.0. In a directory there are many files with different patterns. When I am trying to execute the command, ls -l with the file pattern, which have fewer files it gives the desired result. However when I am trying to execute the same command for file pattern,... (2 Replies)
Discussion started by: jitindrabappa
2 Replies

7. UNIX for Dummies Questions & Answers

ls -t arg list too long

echo dirname/filename* | xargs ls -t As a substitute doesn't give the results desired when I exceed the buffer size. I still want the files listed in chronological order, unfortunately xargs releases the names piecemeal...does anyone have any ideas? :( (4 Replies)
Discussion started by: CSU_Ram
4 Replies

8. UNIX for Advanced & Expert Users

arg list too long

Does anyone have a solution for arg list too long error. I have got this from the web but I fail to make any sense out of it Thanks enc (8 Replies)
Discussion started by: encrypted
8 Replies

9. UNIX for Dummies Questions & Answers

zcat --> Arg list too long

Hi all I have more than 1000 files in a folder and when ever i use a "compress" or "zcat" command it give error /bin/zcat: Arg list too long. . any solution for this :o (3 Replies)
Discussion started by: muneebr
3 Replies

10. UNIX for Dummies Questions & Answers

arg list too long

I do ls -l ABC*, I get arg list too long message. This will not happen if ABC* has small no of files I believe 4000 files is limit. Any way of avoiding this. I even tried like this for i in `ls -l ABC*` do echo $i done Same problem. Any solution would be great. I am on HP-UX... (5 Replies)
Discussion started by: vingupta
5 Replies
Login or Register to Ask a Question