Skip to main content


You know you can use your mouse and keyboard between different Macs using Universal Control and copy/paste between them (which makes it really easy when manually migrating settings, etc., between machines), but did you know you can also copy/paste whole files using Terminal:

On the first Mac:

cat my-file.txt | pbcopy

On the second Mac:

pbpaste > my-file.txt

Piping to pbcopy is something you’ll likely find useful in general.

(You can also drag/drop files to Finder.)

#macOS #tip #terminal

in reply to Aral Balkan

The `defaults` tool can also be useful for setting, deleting, and in combination with pbpaste/pbcopy transfer settings.
in reply to Aral Balkan

I frequently make use of this facility between my Mac and my phone. Feels magical.
in reply to Aral Balkan

Yeah, any other system drives me crazy with the lack of real pbcopy, and nothing like universal control.
in reply to Digital Mark λ ☕️ 🕹 🙄

@mdhughes See xclip/xsel for X-based Linux and wl-clipboard for Wayland. Synergy worked well cross-platform as a Universal Control alternative but doesn’t work with Wayland.
in reply to Aral Balkan

I’d love to use it, but on my work Mac I use a different Apple ID. I can’t even use my iPad for SideCar.
in reply to Aral Balkan

That’s a great tip! I’ve been Mac user forever and didn’t realize you could use pbcopy/pbpaste in this way. ✅