Live data from Hacker News

Using Spotlight from the OS X Commandline

0xfe.blogspot.com

11–20 of 32 posts

Re: Using Spotlight from the OS X Commandline

#11
post #4

It's nice to have access to such UI components from the command line. One of my favorite is pbpaste/pbcopy. What's yours?

`security` lets you manipulate your Keychains. `say` lets you do text-to-speech in command line.

say is pretty useful and fun. When I'm compiling or just telling the Terminal to do something tedious, I add a say command at the end and it will notify me when it's done.

For example, if I want to install mercurial and git with homebrew:

brew install git mercurial; say "The task is finished, Master."

Re: Using Spotlight from the OS X Commandline

#12
post #10

I am very fond of the Mac, but the developers of Spotlight and the recent Versions feature of OS X Lion have not given proper thought to users' security and privacy. Spotlight peeks inside files to create an index, and Version-supported apps maintain a changelog of file diffs. These OS X features save data in hidden locations, separate from the file. This means that: (a) it is very difficult to delete a file and be c…

That seems like an excellent trade-off to me, a prime example of how Apple is great at picking the right trade-offs.

All what you said is completely irrelevant for the vast majority of people. So Apple doesn’t trade it off against the increased convenience both Spotlight and Versions give you.

Re: Using Spotlight from the OS X Commandline

#13
post #3

Earlier quoted context omitted.

$ softwareupdate -i -a [install, all] as it avoids the (slow) UI and you can schedule it if you want to. Not sure if it'll carry across to ML, what with updates going through the Mac App Store there.

One downside worth mentioning is that you can't read the full description of each available updates, like you can when you click on an item in the GUI version.

    softwareupdate -d -a
downloads all updates to /Library/Updates. For each update, you get a .pkg file to install and a metadata file that includes this description.

Re: Using Spotlight from the OS X Commandline

#14
post #10

I am very fond of the Mac, but the developers of Spotlight and the recent Versions feature of OS X Lion have not given proper thought to users' security and privacy. Spotlight peeks inside files to create an index, and Version-supported apps maintain a changelog of file diffs. These OS X features save data in hidden locations, separate from the file. This means that: (a) it is very difficult to delete a file and be c…

That seems like an excellent trade-off to me, a prime example of how Apple is great at picking the right trade-offs. All what you said is completely irrelevant for the vast majority of people. So Apple doesn’t trade it off against the increased convenience both Spotlight and Versions give you.

irrelevant for the vast majority of people

In real life people do think of pieces of paper as having different levels of security or privacy. Some pieces of paper you can leave out on the coffee table, others get locked in a desk, and still others in a safety-deposit box.

Also, as separate point, your use of the word "trade-off" assumes that there is no alternative other than giving the user some complex privacy-aware UI or complicated procedures.

Re: Using Spotlight from the OS X Commandline

#15

It's nice to have access to such UI components from the command line. One of my favorite is pbpaste/pbcopy. What's yours?

    osascript
of course: it lets you control the UI of Cocoa applications, and even more for scriptable ones:

    osascript -e 'tell application "Safari" to close every document ¬
                  whose url contains "news.ycombinator.com"'
(¬, option-(lowercase L), is the AppleScript line continuation character)

Re: Using Spotlight from the OS X Commandline

#16
post #14

Earlier quoted context omitted.

That seems like an excellent trade-off to me, a prime example of how Apple is great at picking the right trade-offs. All what you said is completely irrelevant for the vast majority of people. So Apple doesn’t trade it off against the increased convenience both Spotlight and Versions give you.

irrelevant for the vast majority of people In real life people do think of pieces of paper as having different levels of security or privacy. Some pieces of paper you can leave out on the coffee table, others get locked in a desk, and still others in a safety-deposit box. Also, as separate point, your use of the word "trade-off" assumes that there is no alternative other than giving the user some complex privacy-awar…

That comparison doesn’t work. At all.

Re: Using Spotlight from the OS X Commandline

#17
post #8

It's nice to have access to such UI components from the command line. One of my favorite is pbpaste/pbcopy. What's yours?

`open` is very convenient to… open things (see `man open`). Tip: `open .` opens the current directory in the Finder.

Another tip:

    open vnc://[user@]host[:port]
connects as user to host on port with Screen Sharing, and, more generally, "open URL" works for any URL scheme registered with Launch Services, including, but not limited to, the obvious ones.

Re: Using Spotlight from the OS X Commandline

#18
post #11
post #4

Earlier quoted context omitted.

`security` lets you manipulate your Keychains. `say` lets you do text-to-speech in command line.

say is pretty useful and fun. When I'm compiling or just telling the Terminal to do something tedious, I add a say command at the end and it will notify me when it's done. For example, if I want to install mercurial and git with homebrew: brew install git mercurial; say "The task is finished, Master."

As an aside, in Lion at least, you can download high-quality voices for dozens of languages in Speech Preferences (including the ones Apple uses for Siri in several countries).

Re: Using Spotlight from the OS X Commandline

#19
post #10

I am very fond of the Mac, but the developers of Spotlight and the recent Versions feature of OS X Lion have not given proper thought to users' security and privacy. Spotlight peeks inside files to create an index, and Version-supported apps maintain a changelog of file diffs. These OS X features save data in hidden locations, separate from the file. This means that: (a) it is very difficult to delete a file and be c…

At least there's full disk encryption with FileVault, if you want encryption.

Re: Using Spotlight from the OS X Commandline

#20
post #10

I am very fond of the Mac, but the developers of Spotlight and the recent Versions feature of OS X Lion have not given proper thought to users' security and privacy. Spotlight peeks inside files to create an index, and Version-supported apps maintain a changelog of file diffs. These OS X features save data in hidden locations, separate from the file. This means that: (a) it is very difficult to delete a file and be c…

You can easily exclude folders or disks from spotlight indexing.

System Preferences -> Spotlight -> privacy tab

to overwrite then delete the spotlight indices, disable spotlight then overwrite and delete:

   $ sudo srm --simple -rf /.Spotlight-V100/
There's also whole disk encryption (unfortunately not particularly robust -- I don't understand the reason but something about how the login password is stored seems to make this somewhat weak to eg the government) built in, as well as encrypted disk images and truecrypt.
Post reply on HN