Live data from Hacker News

macOS command-line tools you might not know about

saurabhs.org

331–340 of 454 posts

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

#331

Earlier quoted context omitted.

I have a clipboard manager application called "Paste" (creative i know). Its an awesome app for a million reasons. But one thing I like is that it allows me to see and hear when my iphone copy worked. So I have it enabled so there is a sound when something goes into the clipboard. Even on my mac, I have come to rely on that audio feedback. But it has the added benefit that when I am using my phone in front of my comp…

I wonder if it's this one: https://apps.apple.com/us/app/paste-clipboard-manager/id9678... I've noticed that more and more apps on both macOS and iOS sniff the clipboard contents and randomly clobber it. I usually notice it in apps like Sourcetree, where I'll click something or do a certain action and suddenly I can't paste anymore. I even get a feel for it, like my mind detects the pattern that empties the clipboard…

I would think requiring opt-in for clipboard functionality would be the more radical option that would leave most users (myself included, I would imagine) scratching their heads when they can’t copy/paste as a matter of course. Maybe you meant something more specifically related to 3rd-party sniffing/modifying clipboard contents, but I haven’t really encountered that outside of apps such as CopyQ and Paste, and they are pretty explicit and intentional about their functions.

I have found a lot of utility with cross-device copy/paste. I know it requires the somewhat mysterious phantom Bluetooth/Wi-Fi connectivity that AirPlay/Airdrop use, so if I have disabled Bluetooth on my device, for example, it will no longer work. I could see where it might not be fully reliable enough to count on, I have experienced inexplicable failures, not often but enough to understand that it might not be some folks’ default preference. As part of the “handoff” function, it can be disabled in Settings at least.

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

#332

Is there a place Apple documents these things? Do people find these things with something like “ls /usr/bin” and wondering “what is this?” or does Apple have an administrator’s guide somewhere? Or has someone written a good book with this stuff?

Hi, author here. There isn't any official canonical documentation that I know of, outside of the individual man pages. This was a list of commands I've been maintaining for myself over the years and thought it would be useful to share. If you want more like this, I also have another page full of lesser well-known macOS tips and tricks: https://saurabhs.org/macos-tips

Oh my, and a bucket load of iOS tips too!

TIL you can tap and drag with 2 fingers to multi-select list items in mail and notes, etc

Bless you for finding and collating

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

#333

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…

Network Link Conditioner rules. I pair it with `mitmproxy` for debugging native apps.

You can also use `rvictl` to connect to a development iOS device’s network device for grab a tcp dump.

Also Instruments has a really nice network capture tool now.

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

#335
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 have an alias that while trivally simple is quicker to type and remember. It copies whatever file you give it to the clipboard which is super handy. I use it with the "Compare with Clipboard" to diff a file in Rubymine for example.

alias clip='pbcopy <'

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

#336

say - text-to-speech engine: I would have expected that at the era of AI this would sound a bit better than the Commodore 64 speech synthesis from 80s.

It's dependent on the voice you pick in system settings. If you choose one of the siri voices for the system voice (not in the siri settings, iirc), it sounds much more natural.

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

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

Best way to get ssh keys into the paste buffer too.

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

#338

Years ago, I wrote a script to find something in a big blob of data and to alert me when it was done, I added a “say ” type phrase upon completion. I forgot about it and went to bed and was jolted awake hours later by what was clearly an “intruder” speaking to his accomplice, in my home office. Quite the relief when I realized what happened.

I would pay a lot of money to switch the voice to Arnold.

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

#339

`caffeinate` is a game changer. Now I can keep my Slack status green without sitting in an empty zoom room. #WFHLife ;)

Amphetamine does the same thing, but with a task bar icon and better usability: https://apps.apple.com/us/app/amphetamine/id937984704?mt=12

Or a full screen YouTube Mozart video that lasts for six hours

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

#340

Earlier quoted context omitted.

Is there any shell that has cat as a built-in? Such a shell could remove some of the more common cases.

All of them do. Including bash. It’s just not the same syntax (ie ‘ But I honestly think people who try to optimise away ‘cat’ are optimising the wrong thing. If one extra fork() is that detrimental then don’t use a shell scripting language. For a lot of people, “useless” ‘cat’ enables them to write a pipeline in the order that their brain farts out the requirements for the pipeline. So they’ve optimised for human pr…

> All of them do. Including bash.

Are you sure? https://unix.stackexchange.com/questions/208615/is-cat-a-she... disagrees and neither https://manpages.ubuntu.com/manpages/jammy/man7/bash-builtin... nor https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Command... mention it

Post reply on HN