Skip to content

Please document how the search field can be used

How can the search entry be used? Is there any wildcard or regular expression capability?

The way the search entry can be used, should be documented.

By trials, I found out: In order to match, a file (or directory) name first has to match the criteria from the side bar.

In addition the search entry applies:

If search entry contains a single word, any file (or directory) whose name contains this word anywhere in it, is matched (case insensitively).

If search entry consists of several words separated by spaces, any file (or directory) name containing all these words in any order are matched (case insensitively). Effectively the search terms are connected by AND.

If one wants to match only file names ending in some extension (i.e. ending as .extension), this choice has to be done through the last item from the side bar (case insensitively). NOTE: the first character to be entered here has to be a period. e.g. .jpg. Without this period the entry is not accepted.

If one wants to search for files with any of more than one extension, e.g. .jpg OR .png, one can enter more than one extension separated by spaces through this last item from the side bar: .jpg .png.

This is quite useful. It should be documented.

Remarks:

There seems to be no regular expression or wildcard capability. Probably for these reasons:

  1. Other than with Windows, usually Linux does not rely on file names (and file extensions i.e. the part of the file name after the normally last period) and instead determines the file type by examining the first few bytes of its content and comparing that to a list of known magic numbers. But it is a good habit to stick to naming rules known from elsewhere. In fact, some file extensions are relevant in some contexts, e.g. .desktop or files named .list in /etc/apt/sources.list.d/. There may be many more examples.
  2. In Linux, file names are allowed to contain ? or *. Actually using this property is a bad idea, since there are conditions, where these characters are used as wildcards. Catfish actually can search for a file * and it would e.g. find *, *.png and so on. That's probably the reason why there are no wildcards like * (any sequence of any characters including none) or ? (exactly one character).
  3. I have read that Catfish does its search by issuing proper terminal commands like find or locate, which themselves are capable to handle regular expressions. Catfish's simple UI with AND connected case insensitive search terms and OR connected extensions would get into conflict with some real regex capability. Or is there a character which can't be part of a file name which tells Catfish to interpret the whole search pattern as regular expression (and then of which regex-type?), then the regex might be passed down to find or locate as --regex or --regexp, but the help of locate warns us that this is slow.

There seems to be no way to search for all files (i.e. like find ). If the search field is left empty, nothing is found. If there is only a single space, the results became incomplete after I searched for .jpg .png, only the .png were found.