With gnome-search-tool
and catfish
, command-line options are available and so the programs can integrate into Thunar quite nicely; the --path=%f
option is important as that means the location of the selected folder (with its files) can be passed on to these search tools so they open at the right folder.
If you enter the name of the program and then add--help
, you will see all the command-line options for these two search tools: for gnome-search-tool --help
we have many options such as:
--named=STRING Set the text of "Name contains" search option
--path=PATH Set the text of "Look in folder" search option
With catfish
there are similar options, but it used to be essential to specify --fileman=thunar
in addition to --path=%f
. This was found to be necessary as catfish used to only open the home folder, not the one selected if the fileman workaround was not used. However, it works now with just --path=%f
with Catfish 0.3.2 and Thunar 1.2.3 on Xubuntu 12.04.
It doesn't seem to be possible to pass any command-line options to searchmonkey
, and there doesn't seem to be any information available: the mailing-lists and forums seem pretty empty. Even if you set the filemanager and options in searchmonkey > settings > preferences > systemcalls, and then specify options in the custom action, it doesn't seem to integrate into Thunar
successfully.
Searchmonkey
doesn't seem to integrate with other filemanagers either after testing, so it must be because it does not accept any suitable command-line options. The only way to make it integrate would be to create a patch for it and recompile it, which is probably not really worthwhile considering how useful catfish
is.
-exec ... \;
will run one item after another. So if you have three files, the exec line will run three times.
-exec ... {} +
is for commands that can take more than one file at a time (eg cat
, stat
, ls
). The files found by find
are chained together like an xargs
command. This means less forking out and for small operations, can mean a substantial speedup.
Here's a performance demo catting 10,000 empty files.
$ mkdir testdir
$ touch testdir/{0000..9999}
$ time find testdir/ -type f -exec cat {} \;
real 0m8.622s
user 0m0.452s
sys 0m8.288s
$ time find testdir/ -type f -exec cat {} +
real 0m0.052s
user 0m0.015s
sys 0m0.037s
Again this only works on commands that can take multiple filenames. You can work out if your command is like that by looking at its manpage. Here's the synopsis from man cat
:
SYNOPSIS
cat [OPTION]... [FILE]...
The ellipsis on [FILE]...
means it can take more than one file.
+
can only be used on single commands and you must have exactly one {}
in the line. \;
can operate with multiple zero-to-many groups.
Best Answer
locate
is fast but bases its results on a local database that needs to be updated for it to find a recent result. Commandupdatedb
is usually run daily bycron
to update the default database.find
is real time so does not depend on a local database. Being real time it is also slower thanlocate
.Catfish uses the actual Linux commands so you can find more information on both commands with
man locate
,man locatedb
andman find
if the 2 links do not give enough information.