Desktop search: Difference between revisions

Jump to navigation Jump to search
740 bytes added ,  21 May 2014
Line 28: Line 28:
** 搜尋: 儲存在Zotero資料庫的文獻書目、標籤、附檔檔名、附檔(PDF或HTML網頁檔)內文<ref>[http://www.zotero.org/support/pdf_fulltext_indexing pdf_fulltext_indexing (Zotero Documentation)]([http://www.zotero.org/support/screencast_tutorials/advanced_search screencast_tutorials:advanced_search  ])</ref>
** 搜尋: 儲存在Zotero資料庫的文獻書目、標籤、附檔檔名、附檔(PDF或HTML網頁檔)內文<ref>[http://www.zotero.org/support/pdf_fulltext_indexing pdf_fulltext_indexing (Zotero Documentation)]([http://www.zotero.org/support/screencast_tutorials/advanced_search screencast_tutorials:advanced_search  ])</ref>
=== Search text in files ===
=== Search text in files ===
==== by solution ====
* {{Gd}} [http://www.wingrep.com/ Windows Grep: Grep for Windows] v.2.3 {{Win}}
* {{Gd}} [http://www.wingrep.com/ Windows Grep: Grep for Windows] v.2.3 {{Win}}
** file size: (1) > 90 MB: ok; (2) > 200MB: ok  
** file size: (1) > 90 MB: ok; (2) > 200MB: ok  
Line 53: Line 54:
** 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>
** 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 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 Chinese) </ref>
==== by logical operators ====
'''OR''': match the lines which contains ''pattern1'' OR ''pattern2''<ref>[http://www.linuxquestions.org/questions/linux-newbie-8/logical-operators-in-grep-775595/ logical operators in grep]</ref>
* {{kbd | key = <nowiki>awk '/pattern1|pattern2/' file_name </nowiki>}} for {{Linux}}
* {{kbd | key = <nowiki>grep 'pattern1\|pattern2' file_name </nowiki>}}
* {{kbd | key = <nowiki>grep -E 'pattern1|pattern2' file_name </nowiki>}}
'''AND''': match the lines which contains ''pattern1'' AND ''pattern2''
* {{kbd | key = <nowiki>awk '/pattern1/&&/pattern2/' file_name </nowiki>}} for {{Linux}}
* {{kbd | key = <nowiki>grep -E 'pattern1.*pattern2|pattern2.*pattern1' file_name </nowiki>}}


== file name or folder name search ==
== file name or folder name search ==

Navigation menu