Live data from Hacker News

macOS command-line tools you might not know about

saurabhs.org

51–60 of 454 posts

Re: macOS command-line tools you might not know about

#52
One I use a lot: mdls.

It's ls for metadata. Very helpful for getting quick and scripted access to the date/time when and the latitude/longitude where a photograph was taken.

Also, the say command is a lot more versatile than it seems.

Combined with the ability to save the speech to an audio file, my wife uses it as the disc jockey for her little hobby AM radio station. It introduces the song and does little station IDs and such.

You can customize it with dozens of dozens of voices, some in very high quality.

When a song from her Japanese playlists comes on, it switches to one of the Japanese voices. I don't speak Japanese, so I don't know if it actually translates the DJ words into Japanese, but it sounds pretty close to my untrained ears.

Re: macOS command-line tools you might not know about

#53

Great list. Didn't know about pbcopy/pbpaste, very useful. I use open regularly. Often to open a directory in finder and preview a file. Looks like I can just use qlmanage from now on. Not sure I'd use screencapture manually, but I'm sure there are some automations that could benefit from this.

I suspect, like me, a lot of people have learned about pbcopy/pbpaste from the Github docs for adding a new SSH key to your account https://docs.github.com/en/authentication/connecting-to-gith...

Re: macOS command-line tools you might not know about

#55
post #17

Manage the Launch Services database: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister Manage file extended attributes (such as quarantine): xattr Execute a script (AppleScript or JavaScript): osascript -e

It’s weird how macs don’t come with a GUI for managing system services. Windows does.. that being said the number of times I’ve had to mess with system services on mac can probably be counted with a few fingers…

Re: macOS command-line tools you might not know about

#58

I remember Caffeine used to be a third-party program that would prevent your Mac from sleeping, same behavior as the `caffeinate` here. Were they acquired and incorporated into the OS?

I believe that Caffeine was a fairly simple GUI wrapper for the existing caffeinate command

Yes. There is a similar product called Amphetamine now.
Post reply on HN