Mac Finder Searching For Text

Tags are a great way to organize data, so that you can sift through it fast when you need to zero in on a particular element. Color-coded tags are even better, and your Mac’s file manager Finder8 Finder Tips for Mac Newbies8 Finder Tips for Mac NewbiesNavigating files and folders using the native Mac file browser Finder is easy enough, but there are many more features hidden behind menus and keyboard shortcuts.Read More has them — those colorful little dots in the sidebar.

We've all gotten so accustomed to using Spotlight for our Mac-searching needs. Hey, it's convenient! But you may not know that the Finder has a more advanced way to search, and with this method. With the Finder active, display the Find controls by pressing Command+F (or choose File from the Finder menu and then choose Find). Mac OS X displays the controls that you see here. Click the buttons at the top of the list to specify where you want to search.

The Mac keyboard shortcut command F will perform the Find action. Find is a global Mac keyboard shortcut that is usually located in the Edit menu. This keyboard shortcut for Find is available in Mac OS X and may also be available with other versions of Mac OS.

Each default tag gets its label from its color. You don’t have to stick with that label though, as we’ll see later on in this article. Let’s take a look at how to make the most of macOS tags.

What Can You Do With Tags?

While naming files well and moving them into logical folders keeps your data organized, tagging files takes it one step further. Tags do the same thing for your files that Gmail labelsRediscover Gmail Labels and Finally Tame Your InboxRediscover Gmail Labels and Finally Tame Your InboxThere are plenty of tricks to deal with email overload, but there's one right under your nose that you might not be using: good old Gmail labels.Read More do for you emails: add context.

With tags, you can make a variety of data easy to find at a moment’s notice. For example:

  • Photos you want to edit later.
  • Data that’s usable for a short time, such as flight tickets, research for blog posts, and first drafts of anything.
  • Saved articles that you plan to read over the weekend.
  • Receipts you want to saveThe Best Receipt Apps for Scanning, Tracking, and Managing BillsThe Best Receipt Apps for Scanning, Tracking, and Managing BillsThese receipt scanner apps will help you scan, save, and organize every bill for your personal or business needs.Read More for tax season.

What’s cool about tags on macOS is that you can combine different types of files under one umbrella. Also, you can use multiple tags both to categorize files and to narrow down your searches later.

How to Create, Edit, and Delete Tags in Finder

Finder allows you to create a tag in a handful of ways.

Tagging From the Context Menu

Right-click on a file and select Tags… in the context menu. A box with a text field pops up right there for you to enter the name of the tag you want to create. Type in that name and hit Entertwice. This creates the tag and assigns it to the file you have selected.

Assign more than one tag: To assign multiple tags to a single file, you’ll have to hit Enter after every tag name you type in and then once at the end to complete the process. If you hit Esc or click elsewhere on the screen instead of hitting Enter at the end, no new tags for you.

Mac finder search for text

If you want assign one or more existing tags to a file, pick them from the list that appears right below the tag field. Just point and click! This list of tags mirrors the one that appears in the sidebar.

“Un”-assign a tag: Let’s say in the middle of tagging you decide you don’t want to use a particular tag for the selected file after all. If you select that tag in the text field and hit the Delete key, macOS will no longer use that tag for that file. This doesn’t delete delete the tag — you’ll have to bring up the tag’s context menu in the sidebar or visit Preferences > Tags for that.

Bookmark a tag: Are you curious about the tags that you can select from the context menu directly? Those are “favorite” tags for quick use in Finder menus. You get to choose which tags show up as favorites. To find out how, jump to the Manage All Your Tags section below.

Tagging From the Toolbar

Instead of bringing up the Tags dialog from the context menu of a file, summon it via the Edit Tags toolbar button when you have a file selected. A “tag box” shows up near the toolbar button. It looks and functions like the one we discussed above, so you should have no trouble making it work.

If you can’t see the Edit Tags button, it’s likely that you hid it during one of your decluttering efforts9 Tips For a Minimalist & More Efficient Mac Experience9 Tips For a Minimalist & More Efficient Mac ExperienceYour Mac's interface is clean and beautiful as it is, but with a few tweaks here and there, you can polish it up some more for a more pleasant desktop experience.Read More. To bring that button back, first right-click anywhere on the toolbar. Next, select the Customize Toolbar… option from the menu to view the entire set of available toolbar buttons. Now drag the Edit Tags button from this set to the toolbar.

Searching For Text Message

Tagging From the File Inspector

You can add/remove tags from the Inspector or Get Info dialog for any file or folder. To bring up Inspector for a selected file, click on File > Get Info or press Cmd + I. Again, the tag section here is a replica of the tag creation box we saw above.

Tagging Within Applications

You’ll find the same tagging mechanism we discussed above in a couple of other places as well:

  • The “document” menu — The menu that pops up when you click on the name of a file or document in applications like Preview, Pages, and QuickTime Player.
  • The Save and Save As… dialogs

