Live data from Hacker News

macOS command-line tools you might not know about

saurabhs.org

81–90 of 454 posts

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

#81

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…

Never had heard of this before. Some other cool tools in the "additional tools for X-Code" package which I had also never heard of. https://developer.apple.com/download/all/

Thanks for sharing.

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

#82
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.

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

#83
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.

I like to use `pbcopy` when exporting public keys to external services like GitHub.

`cat ~/.ssh/mykey.pub | pbcopy`

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

#84

Self-plug of displayplacer[0] for changing screen resolutions/rotations/etc via the command line. [0] https://github.com/jakehilborn/displayplacer

Does this tool also allow me to change my iPad screen on Sidecar from landscape/horizontal into vertical?

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

#85

Earlier quoted context omitted.

If I had a nickel for each `cat foo.json | jq | pbcopy`, I'd be a rich man :)

That's a useless use of cat. You can use `jq . foo.json | pbcopy` or `jq < foo.json | pbcopy`.

Speaking for myself, the first form is more natural- even if it’s a useless cat, because I’m always cat-ing files to see their structure. Then progressively tacking on different transforms. And then finally putting it in whatever I want as output.

It’s so ingrained, I’m more likely than not to just write it out that way even when I know exactly what I’m doing from the onset.

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

#87

Self-plug of displayplacer[0] for changing screen resolutions/rotations/etc via the command line. [0] https://github.com/jakehilborn/displayplacer

Does this tool also allow me to change my iPad screen on Sidecar from landscape/horizontal into vertical?

It's not something that I've tried. There was a user report at the bottom of this GitHub issue that states sidecar rotation does not work.

https://github.com/jakehilborn/displayplacer/issues/17

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

#88

`tmutil` could be added to this list, it's a management cli for Time Machine

I don't even use Time Machine for my off-machine backups, but I use tmutil to create local snapshots so I can easily back out of changes by using the Time Machine GUI to restore files from the snapshot.

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

#89
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`
Post reply on HN