187 days ago · Tech · hide · Fediverse post

I use Apple devices very often. Overall, I like macOS. Certainly more than Windows. One of the things I find extremely useful is a command I discovered not too long ago: pbcopy. pbcopy can be used to copy to the clipboard whatever it receives from standard input. For example, when I am in a shell, I often use a command like this: cat filename.md | pbcopy At that point I know that the content of the file is in the clipboard, and I can paste it wherever I need, calmly and without any additional steps. There is one limitation, though: this only works locally. It works when I am using my Mac and I want to copy something from the macOS shell. When I connect to a remote (*BSD, Linux, illumos based) server via ssh, pbcopy is not available. Or, more precisely, even if I create a command with the same name on the server, that command cannot directly talk to the clipboard of my Mac in the usual way. Luckily, modern terminal emulators have a few tricks available. I use iTerm2 for most of my ssh…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town