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. ??????

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

Leave a Reply