File and Folder Finesse

File and Folder Finesse

As someone who's been using Mac OS X—or even Mac OS 9 or Windows—you're familiar with the basics of working with files and folders. Dragging files between folders or volumes, double-clicking to launch applications or open files and foldersthese are the first things you learn about using a computer. However, in Mac OS X there are many other ways to do these things, and many other things you can do with files and folders. Here are some of the best tips. We'll start with contextual menus because they will be mentioned several times in the following pages.

Contextual Menus

One of the most useful ways to interact with files and folders in the Mac OS is using contextual menus. It is also the most infrequently used tool for almost every user I have ever worked with; in fact, many users don't even realize that contextual menus exist.

Contextual menus are accessed by holding down the control key as you click on a file or folder (also known as control-clicking) or, if you have a multi-button mouse, by right-clicking on a file or folder. The resulting menu is called "contextual" because the contents of the menu vary depending on the context (i.e., what you are clicking on). You can see an example of a few different contexts in Figure 5.17; the menu is different for a file, a folder, a volume, an application, the Desktop, and inside a folder.

Click To expand Figure 5.17: Contextual menus for a file, a folder, a volume, an application, the Desktop, and inside a folder

Although most Finder contextual menus contain the Help, Open, Get Info, Duplicate, Make Alias, and Copy commands, the rest of the menu is different for each file. You can move a file, folder, or application to the Trash using the contextual menu, or you can eject/unmount a volume. The menu for a file lets you open the file with a particular application (Open With). The menu for an application lets you view the contents of the application package. Instead of confusing you with options that may not apply, the menu changes to accommodate the particular file that is selected. In addition, if you click on the Desktop or inside an open folder, you can create a new folder or get info on the existing folder (the Desktop is a folder), and the Desktop's contextual menu lets you open the Desktop pane of System Preferences. These differences illustrate what is meant by the term "contextual."

Tip 

Many applications also support contextual menus; however, instead of acting on files and folders in the Finder, these menus will allow you to perform actions on the documents or files being used in the application. Experiment a bit by control/right-clicking in various places and in various contexts within your favorite applications; you may be surprised at the additional power and flexibility that exists.

Now let's briefly revisit how to add your own contextual menu plug-ins.

Add Contextual Menu Items

User Level:

normal or admin

Affects:

individual user or computer

Terminal:

no

The Finder's contextual menus provide many useful functions for working with files and folders; however, it's possible to add a good deal of functionality to these menus by installing what are called contextual menu plug-ins. These plug-ins provide additional functionality to the Finder's contextual menus such as the ability to view folder contents by simply control-clicking on a folder; or the ability to move file(s) to a specific location without having to drag them anywhere.

You can get new contextual menu plug-ins from the usual Mac software websites such as Version Tracker and MacUpdate. To install a plug-in, simply drag it to /Library/Contextual Menu Items (for use by all users) or ~/Library/Contextual Menu Items (for use only by your own account). In order to take advantage of the new plug-in, you'll need to relaunch the Finder. You can do this by forcing the Finder to quit (it will relaunch) or by logging out and then back in.

