Assuming that you want to search for tags in the current buffer only, you can do C-c \
(bound to org-match-sparse-tree
) with a match expression as argument, as defined in Matching tags and properties in the manual. For example, to search for items with tag foo
, you say:
C-c \ +foo
; if you want to find items with tags foo
and bar
, you say: C-c \ +foo+bar
; if you want to find items with tag foo
but not with tag bar
, you say C-c \ +foo-bar
- and so on... All of these will give you a sparse-tree view of the hits.
You can also, of course, just use standard emacs text searches, e.g. C-s :foo:
(assuming that there is no text :foo:
in your Org mode file that is not a tag - otherwise, you'll get a false positive). After all, Org mode files are just text files.
If you want to search through multiple files, there are many ways (e.g. multi-occur
or multi-occur-matching-buffers
, dired
and relatives, etc), all of which involve some way of selecting the files/buffers of interest and then applying a (fixed or user-provided) function to each one. It's impossible to suggest a "solution" without specifying the problem much more precisely than you have.
.org
files throughout all your file systems? If not, how do you want to limit the set?