Live data from Hacker News

macOS command-line tools you might not know about

saurabhs.org

131–140 of 454 posts

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

#131

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`

They're shipping zsh now.

macOS has shipped Zsh for a long time. The difference is that now (since Catalina), it’s the default shell.

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

#134
post #120
post #83

Earlier quoted context omitted.

I like to use `pbcopy` when exporting public keys to external services like GitHub. `cat ~/.ssh/mykey.pub | pbcopy`

I love this tool too! except one time I quickly typed `cat ~/.ssh/mykey | pbcopy` And sent it straight away to my coworker on Slack. I then spent the rest of the day making a new private key and adding my new pubkey to all of the 1000+ servers I had root access to. I mean we had tools to help but it still wasn’t fun. With great power/convenience comes the potential to do dumb things at lightning speeds!

I might start naming my private key files ~/.ssh/keyname.PRIVATE after hearing that story...

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

#135

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…

You can be an ultra nerd on Linux and go this with the networking QoS tools: https://tldp.org/HOWTO/Traffic-Control-HOWTO/components.html

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

#136

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

I was hoping this would let me set 125% scaling on my 3440x1440 display but no, I guess it's a hard OS limitation. It's my biggest gripe with MacOS.

(There's BetterDisplay - formerly BetterDummy - but it introduces noticeable input lag for me.)

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

#138

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`

They come from BSD (and, nitpick, are not called coreutils). These BSD tools lack features mostly only if you're used to GNU coreutils.

The expanse of GNU coreutils features is questionable too: some are nice, some you can do without easily and rarely to never miss, and some are downright annoying (yes I'm looking at you, ls with colors+quotes)

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

#139

Not a bad list of basic macOS specific cli tools. For a more in depth list, I usually reference https://ss64.com/osx/ .

A tad outdated. At a glance I see it’s missing `networkQuality` (introduced in Monterey) and `realpath` (added in Ventura).

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

#140

Is there any easy shortcut to resizing an image by percentage or fitting to a specific size? Many a times, a website says "file needs to be no bigger than 2 MB", and I need to scramble with Preview app to resize teh app until it falls below that limit. A cli tool for that action would be very handy.

You can use ImageMagick's `convert`.

  convert original.jpg -define jpeg:extent=2MB output.jpg
The result will be around 2MB in size (in both directions).
Post reply on HN