If you're looking for lines matching in files, my favorite command is:
grep -Hrni 'vijay' /home/v/abc.txt
grep -rl 'vijay' /home/vfolder
-Hcauses the filename to be printed (implied when multiple files are searched)-rdoes a recursive search-ncauses the line number to be printed
-Iignore binary files (complement:-atreat all files as text)-Ftreatsearch termas a literal, not a regular expression-ido a case-insensitive search--color=alwaysto force colors even when piping throughless. To makelesssupport colors, you need to use the-roption:grep -Hrn search . | less -r--exclude-dir=diruseful for excluding directories like.svnand.git.
No comments:
Post a Comment