Live data from Hacker News

macOS command-line tools you might not know about

saurabhs.org

231–240 of 454 posts

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

#232
post #195

Earlier quoted context omitted.

Make sure both your phone and computer have Wi-Fi and Bluetooth turned on.

I'm curious why the Bluetooth is required? Requiring WiFi makes (so the phone/computer is on a network and can communicate with the other devices), but what's the benefit of Bluetooth? Does it only work when the phone and computer are near each other?

Bluetooth is used to discover peers and to initiate communication. Thus handoff works even on a wifi network that blocks broadcasts. It even works when no wifi network is present, by setting up an ad hoc network for the connection. (Disclaimer: This is all I know. The details seem rather murky, as handoff is a proprietary Apple protocol.)

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

#233
post #8

`pbcopy` and `pbpaste` are one of my most-loved in the list. Dealing with some minified json, switching to iTerm, doing `pbpaste | json_pp | pbcopy` and having a clean output is _so_ nice.

Json pretty printing in the terminal? Bless, didn't know about that and it is perfect

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

#234
post #195

Earlier quoted context omitted.

Make sure both your phone and computer have Wi-Fi and Bluetooth turned on.

I'm curious why the Bluetooth is required? Requiring WiFi makes (so the phone/computer is on a network and can communicate with the other devices), but what's the benefit of Bluetooth? Does it only work when the phone and computer are near each other?

Yes.

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

#235
post #102

Earlier quoted context omitted.

command shift 4 already saves a file, maybe you were thinking about command + shift + control + 3?

IIRC Cmd+shift+4 by default stores to a file, but it is easily changeable in settings. Mine has been set to store to clipboard since a long time ago (since i mostly ever take them to send to someone in chat or to insert into my own notes, for which clipboard is exactly what i need). To change it: open Screenshot app (either cmd+shift+5 or from the app launcher), click Options in the center bar, and set "Save to" to "…

You can also right-click the screenshot thumbnail to save to clipboard or some other location on a one-off basis.

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

#236
post #137

Caffeinate is definitely the one I miss most on Windows. Super handy to keep your machine awake whilst some task is ongoing.

Amphetamine has been my go-to app for keeping my Mac alive, especially since Apple tried to remove it from the App Store because, according to [someone?], the name violated App Store rules.

https://apps.apple.com/us/app/amphetamine/id937984704

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

#237

Earlier quoted context omitted.

GNU and BSD grep both default to "basic" regular expressions and both have the `-E` switch to use "extended" expressions.

Last time I used macOS (which was 6 years ago) there was no extended expressions, or the regex syntax was limited. I forget (again, haven't used an apple product in years)

It's not necessary to install a suite of commands if you want updated grep.

Just use Homebrew and you can install different versions of grep, including GNU's:

    brew install grep

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

#238
post #57
post #3

Neat, I was not aware of `networkQuality`. A good replacement for opening up Speedtest or whatnot when you just want to figure out if the network is slow or something else is up.

It seems to grossly underestimate my upload bandwidth!

What are you, a station wagon full of thumb drives?

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

#239

Needs to mention afplay for playing audio! You can easily use this to make a command-line MP3 player. Others have mentioned the “say” utility for speech synthesis. There is a lot you can do with it, it supports the TUNE format, which allows you to "shape the overall melody and timing of an utterance... for example ... to make an utterance sound as if it is spoken with emotion". See: Apple's Speech Synthesis Programmi…

Unfortunately, the TUNE format turned out to be a bit of an evolutionary dead end; the last generation of Speech Synthesis that supports it is the Alex voice which shipped in 2007, and it's highly unlikely in my opinion that we'll ever see it again — pinpoint control of synthesis and naturalness are inherently in tension, and the latter is a lot more valuable.

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

#240

While you're at it, `brew install coreutils`. The coreutils that ship with macOS lack a lot of features available on Linux. If you use bash, I recommend upgrading it, too, since Apple ships a 16 year old build (iirc due to legal issues associated with GPLv3) `brew install bash`

[deleted]
Post reply on HN