Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello,
I have a directory where a bunch of files live.. for example, the directory is named:
/opt/2004.05.21
There are quite a few files in the directory that are created daily and on an ongoing basis.
I am grepping (grep -c) for a certain word in a file. The filename ends with .0001 and is located in the /opt/2004.05.21 directory.
This file is always pretty big.. and all the other files in the directory are less than 2000 bytes.
Is there a way to only grep the file in this directory that is greater than 2000 bytes??
This grep will be embedded in a script and will give a value to a variable so if there are other commands besides grep that can accomplish this, that would help too.
Thanks!
Big Z

Forgot to mention that there may possibly be more than 1 file that has the .0001 extension. But only one that will be greater than 2000 bytes.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |