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


Click here to return to the '10.4: A c-shell alias for searching via Spotlight' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: A c-shell alias for searching via Spotlight
Authored by: nicholst on Apr 08, '06 01:59:43PM

I'm a (t)csh user, so I didn't need to bashify. However I made an improvement that I think would be helpful for either shell.

The problem is that if your search hits on any directories then 'ls' will show you the contents of the directories, which isn't really desirable. So I recommend adding two more ls options, 'd' & 'F'. 'd' makes the directory name itself be listed instead of the contents, and 'F' let's you know the item is a directory by appending a '/' after the name.

So my alias now looks like

alias spot 'mdfind -onlyin "`pwd`" \!* | sed s/^.\*\$/\"\&\"/g | xargs ls -ldFt | sed s:"`pwd`"/:: | sed "s/^[-dltrwx]*\ *[0-9]*\ [a-z]*\ *[a-z]*\ *[0-9]*//"'

-T

[ Reply to This | # ]