Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 59101  / 3 Years ago, mon, july 26, 2021, 12:49:25

Ok this is strange. I am using this code,



ls *.prj


To list all the files with the .prj extension in the dir but I am getting this error,




bash: /bin/ls: Argument list too long




I eventually wish to get the count of files and I was using,




ls *.prj | wc -l




But even this command is giving the same error. Any idea where I am going wrong?


More From » file-format

 Answers
4

Nothing, there is a limit on the number of argument bash can deal with. Do



ls | grep '.prj$' | wc -l

[#34265] Tuesday, July 27, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
epypian

Total Points: 130
Total Questions: 111
Total Answers: 113

Location: Romania
Member since Mon, Jun 6, 2022
2 Years ago
;