Search: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
(Added a section for examples.)
(→‎General tab: Adjustments due to changes in TC 11.50)
 
Line 64: Line 64:
* If the search text contains a backslash (unless in search locations) or pipe character, (b) won't apply or give any results.
* If the search text contains a backslash (unless in search locations) or pipe character, (b) won't apply or give any results.
* Spaces act as separators, unless contained within quotes.
* Spaces act as separators, unless contained within quotes.
* Wildcard ? stands for exactly one character, wildcard * for any number of characters.
* Wildcard ? stands for exactly one character, wildcard * for any number of characters. The special wildcard \**\ can be used in paths and stands for any number of subfolders.  
* Exclude masks can be specified after a pipe character.<br /><!--
* Exclude masks can be specified after a pipe character.<br /><!--
-->For example, to exclude txt files from the search results use: <code><nowiki>|</nowiki> *.txt</code>
-->For example, to exclude txt files from the search results use: <code><nowiki>|</nowiki> *.txt</code><br /><!--
* A search pattern to match against file/folder names can include a pattern to match against parent folders that were traversed into during the search. A backslash at the beginning matches the folder at the start of the search. Wildcards are also allowed and the pattern \**\ may be used to match against any number of nested subfolders.
-->Since TC 11.50 you can use <code><nowiki>|</nowiki> \</code> to exclude results from the folder at the start of the search (only subfolders are searched).
* Traverse filters are expressions in the search text ending with a backslash. They limit the folders that are traversed into and are are often used in the exclude section after a pipe character. Each traversed folder during the search is checked against these filters. A filter starting with a backslash applies to the search location only, not subfolders. Wildcards are also allowed, as well as nested folders (although the latter is only meaningful when used in an exclude section<sup> [https://www.ghisler.ch/board/viewtopic.php?p=420344#p420344])</sup>.
* A search pattern to match against file/folder names can include a pattern to match against parent folders that were traversed into during the search. A backslash at the beginning matches the folder at the start of the search. Wildcards are also allowed.
* Traverse filters are expressions in the search text ending with a backslash. They limit the folders that are traversed into and are are often used in the exclude section after a pipe character. Each traversed folder during the search is checked against these filters. A filter starting with a backslash applies to the search location only, not subfolders. Wildcards are also allowed, as well as nested folders (prior to TC 11.50 the latter was only meaningful when used in an exclude section<sup> [https://www.ghisler.ch/board/viewtopic.php?p=420344#p420344])</sup>.


''Examples''
''Examples''

Latest revision as of 15:23, 8 December 2024

Search in Total Commander allows users to search for files and folders within their system. The search feature has lots of options, which are divided over the tabs: General, Advanced, Plugins, Load/Save. The user can utilize options from multiple tabs and then start the search. After starting a search, the results will populate a search result panel at the bottom.

The search feature has several options to utilize the tool Everything (indexing and search tool), for very fast results.

Opening the search function

The search function in Total Commander can be opened through the following methods:

General tab

This tab provides options to configure the search for filenames, parts of filenames, text inside files, and text inside content plugin properties. The various options and input fields are explained below.

Options for searching for file/folder names
Search for

The "Search for" field contains the search text. The search text not only determines what is searched, but also the search mode as explained in the table below.

Search mode conditions Description of search mode
  • Search text does NOT contain a dot, wildcard or backslash.
  • Search text does NOT start with "ev:" or "ed:"
Search for files where any part of the filename matches the entire search text.

Notes

  • Spaces and the pipe symbol are interpreted literally. So carefully consider leading/trailing spaces and the number of spaces you type.
  • A double quote character at the beginning and an optional matching quote character are ignored.
  • Optionally, search locations can be specified at the beginning of the search text (see next search mode for details). This does not change the search mode.

Examples

Search text Result
Smith
"Smith"
"Smi"th
Finds for example "Letter to Mr. Smith.doc"
Letter to Finds "Letter to Mr. Smith.doc", but not "Letter.doc"
Smith | txt Finds nothing.
d:\test\Smith Finds filenames containing "smith" in d:\test and its subfolders.
  • Search text DOES contain a dot, wildcard or backslash.
  • Search text does NOT start with "ev:" or "ed:"
Search files where:
(a) The whole filename matches one of the expressions in the "Search for" field, or
(b) The entire filename matches the complete "Search for" field with no character acting as a separator.

Notes

  • At the beginning of the search text, you can define a comma-separated list of search locations. The list must begin with a drive letter and it ends with the final backslash in the search string.
  • If the search text contains a backslash (unless in search locations) or pipe character, (b) won't apply or give any results.
  • Spaces act as separators, unless contained within quotes.
  • Wildcard ? stands for exactly one character, wildcard * for any number of characters. The special wildcard \**\ can be used in paths and stands for any number of subfolders.
  • Exclude masks can be specified after a pipe character.
    For example, to exclude txt files from the search results use: | *.txt
    Since TC 11.50 you can use | \ to exclude results from the folder at the start of the search (only subfolders are searched).
  • A search pattern to match against file/folder names can include a pattern to match against parent folders that were traversed into during the search. A backslash at the beginning matches the folder at the start of the search. Wildcards are also allowed.
  • Traverse filters are expressions in the search text ending with a backslash. They limit the folders that are traversed into and are are often used in the exclude section after a pipe character. Each traversed folder during the search is checked against these filters. A filter starting with a backslash applies to the search location only, not subfolders. Wildcards are also allowed, as well as nested folders (prior to TC 11.50 the latter was only meaningful when used in an exclude section [1]).

Examples

Search text Description
windows\ *.dll Search DLL files, traverse only in folders called "windows"
*.htm? | _vti*\ Search HTML files, but not in subfolders starting with "_vti"
dir1\**\dir2\*.dll Search DLL files in folders named "dir2" located somewhere within folders named "dir1"
\dir1\**\dir2\*.dll Search DLL files in folders named "dir2" located somewhere within the folder "dir1" located in the folder at the start of the search.
  • Search text starts with "ev:"
Search using the Everything tool. The text after "ev:" must use Everything search syntax.
  • Search text starts with "ed:"
Similar to "ev:", but the "Search in" field and the "Search in subdirectories" option are converted to Everything search syntax and added at the beginning of the search text.
  • Search text is ">"
Gives no result when searching. Enter this value before saving the search to let the "Search for" field retain its value when loading the saved search.
Search in The "Search in" field allows you to do one of the following:
  • Enter fully specified folders separated by semicolons (;) to search in one or more folders.
  • Enter the filename of an archive to search in an archive.
  • Enter the symbol "@" followed by a filename (e.g., @c:\path\searchlist.txt) to search using a search list.
  • Enter ">" before saving the search to let the "Search in" field retain its value when loading the saved search.

Searching using a search list

  • The file containing the search list must be a text file with encoding ANSI, UTF-8, or UTF-16 (the latter two with BOM).
  • The search list has its own syntax that differs from the syntax of the "Search for" field.
  • Every line represents a search operation that is executed in sequence. Each line contains either:
    • A file or folder name (either an absolute path, or relative to the location of the list file).
    • A folder name (optional, ending in \), followed by one or more wildcard expressions.
    • A folder name (optional, ending in \), directly followed a "<" character and a regular expression.
  • You cannot use wildcards or regular expressions within a path.
  • When a line contains only a filename (as opposed to a folder name) and no wildcards or regular expression, the search is limited to the specific file without including subfolders.
  • When wildcards or a regular expression are used, the search extends to subfolders.

When "Search subdirectories" is set to 1 level or more

  • Specified folders will be searched within, while the folders themselves will not appear in the search results.
  • The "Search for" field will be ignored for search operations with wildcards or a regular expression.

When "Search subdirectories" is set to "current dir only"

  • This scenario works similarly to loading a file/folder list from a file. Only the files and folders listed in the file will be included in the search results and nothing else.
  • Lines containing wildcards or a regular expression will be ignored.
  • The "Search for" field will be ignored.

Search list example

Search operation Description
c:\folder\file.txt Search just for "file.txt" in "c:\folder" (search depth has no effect)
c:\folder\*"file.txt" Search for "file.txt" in "c:\folder" and subfolders (search depth >=1)
c:\folder\

Search inside "c:\folder" using search term in "Search for" field (search depth >=1)

Only search for "c:\folder" itself, ignore "Search for" field (search current dir only)

c:\folder\*.txt *.doc Search inside "c:\folder" for txt and doc files (search depth >=1)
c:\folder\<\.jpg$ Search inside "c:\folder" for jpg files using regular expression (search depth >=1)
Drives Select the drive(s) you want to search. You can select multiple drives.
RegEx Search in file names using regular expressions.
Only search in selected directories/files Restrict the search to folders and files that have been selected in Total Commander's active file panel.
'Everything' Use the program 'Everything' to search NTFS-formatted drives.
Search archives Also search within archives.
  • Note: A search for file content will only search the files within archives, not the archive files themselves.
Search in subdirectories Choose where to search: all subfolders, current folder only, or up to a set depth from the current folder.
Options for searching file content
Find text If checked, you can enter text to be searched.

Notes

  • \\ will be interpreted as a single backslash (\).
  • \t will be interpreted as a tabstop character.
  • \n will be interpreted as a Windows newline character (CR LF).
Whole words only Limit the search to whole words only.
Case sensitive Enable case sensitive searching.
RegEx (2) Search in file contents using regular expressions.
Hex Search for hexadecimal characters.
Find files NOT containing the text Search for all files that do not contain the search text.
ANSI-Charset (Windows) Assume files are encoded using the Windows charset with the default language encoding.
ASCII-Charset (DOS) Assume ASCII files. Special characters in the search text, like the pound sign (£), are translated to their DOS equivalents.
Unicode UTF-16 Assume Unicode files where each letter is coded by 2 bytes.
UTF8 Assume UTF-8-encoded Unicode files where each letter is coded by 1 up to 4 bytes.
Office xml (docx, xlsx, odt etc) + EPUB Search in Microsoft Office, OpenOffice/LibreOffice, and EPUB files.
Plugins Search in content plugin properties for the text given in "Find text".

Advanced tab

Plugins tab

Load/save tab

Search results

Search results are displayed in the search result panel. Users can perform various actions on these results:

  • View or edit found files, even while the search is ongoing.
  • Copy results to the clipboard with Ctrl+C after the search has finished.
  • Perform actions like Go to file and Feed to listbox on the search results.
  • Search within the search results.

Examples

Search text examples
Search text Description
text Search for files/folders with "text" anywhere in the name.
text moretext
"text moretext"
"text more"text
Search for files/folders with "text moretext" anywhere in the name.
c:\;d:\text moretext Search drive c: and d: for files/folders with "text moretext" anywhere in the name.
c:\;d:\text moretext. Search drive c: and d: for files/folders with name "text" or "moretext" or "text moretext".
c:\;d:\"text moretest." Search drive c: and d: for files/folders with name "text moretext".
\
\ *
\ *.*
| *\
| \*\
* | \*\
*.* | \*\
Search all files/folders in search folder only (do not traverse subfolders).
\* Search all files/folders in search folder only (slow, traverse all subfolders but only show results of search folder).
|\* Search all files/folders in subfolders only (exclude results of search folder).

See also