Desktop search: Difference between revisions

Jump to navigation Jump to search
44 bytes added ,  9 March 2021
Line 48: Line 48:
* {{Gd}} Grep command for {{linux}} <ref>[http://www.cyberciti.biz/faq/howto-search-find-file-for-text-string/ Finding a File containing a particular text string in Linux server]</ref><ref>[http://www.computerhope.com/unix/ugrep.htm Linux and Unix grep command help and examples]</ref>
* {{Gd}} Grep command for {{linux}} <ref>[http://www.cyberciti.biz/faq/howto-search-find-file-for-text-string/ Finding a File containing a particular text string in Linux server]</ref><ref>[http://www.computerhope.com/unix/ugrep.htm Linux and Unix grep command help and examples]</ref>
** multiple files: {{kbd | key=<nowiki>grep -ir "string to search" /path/to/directory</nowiki>}}<ref>options (1) -i, which means ignore case (2) -r means search recursively through an entire directory tree including the sub directory [http://www.linfo.org/grep.html How to use the grep command, by The Linux Information Project (LINFO)]</ref>
** multiple files: {{kbd | key=<nowiki>grep -ir "string to search" /path/to/directory</nowiki>}}<ref>options (1) -i, which means ignore case (2) -r means search recursively through an entire directory tree including the sub directory [http://www.linfo.org/grep.html How to use the grep command, by The Linux Information Project (LINFO)]</ref>
** multiple files: {{kbd | key=<nowiki>find *.json | xargs grep -E "詐騙|詐欺" -sl</nowiki>}} to find json files which its content contains the string {{kbd | key=<nowiki>詐騙</nowiki>}} or {{kbd | key=<nowiki>詐欺</nowiki>}}.
** multiple files: {{kbd | key=<nowiki>find *.json | xargs grep -E "詐騙|詐欺" -sl</nowiki>}} to find json files which its content contains the string {{kbd | key=<nowiki>詐騙</nowiki>}} or {{kbd | key=<nowiki>詐欺</nowiki>}}. more on [[Search for string in json files]]
** single file: {{kbd | key=<nowiki>grep "string to search" /path/to/file</nowiki>}} ex: keyin {{kbd | key=grep avc /var/log/messages}} to find the SELinux log messages<ref>[http://wiki.centos.org/HowTos/SELinux HowTos/SELinux - CentOS Wiki] / [http://wiki.centos.org/zh-tw/HowTos/SELinux zh-tw/HowTos/SELinux - CentOS Wiki](in Mandarin Chinese) </ref>
** single file: {{kbd | key=<nowiki>grep "string to search" /path/to/file</nowiki>}} ex: keyin {{kbd | key=grep avc /var/log/messages}} to find the SELinux log messages<ref>[http://wiki.centos.org/HowTos/SELinux HowTos/SELinux - CentOS Wiki] / [http://wiki.centos.org/zh-tw/HowTos/SELinux zh-tw/HowTos/SELinux - CentOS Wiki](in Mandarin Chinese) </ref>


Anonymous user

Navigation menu