Text Processing: Recursive search and replace: Difference between revisions
From WikiMLT
m Стадий: 3 [Фаза:Разработване, Статус:Разработван]; Категория:Linux Server |
mNo edit summary |
||
Line 1: | Line 1: | ||
<noinclude><!--[[Category:Linux_Server|?]]-->{{ContentArticleHeader/Linux_Server}}</noinclude> | <noinclude><!--[[Category:Linux_Server|?]]-->{{ContentArticleHeader/Linux_Server}}</noinclude> | ||
* .. | <syntaxhighlight lang="shell" line="1">grep -rni 'string or regexp' *</syntaxhighlight>Where: | ||
* <code>*</code> - will match to all files and directories (which doesn't start with <code>.</code>, alternatively you may need to use <code>./</code> to match everything within the current directory; | |||
* . | * <code>-r</code>, <code>--recursive</code> - in this case works together with <code>*</code> (or <code>./</code>); | ||
* <code>-n</code> - output the line number where the match is found, | |||
* <code>-i</code>, <code>--ignore-case</code> - do case insensitive match. | |||
<noinclude> | <noinclude> |
Revision as of 10:21, 4 August 2022
grep -rni 'string or regexp' *
Where:
*
– will match to all files and directories (which doesn't start with.
, alternatively you may need to use./
to match everything within the current directory;-r
,–recursive
– in this case works together with*
(or./
);-n
– output the line number where the match is found,-i
,–ignore-case
– do case insensitive match.