Live data from Hacker News

macOS command-line tools you might not know about

saurabhs.org

161–170 of 454 posts

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

#161
post #137

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

I’ve been looking for a better way to do this than just setting my PC to never sleep. Thanks for this. Now I need to find a Mac alternative as well.

caffeinate is on Mac.

  caffeinate -d -i -u -s

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

#162
post #137

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

If you're able to install PowerToys it includes a utility for this

https://learn.microsoft.com/en-us/windows/powertoys/awake

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

#163
post #37

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?

Anyone know of a Ubuntu on WSL equivalent?

https://learn.microsoft.com/en-us/windows/powertoys/awake to keep Windows itself awake?

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

#166
post #22

When mentioning `open` they should have noted that `open ` will open the given file with its associated app. It’s indispensable.

Especially open . if you need to drag a file somewhere. One thing that kind of breaks my muscle memory here is the opposite, something like firefox file.html doesn't work and you have to fiddle with the arguments to get open to launch a non-default application.

I use `open .` to open up a Finder window of the directory I'm currently in using Terminal so frequently that I've set up an alias for it --

  alias op='open .'

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

#168

Probably want to check your policies if using a business-owned mac. Caffeinate probably violates your security policies if it’s a decent sized company.

You can lock the screen while caffeinated though.

Automatic screensaver enable after a period of inactivity is considered a fail safe control.

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

#169

Not a command-line tool but the network link conditioner is also really great. Never seen such a tool on another OS You can simulate a really bad network. Latency, bandwidth, packet loss etc. Great for testing but also if people insist on cameras being on. Just screw up the connection so bad that everyone gets annoyed with your blocky image and robot voice and suggest you turn off video and then you make it 'magicall…

[Comcast](https://github.com/tylertreat/comcast) also does this for macOS, BSD, and Linux. And it's _brilliantly_ named.

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

#170
afconvert(1) lets you convert between various audio formats - most noteworthy is that it gives you access to Core Audio's superior AAC encoder without having to use iTunes/Music:

  afconvert music.wav -o music_160kbps_aac.m4a -b 160000 -q 127 -s 2 -f m4af -d 'aac '
lipo(1) lets you operate (replace/extract/thin/etc) on executables and libraries to tailor their supported architectures:

  lipo  -thin arm64e -output 
Post reply on HN