Since these tagging options are available within applications, they’re applicable to files only. To tag folders you’ll have to fall back on the context menu, the toolbar, or the Inspector.

Manage All Your Tags

If you want to create, edit, and delete tags in bulk, the Tags tab in Finder’s Preferences is the way to go. Open the Preferences dialog either by clicking on Finder > Preferences… or by pressing Cmd + , on the keyboard.

Mac finder search for text

Next, switch to the Tags tab. Here you’ll see a list of all the tags available for use, including any you have created on the fly via the context menu, Finder toolbar, and so on. To create new tags and delete existing ones from here, use the “+“/”” buttons below the tag list.

To rename a tag, hit Enter when you have the tag selected. You can even assign it a different color — click on the tag’s existing color in the list to view the menu of available colors. Deselect the checkbox for any tag if you don’t want that tag to show up in the Finder sidebar anymore.

Any tag you drag from the tag list and drop into the “Favorites” area below the list will show up in Finder menus for quick selection and deselection. Drag a tag out of this area to make it disappear from the context menu.

You have probably noticed that you can manipulate tags from the Finder sidebar via their context menu. The options you can pick from are self-explanatory, so we won’t get into those. Keep in mind though the distinction between the Delete Tag and Remove from Sidebar menu options. The latter hides the tag from view, but doesn’t delete it for good.

How to Use Tags to Simplify Your File Search

You might have already figured out that you can filter files and folders by tags by clicking on any of the tags in the Finder sidebar. What can you do beyond this? We have a few suggestions:

  • Search by tag in Finder. Start typing in the name of a tag or its color in the Finder search bar and you can then pick from the matching tags that show up.
  • Set up a smart folder to filter by (multiple) tags8 Smart Folders You Need on Your Mac (And How to Set Them Up)8 Smart Folders You Need on Your Mac (And How to Set Them Up)A Mac Smart Folder lets you group together similar files from all over your machine. Here's how to use them and some great examples to get started with.Read More.
  • Ask Siri to filter files by a specific tag.
  • Organize Finder items by tags via the Sort By and Arrange By options under View > Show View Options.
  • Search by tag in Spotlight by typing in tag: tag_name. It’s a pity Spotlight search for tags doesn’t seem to work for everyone, and there’s no easy explanation or solution in sight. Although, this won’t be a problem for you if you use a third-party application that supports macOS tag search.

Do You Use Tags?

We must admit that the tagging system on macOS is a little temperamental at times, but it’s still worth using. If you come across a glitch or two, relaunching Finder should fix the issue. To do that, hold down the Option key and the Cmd key, click on the Finder icon in Dock, and click on Relaunch from the menu that pops up.

If you have ignored tags on your Mac so far, we urge you to test them out. They can help you find the right files and folders with minimal effort every time.

Want more tips for using Finder on Mac? Check out how to complete tasks in a click with Finder’s Quick ActionsFinder's Quick Actions Complete Mac Tasks in One ClickFinder's Quick Actions Complete Mac Tasks in One ClickQuick Actions in macOS make it easy to create custom workflows that do repetitive tasks in seconds. Here's how to try them now.Read More.

Explore more about: macOS Sierra, Organization Software, OS X Finder.

  1. Thank you for this detailed and thorough walkthrough of tags in MacOS!

    What I have found is that I need a hierarchical approach to tags. The flat list is not really practical. For example, I might want to tag by priority, by topic, or by assignee. I can kind of do this with something like 'priority/high' or 'assignee/bob', but it's sketchy. For instance, if I then search for 'bob' (either when adding a tag to an item or when filtering), it doesn't come up. If you have more than a few tags, this flat approach starts to fail pretty quickly. I have hundreds of tags, I really need a better way to manage them!

    Strangely, the tag manager in Finder's preferences does not show tags alphabetically, and has no option to sort. I can drag-and-drop them to change the order, but that's crazy to do manually!

    You also can't select by more than one tag in the Finder, unless you create a smart folder. Ugh! Alfred to the rescue, but then I can't browse by tags to filter a result set.

    I can't find any way to practically manage a large set of tags. There used to be an app from CASEapps (www.caseapps.com/tags/) called Tags, but it hasn't been updated in years, the last supported version of MacOS was OSX 10.8. DEVONthink *kind of* supports tags, but only when you import or export a file. If you tag a file in DEVONthink, you can't then find that item from the Finder or Spotlight (or Alfred) with the tag.

    Any advice for turbo-charging Tags?

If the weird name throws you, 'grep' is an acronym for 'general regular expression
program'. If that doesn't help, it's probably because you're wondering what a
regular expression ('re' or 'regex') is. Basically, it's a pattern used to describe

Key Finder For Mac

a string of characters, and if you want to know aaaaaaall about them, I highly
recommend reading Mastering Regular Expressions by Jeffrey Friedl and
published by Unix 端ber-publisher O'Reilly & Associates.

