14,982
edits
Tags: Mobile edit Mobile web edit |
|||
| Line 6: | Line 6: | ||
電腦的多個檔案的內文搜尋 | 電腦的多個檔案的內文搜尋 | ||
=== Open-source software of full text search === | |||
{{Gd}} [https://github.com/BurntSushi/ripgrep BurntSushi/ripgrep: ripgrep recursively searches directories for a regex pattern while respecting your gitignore] for {{Win}}, {{Mac}} or {{Linux}} | |||
* | * File format: plain text files & compressed files | ||
* Big file search: | |||
* [[Regular expression]]: supported ([https://docs.rs/regex/1.5.4/regex/#syntax syntax]) | |||
* License: Dual-licensed under MIT or the UNLICENSE | |||
{{Gd}} [http://www.wingrep.com/ Windows Grep: Grep for Windows] v.2.3 {{Win}} | |||
* File format: plain text files | |||
* big file search: ok e.g. file size (1) > 90 MB: ok; (2) > 200MB: ok {{Gd}} | |||
* [[Regular expression]]: supported | |||
* refine the search: | |||
* [http://www. | {{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> | ||
* | * File format: plain text files | ||
* 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>}}. 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> | |||
* [ | [https://copernic.com/ Copernic: Software to search, find, and manage information] v.3.5.1 on {{Win}} | ||
* File format: | |||
* Range: folders and file types you specified | |||
* Refine the search: file name, file type, file size, date, folder. '''Quotation marks''' is available. More on [http://help.copernic.com/topic/desktopsearch21en/use/search/boolean.htm Refine a search with operators] | |||
* Comment: Nice for searching PHP scripts {{Gd}} | |||
[http://sourceforge.net/projects/docfetcher/ DocFetcher] on {{Win}}, {{Mac}} & {{Linux}} ([http://jdev.tw/blog/819/docfetcher-cross-platform-desktio-search 經常找不到文件嗎?試試免費的跨平台桌面搜尋工具:DocFetcher | 簡睿隨筆@新世界]) | |||
* File format: plain text files & compressed files | |||
* Range: folders and files type you specified | |||
* 搜尋: 支援輸入部分字串 | |||
* License: Eclipse Public License {{Gd}} | |||
* Comment: not suitable for search PHP scripts | |||
[http://www.zotero.org/ Zotero] v.3 for {{Fx}} | |||
* File format: Metadata or attached PDF or HTML files | |||
* 搜尋: 儲存在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> | |||
[http://tools.tortoisesvn.net/grepWin.html grepWin] v1.5.6.x | |||
* File format: plain text files | |||
* big file search: file size (1) > 90 MB: ok; (2) > 200MB: ok; | |||
* Regular expression: supported | |||
* refine the search: | |||
* comment: If there are too many matches, the software will be frozen and get back after some minutes. {{exclaim}} | |||
[http://notepad-plus-plus.org/ Notepad++] v7.4.2<ref>[http://npp-community.tuxfamily.org/documentation/notepad-user-manual/searching/searching-files Searching in Files]</ref> | |||
* File format: plain text files | |||
* big file search: file size < 600 MB: ok<ref>[https://errerrors.blogspot.com/2017/11/notepad-file-is-too-big-to-be-opened.html 解決 Notepad++ 開啟大檔案遇到「file is too big to be opened」錯誤訊息]</ref> | |||
* Regular expression: supported | |||
* refine the search: file name, file type (separated by ; symbol, ex: {{kbd | key= *.html; *.htm}} to search the text in the html and htm file types) , folder | |||
[http://gnuwin32.sourceforge.net/packages/grep.htm Grep for Windows] {{Win}} <abbr title="命令列介面, command-line interface">CLI</abbr> | |||
* File format: plain text files | |||
* big file search: | |||
** big file search: | * Regular expression: | ||
* | * refine the search: | ||
[http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/findstr.mspx?mfr=true Findstr] command {{Win}} | |||
** big file search: | * File format: plain text files | ||
* big file search: | |||
* Regular expression: | |||
* refine the search: | |||
* instruction:<ref> [http://ithelp.ithome.com.tw/questions/10183490 如何編寫批次檔讓我可以抓取TXT檔中的某個字串 - iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天]</ref> | |||
=== Commercial software of full text search === | |||
''$'' [http://www.sublimetext.com/ Sublime Text] v.2 | |||
* | * File format: plain text files | ||
* big file search: | |||
* Regular expression: supported<ref>[http://docs.sublimetext.info/en/latest/search_and_replace/search_and_replace_overview.html Search and Replace — Sublime Text Unofficial Documentation]</ref><ref>[http://www.boost.org/doc/libs/1_47_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html Perl Regular Expression Syntax - 1.47.0]</ref> | |||
* refine the search: file name, file type (separated by , symbol, ex: {{kbd | key= *.html, *.htm}} to search the text in the html and htm file types) , folder。 Menu -> Find -> Find in files -> Where: Add include filters<ref>[http://www.sublimetext.com/forum/viewtopic.php?f=3&t=5803 Sublime Forum • View topic - Find in Files of Filetype]</ref> | |||
''$'' [https://www.x1.com/products/x1-search/ X1 Search 8 - Find Emails, Files, and SharePoint Data on Standard or Virtual Desktops](formerly [http://desktop.yahoo.com/ Yahoo! Desktop Search]) | |||
* File format: | |||
* | * Range: | ||
* | |||
* [ | ''$'' Cloud services | ||
* | * [https://support.google.com/drive/answer/2375114?hl=en Search for your files - Drive Help] "You can search the first 100 pages of any text documents or text-based PDFs that you've uploaded. You can also search for text found on the first 10 pages of any image PDFs." | ||
* | * [http://techawakening.org/search-within-attachments-in-gmail/1236/ How-To Do a Full Text Search within your Gmail Attachments?] | ||
* ''$'' [https://www.dropbox.com/help/6635 How can I use full-text search to search the contents of my files? (Dropbox Help Center)] | |||
''$'' [https://zh-tw.emeditor.com/ EmEditor] | |||
** big file search: | * File format: plain text files | ||
* | * big file search: ok {{Gd}} | ||
* [[Regular expression]]: supported | |||
* refine the search: | |||
[https://support.apple.com/zh-tw/guide/mac-help/mchlp1008/mac 在 Mac 上使用 Spotlight 搜尋 - Apple 支援 (台灣)] on {{Mac}} | |||
* | * File format: plain text files | ||
template (left blank intentionally) | template (left blank intentionally) | ||
<pre> | <pre> | ||
Software name | |||
** big file search: | * File format | ||
* big file search: | |||
* Regular expression: | |||
* refine the search: | |||
</pre> | </pre> | ||
=== 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><ref>[http://www.thegeekstuff.com/2011/10/grep-or-and-not-operators/ 7 Linux Grep OR, Grep AND, Grep NOT Operator Examples]</ref> | '''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><ref>[http://www.thegeekstuff.com/2011/10/grep-or-and-not-operators/ 7 Linux Grep OR, Grep AND, Grep NOT Operator Examples]</ref> | ||
* {{kbd | key = <nowiki>awk '/pattern1|pattern2/' file_name </nowiki>}} for {{Linux}} | * {{kbd | key = <nowiki>awk '/pattern1|pattern2/' file_name </nowiki>}} for {{Linux}} | ||
| Line 93: | Line 117: | ||
* {{kbd | key = <nowiki>cat file_name | grep -E 'pattern1.*pattern2|pattern2.*pattern1' </nowiki>}} {{exclaim}} order dependent | * {{kbd | key = <nowiki>cat file_name | grep -E 'pattern1.*pattern2|pattern2.*pattern1' </nowiki>}} {{exclaim}} order dependent | ||
== Search text in single plain text file == | |||
Search text in a file | Search text in a file | ||
* [https://www.computerhope.com/unix/ugrep.htm Linux grep command]: | * [https://www.computerhope.com/unix/ugrep.htm Linux grep command]: | ||