Live data from Hacker News

macOS command-line tools you might not know about

saurabhs.org

41–50 of 454 posts

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

#41

I just freaked out my cat using `say`. I'm going to enjoy this too much.

YEARS ago, when my nephew was young, he was playing with my mother's Macbook Air at Thanksgiving.

I administer that machine for her (to the extent that such a thing is needed), and so I knew (a) her login and (b) that SSH was open.

Me combining remote access with "say" made for a very memorable morning for that kid.

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

#42

`pbcopy | jq | pbpaste` is a very frequent command that I run to quickly format json in the clipboard. I use pbcopy and pbpaste probably all day long and always miss it in Linux environments.

You should Alias xsel if you’re in an x environment

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

#43

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?

It's been cli util on macos for 10+ years. I remember a gui util called caffeinated, though.

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

#44
post #5

I was aware of about half of these but textutil, networkUtility, and sips I didn’t not and look really interesting

Yeah, sips has a lot of potential. The article doesn't mention it, but it can crop as well which could be a real game-changer!

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

#45

Nice list. Also, hidutil ( https://developer.apple.com/library/archive/technotes/tn2450... ). Example: hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000049,"HIDKeyboardModifierMappingDst":0x700000065}]}' For my PC keyboard, remaps "Ins" (normally useless under macOS) to something ("PC Execute") I can trap and remap with Keyboard Maestro.

    hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}'
Remaps top left key on Euro-style keyboards from useless "paragraph" to useful "backtick".

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

#46

  /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport
I set an alias in my shell so this is just 'airport', lets you interact with the wifi settings - I particularly like 'airport -s' for doing a scan of the local wifi networks, since it shows signal strength and channel information right there, which is helpful when troubleshooting.

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

#47

Wut? No fs_usage? Easily one of the most useful of them all .. https://www.manpagez.com/man/1/fs_usage/ I can't count the number of times a bit of fs_usage foo has helped me dig out of a seriously messy pile of network, file and page fault issues ..

Useful, but definitely more niche & less generally applicable than the others.
Post reply on HN