File management: Difference between revisions

Finding or searching through files and folders
No edit summary
Finding or searching through files and folders
Line 1: Line 1:
= Finding or searching through files and folders =
== Search for a string ==
A case-sensitive search through all of the files from current folder and below.
<syntaxhighlight lang="bash">
$ find . | xargs grep -s "mystring" | more
</syntaxhighlight>
A ''case-insensitive'' search through all of the files from current folder and below.
<syntaxhighlight lang="bash">
$ find . | xargs grep -si "mystring" | more
</syntaxhighlight>
A ''case-insensitive'' search through all of the files from current folder and below, and truncate long search results.
<syntaxhighlight lang="bash">
$ find . | xargs grep -sioE ".{0,20}mystring.{0,20}" | more
</syntaxhighlight>
= Copy including hidden files =
= Copy including hidden files =