A few of my favorite contextual menu plug-ins are the freeware CopyPath (http://www.bergenstreetsoftware.com/) and Open Subfolder X (http://bubblepop.com/opensub/), and the shareware Ittec (http://www.balancesoftware.com/ittec/). CopyPath lets you control/right-click on any Finder item and choose the CopyPath item to copy the item's complete file path to the clipboard (in either Unix or Mac format). Both Open Subfolder X and Ittec allow you to control/right-click on a folder or volume and get a contextual menu that includes a hierarchical menu of the folder or volume contents—moving the mouse over a sub-folder will present the contents of that folder, and so on. They're great ways to quickly navigate to a particular file or folder. For the extra shareware payment, Ittec provides a host of other features, including the ability to drag a file out of the aforementioned menu to another location, to list the contents of StuffIt archives, to move files to the Trash from within folder listings, and much more.

Tip 

Ittec and the shareware FruitMenu (http://www.unsanity.com/) both provide the ability to access contextual menus by clicking and holding the mouse button down. If you have a single-button mouse, this saves you from having to use both hands to access contextual menus.

Copying and Moving Files

User Level:

any

Affects:

individual user

Terminal:

no

You know that you can move files between folders, and copy files between volumes, by dragging them. You probably also know that you can select multiple contiguous files in the same directory by shift-clicking them, or multiple noncontiguous files in the same directory by command-clicking them. Here are a few other tips for copying and moving files. (The tip table applies to all tips in this section.)

Copy Files/Folders without Dragging

If you view the contextual menu for a file or folder, one of the menu commands is Copy. If you select this menu item, the file or folder (and folder contents) aren't really copied—they're simply marked as being able to be copied. If you then control/right-click in an open area inside another folder or volume, the resulting contextual menu will include a new option: Paste (followed by the name of the item you had previously "copied"). If you select Paste in the menu, the Finder will copy the file or folder (and folder contents) to the current directory. (It will leave the original where it was.) This is a great way to copy a file to a different location; you don't have to actually drag it around, or worry about having two windows open next to each other. Copy, navigate, paste. Done. Although this feature has been around in Windows for quite a while, it's new to the Mac in OS X, and it's a welcome addition.

Move, Don't Copy

If you drag a file or folder from one location to another on the same volume, it is moved to the new location. If you drag the file or folder to another volume, it's copied to the new volume, and the original file or folder remains in its original location. That's fine, and makes sense, but how many times have you wanted to move a file to a different volume rather than copying it? Under OS 9 and earlier, you had to make a copy and then delete the original; that's no longer the case in OS X. Simply command-drag the file or folder from one volume to another, and the file is moved instead of copied. (Holding down option as you drag a file or folder still forces a copy—even on the same volume—just as it always has.)

Use Spring-Loaded Folders (and Toolbars!)

One OS 9 feature that was sorely missed OS X 10.1.x was spring-loaded folders. Apple restored this functionality in 10.2, and even added a bonus. To take advantage of spring-loaded folders, drag a file or folder onto a folder or volume; after a short delay (the duration of which is set in Finder Preferences), the folder or volume pops open in a new window, allowing you to drop the item into any sub-folder. If you then hold the item over one of those folders, the folder will open in a new window (and the previous folder will close). Using this procedure it is possible to quickly place a file inside any directory on your hard drive.

Spring-loaded folders work on the Desktop or in any window. In fact, if a folder opens (or is already open) partly off the screen, dragging a file or folder into the folder window and holding it will cause the window to actually move so that it is completely visible! Note that if a window is currently using column view, instead of "springing" open a new window, the columns will change to reflect the folder that is chosen for use—so you navigate columns just as you would normally, except that you drag the item over each sub-folder as it appears, rather than clicking each.

Tip 

Regardless of the delay you've chosen for spring-loaded folders, you can force them to pop up immediately by pressing the space bar as you drag an item over a folder or volume. In fact, you can actually disable spring-loaded folders in Finder Preferences, and the space bar will still force a folder or volume to spring open. This is a great way to avoid accidental pop-ups.

The bonus I mentioned that Apple has provided in OS X is that spring-loaded folders also work for Finder window toolbar items. If you have a volume or folder in your Finder toolbars (including the standard Home, Applications, etc., items), you can drag an item over it, and spring-loaded folders will take over.

Tip 

If you choose to hide mounted volumes on the Desktop, putting your hard drive in the toolbar is a great way to still take advantage of spring-loaded folders. If you have multiple hard drives, create a new folder in an out-of-the-way location and place aliases to each of your hard drives inside of it. Then drag this folder to the Finder's Finder toolbars You now have a spring-loaded toolbar item that lets you drag a file or folder to any location on any drive.

"Hold" a File or Folder Temporarily

Although Finder toolbars and spring-loaded folders are extremely helpful, there are still times when you wish you could stick a file or folder somewhere for a moment. Maybe you need to figure out where you want to put the item, or you need to dig through a bunch of folders to get to that place. Or maybe you want to put something aside for later use. A great little utility for just such a purpose is XShelf (http://homepage.mac.com/khsu/XShelf/XShelf.html). It provides a shelf where you can drag files and folders, or even text, graphics, or URLs from within applications (Figure 5.18). Items remain on the shelf until you remove them. Although XShelf doesn't seem like a big deal, it's one of those things that makes you wonder how you ever worked without it.


Figure 5.18: XShelf provides a shelf for temporary storage

Opening (Files) With

User Level:

any

Affects:

individual user

Terminal:

no

Although you can open files by double-clicking them, or by dragging them onto an application's Finder or Dock icon, Mac OS X provides the ability to open a file, using any application, from the file's contextual menu. If you control/right-click on a file, one of the options is "Open With"; if you move the cursor over this item, a list of applications that can open the file will appear, along with the item "Other." Selecting an application will open the file in that application. If the application you want to use to open the file isn't listed, choose Other and you'll be able to browse to your preferred application. (This option gets used more often than you might think, as OS X isn't very good about listing all the applications that might be able to open a file.)

Tip 

If you control/right-click on a document, and then press the option key after the contextual menu pops up, the Open With option changes to Always Open With. This feature permanently changes the application association for this particular file.

Open With Using Zingg!

User Level:

normal or admin

Affects:

individual user or computer

Terminal:

no

Although Mac OS X's "Open With" functionality is very useful, you can improve on it using the freeware contextual menu plug-in Zingg! (http://www.brockerhoff.net/zingg/). Zingg! adds its own Open With contextual menu item, but allows you to customize it. Instead of letting OS X guess which items might be able to open a file, you can choose which applications appear (and don't appear) in the sub-menu. You can also choose to only show Classic applications when the Classic Environment is running. I hope Apple will add this functionality in future versions of Mac OS X; for now, Zingg! is a great addition.

Go Directly to a Folder

User Level:

any

Affects:

individual user

Terminal:

no

It's fairly easy to get to specific directories and files in Mac OS X; as mentioned earlier in the chapter, column view is especially quick for such purposes. In addition, using aliases, the Dock, or other launching utilities discussed in the Online Bonus Chapter, you can keep frequently used files and folders at your fingertips. However, there may be situations where you know exactly where a file or folder is, and want to get to it as quickly as possible. Mac OS X has great feature for these situations, called "Go To Folder." You can access it from the Finder by choosing Go Go To Folder or by pressing shift+command+G. You'll be presented with a dialog (in the frontmost Finder window, or in a separate dialog window if no Finder windows are open) in which you can type the exact path to the Folder you wish to access.

Tip 

To speed things up, or just in case you don't know the exact name or spelling of a directory, the Go To Folder dialog box features auto-completion. Type in the first few letters of a folder, then press tab; if there is only one folder in that directory that starts with those letters, the rest of the directory name will be filled in automatically. For example, to get to the main Utilities folder, you could type /Ap <TAB> Ut <TAB>—the first tab would complete /Applications and insert the trailing /, and the second tab would complete Utilities and insert the trailing /. Hitting return would then go directly to the Utilities folder.

This feature is also an excellent way to get to hidden directories. For example, if you wanted to get to the /etc/httpd/users directory, which is normally hidden in Finder windows, you would simply access the Go To Folder dialog, then type in /etc/httpd/users; you would be taken directly to that folder.

Alias Action

User Level:

any

Affects:

individual user

Terminal:

no

Most Mac users have encountered aliases—shortcuts or placeholders that point to another file or folder. Many Mac users take advantage of aliases frequently. If you're working on a file, you can create an alias of the file on your Desktop for easy access (while the file itself remains in its original location). You can create a folder full of aliases to frequently accessed files and folders—in fact, that's exactly what the Favorites folder in OS X is. You can even create aliases to connected servers while they are mounted; the next time you want to access the server, you can just double-click the alias instead of going through the Connect to Server dialog.

If you've never created your own aliases, you simply select a file or folder and choose File Make Alias (or press command+L). You can also control/right-click and select Make Alias from the contextual menu. An alias to the file is created, which you can move anywhere you like. Double-clicking the alias is exactly the same as double-clicking the original file. You can also drag and drop aliases, and onto aliases, just as you would the original file.

Tip 

If you hold command+option as you drag a file to another location, when you release the mouse button an alias to the file will be created there, leaving the original untouched. This is a great shortcut for placing an alias in a location different from the original file.

If you have an alias and you want to find out where the original item is located, click on the alias and choose File Show Original (or press command+R), or choose Show Original from the alias's contextual menu. A new folder will be opened in the original file's location, with the file highlighted. (If the file is on the Desktop, it will simply be highlighted.) Deleting an alias does not affect the original file in any way.

Although aliases provide a good deal of functionality on their own, here are a few other alias tricks you might find useful.

Use the Desktop as Your Home Folder

User Level:

admin

Affects:

individual user

Terminal:

no

Although I've always been the type to keep documents and personal files inside the Documents folder (even under OS 9), I've met many Mac users who use the Desktop as their primary workspace—they keep their files, folders, everything out on the Desktop. In fact, I've talked to quite a few users who are now using Mac OS X who don't like the fact that their account is centered around their home folder. If you're one of these people, this tip is for you—you can actually change your home folder from ~/username to the Desktop.

  1. Navigate to /Users and select your home folder.

  2. Create an alias to your home folder on the Desktop (hold command+option as you drag it to the Desktop).

  3. Move anything currently on the Desktop into your current home folder by dragging it onto the alias you just created.

  4. Drag the alias into your home folder.

  5. Open Terminal and type sudo mv Desktop Desktop.Backup <RETURN>. Enter your admin password when requested. This renames your original Desktop folder (and keeps it handy if you change your mind about this later).

  6. Again in Terminal, type sudo mv aliasname Desktop <RETURN>. This renames the alias that you previously created to "Desktop." As you know by now, the Desktop is simply a folder called Desktop in your home folder, so what you've just done is make an alias to your home folder the Desktop—thereby making the Desktop your home directory.

  7. Log out and then back in to take advantage of the changes you just made. When you do, all of the items previously on your Desktop will be there again, along with all of the folders in your home directory.

Tip 

If you previously had set your web browser or any other application to save files to the Desktop, after using this tip you should update those settings to save to your home folder.

How Do I Go Back?

If you decide you want to go back to the standard home/Desktop setup, it's pretty quick and painless:

  1. Open Terminal and type sudo rm Desktop<RETURN>. Enter your admin password when prompted. This command deletes the alias to your home folder that you previously named "Desktop."

  2. Again in Terminal, type sudo mv Desktop.Backup Desktop. This renames the backup of your Desktop folder back to "Desktop."

  3. Log out and back in. Your Desktop will be back to normal. You can now move any Desktop files you had previously moved to your home folder back to the Desktop. (Remember to reset your download settings in your browser and any other applications, if you had previously changed them for this tip.)

Open Groups of File, Folders, and Applications at Once

User Level:

any

Affects:

individual user

Terminal:

no

This is just a quick tip that expands on the idea of aliases. If you want to quickly open a group of files, folders, or applications (or a combination of the three), you can create aliases to them and put them in a folder or on your Desktop. When you want to open them, you can select all of the aliases at once and double-click them (or select File Open or Open from the contextual menu).

That works fine, but it's kind of messy. And if you have several groups of aliases, you're looking at an even bigger mess. It turns out that several developers have created convenient solutions for such scenarios. The freeware utility HotAlias (http://www.trufsoft.com/), and the shareware apps AliasMultiplier X (http://www.ziksw.com/) and Multiple Launcher X (http://www.naratt.com/MultipleLauncher.html) all allow you to create single documents that, when launched, open a group or combination of files, folders, URLs, and/or applications. Although these applications are each a bit different, they all use a similar interface: you drag a combination of files, folders, applications, URLs—any type of Finder item—into a document window, arrange them in the order you want them to launch, and then save the document. Opening that document in the Finder launches/opens all the files inside.

These utilities are great for opening groups of files for a project—they work especially well at login. For example, in writing this book I needed Word, OmniOutliner, DEVONthink, TextEdit, a web browser, and various Finder folders open. I created a launch document that opened everything at once, and placed it in my Login Items in System Preferences. When I logged into my account, everything was ready and waiting for me.

Favorite Files and Folders

User Level:

any

Affects:

individual user

Terminal:

no

I mentioned in the previous section that you can create a folder of aliases to frequently accessed files and folders in order to provide quick access to these items. Mac OS X actually provides a standard folder for such a purpose, and gives you easy access to it. This feature is called Favorites, and is one that many users don't take advantage of.

The Favorites folder is located at ~/Library/Favorites (meaning each user has their own). You can access it from the Finder by choosing Go Favorites (or pressing shift+command+F). You can place aliases to files, folders, or applications in this folder (or the actual items, if you prefer), and when you want to access one of these items, you simply open Favorites using the same method. Even better, you can access individual items within the folder instantly by choosing Go Favorites item name (a sub-menu appears with the contents of the Favorites folder). Finally, if you customize Finder toolbars as discussed earlier in the chapter, one of the toolbar items is Favorites. If this item is in your toolbar, you can click it to instantly go to the Favorites folder; better yet, you can drag items onto the Favorites toolbar item to place them in the Favorites folder (hold down command+option to instead place an alias to the item instead of the original).

This is a great feature for accessing files and folders in the Finder. However, you can also access your Favorites in the Open/Save dialogs of Mac OS X-native applications (Figure 5.19). When you click on the navigation pop-up menu, you'll see a section called Favorite Places that lists the folders inside your Favorites folder. So if you place aliases to the folders where you most frequently save files to and open files from, you can go directly to them from within Open/Save dialogs. (You can also add folders to your Favorites from within these dialogs by clicking the Add to Favorites button.)


Figure 5.19: Accessing Favorites from an Open dialog
Tip 

In addition to accessing favorite folders, you can access the most recent folders you've opened via the Go Recent Folders submenu in the Finder.

Finding Files, Folders, and Information

It's easy to get to files and folders in Mac OS X—assuming you know where they are. But what about those times when you know a file's name, or part of its name, but you're not sure where you put it? What if you can't remember a file's name, but you remember some of the text you included in it? Or what if you need to find all of the files on your hard drive that mention a specific report you're working on? Fortunately, Mac OS X provides solutions to all of these dilemmas.

Find Files Faster

Mac OS X provides three ways to find files: Search, Find, and Locate. You're probably thinking, "Don't those mean exactly the same thing?!" Well, in English, almost, but in OS X, no. Here's how they differ, and when you'd want to use one over the other.

Search

User Level:

any

Affects:

individual user

Terminal:

no

The Search function is only accessible if you've added the Search item to your Finder window toolbars (via the Customize Toolbar window). The reason for this is that the Search function only searches the contents of a window and any folders and sub-folders in that window. (Or, if you've selected a folder within the window, it searches just the contents of that folder.) In other words, if you know a file resides somewhere inside your Documents folder, you can navigate to your Documents folder, type in the name of the file (or part of the name) in the Search field, and press return to start the search. Once the search is complete, you'll see what looks like a standard Finder window in list view, except that it's divided into two panes. The top pane lists the results of your search—all files within the selected folder that match your search criteria. If you select a file, the bottom pane shows you the path to it (where it is located).

Tip 

The path pane (the lower pane of the results window that shows the path to a selected file) is resizable. If you make it larger, the path will be presented as a hierarchical folder path. If you make it smaller, the path will be reduced to a horizontal representation of the path. Double-click the resize bar and it will automatically resize to fit the horizontal presentation.

You can use any file in the top (results) pane just as if it was a file in a standard Finder window: you can open, move, copy, delete, Get Info, etc. You can also open the enclosing folder for the item by choosing File Open Enclosing Folder (or pressing command+R). The actions you can perform in the lower (path) pane are much more limited; you can double-click the item to open it, or on any folder in the path to open that folder. You can also use the File menu to perform certain tasks such as Get Info, Move to Trash, and Add to Favorites.

Tip 

Once you get a list of search results, you can use the Search function again to search within those results. For example, if your first Search returned too many results, you can enter a more specific search term to narrow down the matches without starting over.

Once you're done with your search, simply click the Back toolbar item to return to the previous (pre-search) window.

Note 

The toolbar Search item has two bugs as of OS X 10.2. The first is that it cannot search the Trash; if you open the Trash and try to use the Trash window's Search tool, you will always get no results. The second is that if you navigate to a folder using an alias to that folder, any toolbar Search you conduct will yield no results. Apple's solution is to reveal the original folder first (using the Finder's Reveal Original command), and then open the folder directly; you can then perform the Search.

Find

User Level:

any

Affects:

individual user

Terminal:

no

The Finder's Find function is what most users probably think of when they think about finding files. You access this feature in the Finder by choosing File Find (or pressing command+F); you're presented with a new Find window. Find is much more powerful than Search in that you can search specific places, or a combination of specific places, for files using a variety of criteria.

The "Search in" pop-up menu lets you choose to find files anywhere on all mounted volumes (Everywhere), on Local disks (meaning it will not search connected servers), in just your Home folder, or in Specific places. Selecting the last option adds a new window where you can add and remove volumes or specific folders on volumes. In addition to the Add button, you can also drag volumes or folders into the window to add them. Select a volume or folder and click the Remove button to remove it (or just uncheck it to omit it from the search without permanently removing it).

The standard search criteria are "file name contains" and "kind is kind." However, the options here can be changed to find ever-more specific combinations of criteria (Figure 5.20). You can add additional criteria using the Add Criteria pop-up, and add additional iterations of existing criteria using the + buttons to the right. To remove a condition, click the - button next to it. The various pop-up menus allow you to customize how files should match the listed criteria. (Most of the criteria are self-explanatory; I'll talk about "content" in the next item.)

Click To expand
Figure 5.20: A complex Find

Once a Find search is completed, the results will appear in a window that looks exactly like the results window from the Search function, and you can work with items in the window in exactly the same manner. In fact, you can still use the Search toolbar item to search within the results of your Find!

Tip 

If you click on the word "Search" in a Finder window toolbar (just below the Search field), the Find window opens. Most users wouldn't give this a second thought, but since you now know the difference between Search and Find, it should seem a bit odd. Regardless, it's a convenient quirk in that placing the Search item in the toolbar gives you quick access to both features.

Unfortunately, despite the fact that files can still have file types and creator codes in Mac OS X, at the time of this writing, Apple had removed the ability to find files based on those criteria (it was possible in previous versions of the Mac OS, including OS X 10.1.x). If you need to find files by file type or creator code, and Apple hasn't included that ability in the Find function by the time you read this, your best bet is a utility I mentioned earlier in the chapter, File Buddy.

Locate

User Level:

any (admin to update)

Affects:

individual user (update affects computer)

Terminal:

no

As a Unix-based system, Mac OS X includes the standard locate command. A file called the locate database keeps track of every file on every mounted volume. On a periodic basis, OS X updates this database to keep it current. You can access this database in Terminal using the locate command; you can narrow your searches using the Unix tool grep. (I'll talk more about grep in Chapter 15.)

You're probably wondering why you would ever use locate, or need to worry about grep, when the Find function works so well. One reason is that the Find command actually searches your drive(s) each time it runs, so it can takes a while (sometimes a long while). However, since the locate database already exists, the locate command is almost instantaneous. Another reason is that there are some excellent tools out there that allow you to take advantage of the locate database without dealing with Terminal. My favorite is the freeware Locator (http://www.sebastian-krauss.de/software/).

Locator provides a graphical interface to the locate command (Figure 5.21); you simply type in a word or string of words and press the Start button, and it searches the locate database for matching files. You can tell Locator to search specific volumes or folders by typing in a path in the In field, or by choosing it from the menu next to the field (check Recursive to search within sub-folders). Note that the locate database is case-sensitive; if you want Locator to ignore the case of your search terms, check the Case Insensitive box. (What is actually happening is that Locator is searching the locate database for all possible combinations of case; this means that case-insensitive searches will take more time than case-sensitive ones.)

Click To expand
Figure 5.21: Locator provides a nice interface to the locate command
Tip 

If you're a grep expert, but prefer the interface of Locator, you can have your cake and eat it too. Select Grep from the Locate pop-up menu, and then type your grep expression in the search field. You can also check the Regular Expression box to use regular expressions.

I mentioned previously that the locate database is updated periodically; the one disadvantage this has is that it's not "up-to-the-minute" up to date. If you want to make sure that your search will catch even the newest files, choose Database Rebuild Locate Database This forces OS X to update the database. (You can see when the last update occurred by choosing Database Check last Locate Database Update.)

Locator has many other features that I simply don't have the space to cover here. A few quick examples: it can search for contents of packages; it can create special locate databases of removable volumes and media (so you can search for files on CDs or Zip disks even if they're in a closet); and it can index and search the ID3 tags of MP3 files.

Find Files by Their Content

User Level:

any

Affects:

individual user

Terminal:

no

What if you need to find a file, and you don't know its name but you know a few words of its contents? Or what if you're trying to gather information for a report, and want to find every document on your computer that mentions a certain topic? The Find function of OS X has an additional criterion called "content" that lets you find files based on their contents. To take advantage of this feature, open a Find window in the Finder, and choose "content" from the Add criteria pop-up menu. You can choose to search only by content by removing any other criteria, or you can further limit the search by adding more criteria.

The one caveat to finding files by content is that for it to work, you first need to index files. You can index entire volumes, or you can choose to index individual folders. Select a volume or folder, choose File Get Info (or press command+I), and then click the disclosure triangle for the "Content index" panel (Figure 5.22). You'll see whether or not the folder or volume has ever been indexed, and, if it has, when the index was last updated (in this case, never). Click the Index Now button to index the volume (or update the existing index, if it exists), or the Delete Index button to delete the existing index.


Figure 5.22: The Content index panel for a folder
Note 

Because of permissions and security issues, it's not possible to index the boot volume. You must index individual folders.

The Finder doesn't actually index every word in a file; rather, it indexes what it considers to be important or identifying words—words that you would be likely to use when trying to locate each file. When I discussed the Finder Preferences, I mentioned that you can choose what language(s) the Finder uses when indexing volumes or folders. This affects content searches because the Finder indexes what it considers to be known words, and if you don't tell it to use Spanish, for example, it won't index Spanish words, and, therefore, you won't be able to find by Spanish content.

Note 

Each user has their own content index(es). These indexes are located at the root level of each indexed folder, in an invisible file called .FBCIndex.

Prevent Files from Being Indexed

User Level:

admin

Affects:

computer

Terminal:

no

There are times when you may want to prevent certain folders from being indexed. There are also certain types of files you may not want indexed. (Indexing files takes quite a bit of time, and the indexes themselves grow in size the more files are indexed, so it's preferable to index just those files you may want to search.) Inside /System/Library/Find are text files that tell the Finder what gets indexed and what doesn't. By launching a text editor as root, you can edit these files to allow more files and folders to be indexed, or to further restrict indexing.

  • SkipFolders This file contains a list of folders that should not be indexed. By default, it contains only root-level directories. However, you can add directories to the end of the list, one per line, to prevent them from being indexed. For example, to prevent the Shared user folder from being indexed, add Users/Shared. (If you add a line with just /, it will prevent any indexing of any contents of the boot volume.)

  • StopExts This file contains a list of file extensions that should not be indexed. You can add your own to the end of the list; for example, I do a lot of statistical work, and the data files for the Stata statistical environment end in .dta. I've added .dta to the end of the StopExts file on my computer so that these data files don't get indexed.

  • StopTypes The StopTypes file works just like the StopExts file, except that instead of listing file extensions, it lists file types (the four-letter file type identifier I talked about at the beginning of the chapter). Add file types to prevent them from being indexed, or remove them to allow those types of files to be indexed.

Third-Party Find by Content

User Level:

any

Affects:

individual user

Terminal:

no

One of the advantages of indexing is that content searches occur quickly. However, a disadvantage is that you have a content index in each indexed folder; for some folders these indexes become quite large. You can search for files by content (and by filename, for that matter) without indexing using the freeware EasyFind (http://home.arcor-online.de/grunenberg/easyfind.html). EasyFind works much like Locator, but with a simpler interface. You can choose to search for files, files and folders, or file contents. You can type a few words to search and then choose various Boolean options (and, or, phrase, or wildcard). Finally, you can choose case sensitivity, whether or not to search inside packages, and whether or not to include invisible items in your searches.

Since EasyFind doesn't use content indexes, it's quite a bit slower when searching for content within many files and folders. However, I've found that it's still quite fast, and it's a nice utility to have around.

Undo

This tip is one of the shortest in the book, but it's such a major feature, and one that so few people really know about or remember, that it deserves its own section.

Short and sweet: the Finder in Mac OS X has an undo function. If you accidentally move something somewhere, delete a file you didn't want to, or pretty much do any Finder action you wish you hadn't, choose Edit Undo (or press command+Z), and it will be undone. Write this tip down somewhere in plain sight, because it's difficult to remember simple things when you're panicking :-)

Warning 

You can't un-empty the Trash using undo. That's why it asks you if you're sure you want to do it.




 
ASPTreeView.com
 
Evaluation has µЕ¶НТЕіИexpired.
Info...