Operating System - HP-UX
1833578 Members
3397 Online
110061 Solutions
New Discussion

arg list too long on ls *.cpp

 
CA972872
Occasional Contributor

arg list too long on ls *.cpp

I have more than 250 files with the extension cpp, and when I do a "ls -l *.cpp" I have the error "arg list too long".
How can I list all my files, Here is a limit for the list commands?

 

 

P.S.This thread has been moved from  System Administration> to HP-UX > languages- HP Forums Moderator

3 REPLIES 3
BR748713
Occasional Advisor

Re: arg list too long on ls *.cpp

Assuming Tru64 the following article may help:

http://h18000.www1.hp.com/support/askkcs/hpcg/253_0_10495272_2883413.html
www.the-rohwedders.de
CA984331
Regular Advisor

Re: arg list too long on ls *.cpp

Hi,

try
ls -l | grep "\.cpp"

greetings,

Michael
If you want your words to count, count your words!
BR649465
New Member

Re: arg list too long on ls *.cpp

Hi,

Basically this will work and is very fast.

find /var/opt -name '*.cpp' -print | xargs ls

It finds in /var/opt all file with extension .cpp and passes them on to ls.

Regards,
Bob
http://www.hiq.fi