Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Path Finder 5 - The Finder, greatly enriched again' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Path Finder 5 - The Finder, greatly enriched again
Authored by: dal20402 on Nov 12, '08 07:38:17PM

I'm so sorry that a weakling such as myself who does not have the entire filesystem memorized pollutes your world.

[ Reply to This | # ]
Path Finder 5 - The Finder, greatly enriched again
Authored by: mario_grgic on Nov 13, '08 06:08:54AM

That's exactly my point. Don't you know how to use spotlight (one of THE best features of OS X)?

Why do you ever have to navigate the file system or memorize the file system? That is the whole point of spotlight.

Mind you spotlight is not a new or revolutionary idea. People have been doing the same for ever in terminal, but the nice thing of spotlight is that it extends this idea to GUI, making GUI user more empowered.

The basic idea is this:

find me all files that match some complex criteria and then execute a series of commands on files that match.

In UNIX you do that by doing something like

command $(find / <some_file_meta_data_criteria> | xargs <options> grep -i -l -s "regualr_expression_file_content_needs_to_match" "{}"

so for example edit all text files in current directory with vi

vi $(find . -name "*.txt")

or edit all text files that contain the words "edit me"

vi $(find . -name "*.txt" | xargs -L 1 grep -i -l -s "edit me" "{}")


You can do something similar in Spotlight

CMD+space and type

kind:txt edit me

that finds you all text files (everywhere) that contain words "edit me". You can restrict the search to the directory as well.

Now you have your selection of files, so select them all and execute a command on them.

The point of spotlight and UNIX search commands is that you don't have to know the file system structure. You get to your data fast and easy.

[ Reply to This | # ]
Path Finder 5 - The Finder, greatly enriched again
Authored by: Anonymous on Aug 19, '09 07:10:50AM
vi? Why not sed? If the files all match some basic criterion, then it's highly likely you're going to be doing the same edit. So more like this then:
find /var/www -iname "*.html" -iname "*.php" -exec sed -i.$(date +%Y%m%d) -e 's/Copyright 2009/Copyright 2010/g' {} ;
mkdir -p ~/old_files
find /var/www -iname "*.$(date +%Y%m%d) -e mv {} ~/old_files ;
I agree on that point: If you're doing something complex, use the appropriate tool.

But I disagree on using Spotlight. If you're doing something simple, then you don't need anything more than the straight Finder. If your documents are cluttered or named inappropriately, then it's time you devoted a day to housekeeping. Spotlight could help out there, but it's of no practical use in a well-ordered filesystem.

[ Reply to This | # ]

Path Finder 5 - The Finder, greatly enriched again
Authored by: tedw on Aug 19, '09 12:52:07PM
well, what can I say - I have oodles of script files hanging around on my machine (php, javascript, ruby, etc.). many I've made myself, many I've downloaded as self-tutoring examples. I just love the fact that if I forget the right syntax for (say) createElement(), I can type createElement in spotlight and have a shortlist of all the files on my machine where that function is used. It takes me 20-30 seconds to find an example, rather than the 5 frustrating minutes or so I'd need if I had to dig through the file system (or god help me if I tried it using unix - and yes, I'm pretty good with unix). Spotlight has its flaws, no question, but sometimes (as Churchill so aptly put it) it's the worst system available except for all the others.

[ Reply to This | # ]