Regexes (regices, regexen, ...the pluralization is a matter of debate) are an extremely
useful tool for any kind of text processing. Searching for patterns with grep is
most people's first exposure to them, as like the article says, you can use them to search
for a literal pattern within any number of text files on your computer. The cool thing is
that it doesn't have to be a literal pattern, but can be as complex as you'd like.

The key to this is understanding that certain characters are 'metacharacters', which have
special meaning for the regex-using program. For example, a plus character (+) tells the
program to match one or more instances of whatever immediately precedes it, while parentheses
serve to treat whatever is contained as a unit. Thus, 'ha+' matches 'ha', but it also matches
'haa' and 'haaaaaaaaaaa', but not 'hahaha'. If you want to match the word 'ha', you can use
'(ha)+' to match one or more instances of it, such as 'hahaha' and 'hahahahahahahahaha'.
Using a vertical bar allows alternate matching, so '(ha|ho)+' matches 'hohoho', 'hahaha', and
'hahohahohohohaha'. Etc.

There are many of these metacharacters to keep in mind. Inside brackets ([]), a carat (^)
means that you don't want to match whatever follows inside the brackets. For Magritte
fans, '[^(a cigar)]' matches any text that is not 'a cigar'. The rest of the time, the carat tells
the program to match only at the beginning of a line, while a dollar sign ($) matches only at
the end. Therefore, '^everything$' matches the word 'everything' only when it is on a line all
by itself and '^[^(anything else)]' matches all lines that do not begin with 'anything else'.

The period (.) matches any character at all, and the asterisk (*) matches zero or more times.
Compare this to the plus, which matches one or more times -- a subtle but important
difference. A lot of regular expressions look for '.*', which is zero or more of anything
(that is, anything at all). This is useful when searching for two things that might or might
not have anything else (that you probably don't care about) between them: 'foo.*bar' will match
on 'foobar', 'foo bar' & 'foo boo a wop bop a lop bam boo bar'. Changing the previous example
to a plus, 'foo.+bar', requires that anything -- come between foo and bar, but it doesn't matter
what, so 'foobar' doesn't match but the other two examples given do match.

For details, try the man pages -- 'man grep'. There are a lot of different versions of the
program, so details may vary. All of this should be valid for OSX though.

Confusing? Maybe, but regular expressions aren't that bad when you get used to them, and
they can be a very useful tool to take advantage of it you know what you're doing. An example.

Let's say you have an website stored on your computer as a series of html documents.
As a cutting edge developer, you've seen the CSS light and want to delete all the
tags wherever they're just saying e.g. face='sans-serif' &/or size='12', because the
stylesheet can now do that for you. On the other hand, it's possible that the patterns
'face='sans-serif' or 'size='12' could show up in normal text (though admittedly
that's unlikely). In fact, what you really want to know is wherever those patterns show up in
a font tag, but you don't care about anywhere else that they might appear. Here's one way to
find that pattern:

This does a number of things. The -i tells grep to ignore case (otherwise it's case sensitive,
and won't match 'FONT' if you're looking for 'font' or 'Font'). The -r tells it to recursively
descend through the directories from wherever the command starts -- in this case, all htm and
html files in the current directory. Everything in single quotes is the pattern we're matching.
We tell grep to match on any text that starts with ' (thus staying within the font tag), and then either the face or
size definition that we're interested in. The one glitch here is that line breaks can break
things, though there are various ways around that. Finding them is left as the proverbial
exercise for the reader. :)

Mac Finder Searching For Text Within Files

The next question is, what do you want to do with this information you've come up with?
Presumably you want to edit those files in order to fix them, right? With that in mind, maybe
it would be useful to just make a list of matches. Grep normally outputs all the lines that
match the pattern, but if you just want the filenames, use the -l switch. If you want to save
the results into a file, redirect the output of the command accordingly. With those changes,
we now have:

Great. But we can do better still. If you are comforable with the vi editor, you can call vi
with that command directly. The trick is to wrap the command in backticks (`). This is a cool
little Unix trick that runs the contained command & returns the result for whatever you want
to do with it. Thus you can simply put this command:

The result of this command, as far as your tcsh shell is concerned, is something along the lines
of

Windows 7 Searching For Text In A File

etc. The beautiful thing here is that if you quit vi & re-run the command later, it will be
able to effectively 'pick up where you left off', since files you've already edited will
presumably no longer match the grep command.

And if you want to get really ambitious, you can use these techniques in ways that
allow you to do all your editing directly from the command line, without having to go into an
interactive editor such as vi or emacs or whatever. If you make it this far in your experiments,
then the next step is to learn to filter the results of a match and process the filtered data
in some way, using tools such as sed, awk, and perl. Using these tools, you can find all
instances of the pattern in question, break it down however you like, substitute or shuffle the
parts around however you like, and then build it all back up again. This is fun stuff! By this
point, you're getting pretty heavily into Unix arcana, and the best book that I've seen about
these tricks is O'Reilly's Unix Power Tools, by various authors. If you really want to leverage
the power of the tools that all Unixes come with, including OSX, then this is a great place to
both start & end up. There's plenty of material in there to keep you busy for months & years...