Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello,
I'd like to find all file names that are larger than 6 digits long in a directory. What unix command I should use? awk?thanks for any help.

I prefer using the shell. This works even if your filename contains spaces:
#!/bin/ksh ls -l |while read f1 f2 f3 f4 f5 f6 f7 f8 filename do # only use files if [[ $(echo $f1|cut -c1) == "-" ]] then if [[ ${#filename} -gt 6 ]] then echo $filename fi fi done

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |