Home > OS >  Search through the file in Unix
Search through the file in Unix

Time:06-16

I am a unix/linux newbie here .. total newbie.

I want to search through the large (log) file in Unix environment. So, I try grep command

grep textToSearch fileToSearch

However, it just scrolls fast and I can't see all the occurrences. I saw its done .. probaly with piping that 'grep' command with some other. But I don't know what it was. Basically, I want to be able to run a command, see the output and scroll through that output on my own as I go through the found results.

Please, help ..

CodePudding user response:

I'll say just cat/bat/less fileToSearch then just use /textToSearch. with grep you could also pipe to output to cat/bat/less like grep textToSearch fileToSearch | bat

CodePudding user response:

You can try grep with -r Recurcivly, -n line number

grep -rn text test.file

  • Related