macOS command-line tools you might not know about
291–300 of 454 posts
Re: macOS command-line tools you might not know about
#292Earlier quoted context omitted.
A tad outdated. At a glance I see it’s missing `networkQuality` (introduced in Monterey) and `realpath` (added in Ventura).
Agreed. Some of the flags are missing as well. Not sure it's updated often, but still not a bad starting point. If only Apple would publish something directly. They do a pretty good job with the Apple Platform Deployment guide ( https://support.apple.com/guide/deployment ). And the Security guide ( https://support.apple.com/guide/security ).
Re: macOS command-line tools you might not know about
#293Earlier quoted context omitted.
That's a useless use of cat. You can use `jq . foo.json | pbcopy` or `jq < foo.json | pbcopy`.
Is there any shell that has cat as a built-in? Such a shell could remove some of the more common cases.
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 productivity. And given the human brain is slower than a few extra fork()s, I think optimising for one’s brain makes more sense here.
Re: macOS command-line tools you might not know about
#294Re: macOS command-line tools you might not know about
#295Neat, I was not aware of `networkQuality`. A good replacement for opening up Speedtest or whatnot when you just want to figure out if the network is slow or something else is up.
Edit: Found https://www.macinstruct.com/tutorials/how-to-check-your-macs... which says:
"The networkquality tool uses Apple’s CDN (https://mensura.cdn-apple.com/api/v1/gm/config) as a target"
The contents of this file (for me):
{ "version": 1,
"test_endpoint": "sesto4-edge-bx-021.aaplimg.com",
"urls": {
"small_https_download_url": "https://mensura.cdn-apple.com/api/v1/gm/small",
"large_https_download_url": "https://mensura.cdn-apple.com/api/v1/gm/large",
"https_upload_url": "https://mensura.cdn-apple.com/api/v1/gm/slurp",
"small_download_url": "https://mensura.cdn-apple.com/api/v1/gm/small",
"large_download_url": "https://mensura.cdn-apple.com/api/v1/gm/large",
"upload_url": "https://mensura.cdn-apple.com/api/v1/gm/slurp"
}
}Re: macOS command-line tools you might not know about
#296`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.
Re: macOS command-line tools you might not know about
#297Earlier quoted context omitted.
I love this flow! Such a powerful and clean way to solve text issues. # This will remove Windows double-spaced empty lines from your copy/paste buffer alias winlines="sed '/^$/{$!{N;s/\n//;};}'" # pbw = [P]aste [B]uffer to fix [W]indows line endings alias pbw="pbpaste | winlines | pbcopy" Also - if you want `pbpaste` and `pbcopy` on Linux... # imitate MacOS's paste buffer copy/paste: alias pbcopy='xsel --clipboard --…
There's `wl-copy` and `wl-paste` for Wayland users too, via https://github.com/bugaevc/wl-clipboard
Re: macOS command-line tools you might not know about
#298pbcopy/pbpaste are a lifesaver when doing stuff on the command line that has a lot of output and piping is not something you can do. networkQuality is something I really wish I knew about sooner.
Also for things like sharing public ssh keys. Instead of "can you send me your public key" and getting something with random line breaks depending on the users text editor I just have to ask them to "cat ~/.ssh/id_rsa.pub | pbcopy". I also alias pbcopy / pbpaste on Linux too, so useful!
Re: macOS command-line tools you might not know about
#299Re: macOS command-line tools you might not know about
#300 security find-generic-password -gw -l "${keychain_id}"
Super helpful for VPN automation scripts, easy logins to things like Vault, etc. The security tool has tons of other handy functions as well.