Tip of the Day: find string in a file via commandline

Sometimes we want to know if certain words or strings are in a file.

Fear not, here’s a simple way to do it:

root@localhost ~]# fgrep <keyword> <filename>

Let’s say I’m searching for the string ‘copy’ inside a shell script called check:

root@localhost ~]# fgrep copy check

I’ll get the entire line:

“Copy not finished”;

Tags:

One Response to Tip of the Day: find string in a file via commandline

  1. ?????? says:

    ???, ? ?????????? ???????? ?? ???????? ))

Leave a Reply

Name and Email Address are required fields. Your email will not be published or shared with third parties.