Live data from Hacker News

macOS command-line tools you might not know about

saurabhs.org

91–100 of 454 posts

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

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

Where are you pasting the pretty json to view it?

I do this a lot as well, but just paste the minified json directly into VS Code and then OPT+SHIFT+F to format it.

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

#93
post #28
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.

Since you mention both pbcopy and iTerm - I love https://github.com/skaji/remote-pbcopy-iterm2 . I do most of the work on a remove Linux server, treating my MacBook as mostly a dumb terminal, and being able to transparently copy from the remove to my local clipboard is so nice.

The tmux integration in iterm is also very nice for remote work if you haven’t tried it out.

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

#94

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…

Toxiproxy is such a tool for everywhere else, and it did help me test and improve networking code for poor conditions: timeouts, retries, packet loss, etc.

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

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

Where are you pasting the pretty json to view it? I do this a lot as well, but just paste the minified json directly into VS Code and then OPT+SHIFT+F to format it.

`jq` acts as a pretty json viewer (among other things)

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

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

Those are so useful that I wrote trivial shell functions that do the same under Linux.

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

#98

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`.

In what way do you see those alternatives as superior?

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

#99
post #90

Surprised pngpaste isn't mentioned (in the article nor the comments). If you take a screen shot (command + shift + 4) or partial screen shot (command + shift + control + 4) you can save it directly to an image file with: pngpaste filename.png

Both commands you listed take a partial screenshot. The first one saves it to the desktop and the second one (with control) to the clipboard.

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

#100

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.
Post reply on HN