macOS command-line tools you might not know about
321–330 of 454 posts
Re: macOS command-line tools you might not know about
#322`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.
Being able to populate or read from the system clipboard (or secondary clipboard!), or to feed it, including by reading from or writing to pipes is wonderful.
Re: macOS command-line tools you might not know about
#323I would have expected that at the era of AI this would sound a bit better than the Commodore 64 speech synthesis from 80s.
Re: macOS command-line tools you might not know about
#324If you need a more featureful alternative to textutils, look for pandoc https://github.com/jgm/pandoc
Re: macOS command-line tools you might not know about
#325Earlier quoted context omitted.
The random linebreaks are ok - SSH can handle them. (that's how Userify does it I think, too. it replicates whatever the user provides.. no judgment :)
Ah, it's more for ~/.ssh/authorized_keys which is one key per line.
Re: macOS command-line tools you might not know about
#326Is 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?
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
Re: macOS command-line tools you might not know about
#327Earlier quoted context omitted.
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!
Userify would have made that pretty painless (all it really seems to do is update the authorized_keys across all of your servers every minute or so)
Re: macOS command-line tools you might not know about
#328macOS software versions:
sw_vers
macOS hardware overview: system_profiler SPHardwareDataType
Convert binary plist to xml plutil -convert xml1 -o out.xml in.plist
A couple of lesser known, but also handy ones to install: brew install dark-mode
brew install duti
> screencapture - take screenshotsBig fan of screencapture. I wanted something similar but for capturing window videos, so I built https://github.com/xenodium/macosrec
I often wrap command line utilites with Emacs functions (don't need to remember invocation flags/structure but also enables batch invocations) https://xenodium.com/recordscreenshot-windows-the-lazy-way
Re: macOS command-line tools you might not know about
#329`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.
So much of my Linux use is over ssh from a MacOS client that I've made a `pbcopy` executable that just pipes stdin over ssh to my MacBook to its pbcopy (with a dedicated ssh key that runs this as a forced command). Makes it super nice to be on an SSH session and `pbcopy` some content to my MacOS clipboard!
Re: macOS command-line tools you might not know about
#330Earlier quoted context omitted.
Don't forget to pipe head into 'cat -v'... that text file could contain _anything_!
I really recommend folks use "less" over cat, especially keyboard oriented folks. Different terminal emulators don't always have the scroll behavior I want, not do they always allow me to search the file I'm looking at. "less" does all those things, in nearly every environment no matter the terminal emulator, and has other wonderful options to boot (chop long lines so they don't wrap can be nice for logs, line number…
I've been typing cat for over 25 years. Old habits die hard.