logoalt Hacker News

vbezhenar11/21/20242 repliesview on HN

I might be weird, but for me the most obvious way to transfer a small directory is to do

    tar -cz dir | base64
Copy output into clipboard

    base64 -d | tar -xz
Paste from clipboard into input

Works flawlessly to move configs and stuff between servers.

I actually love the blend between terminal and GUI. For this example I'm using CLI tools to produce text and I'm using GUI to scroll, select and copy&paste the text between two terminal tabs. I wish developers put more emphasis on empowering terminal with GUI capabilities.


Replies

Towaway6911/21/2024

On Mac you can use pbcopy to copy something your pasteboard aka clipboard.

So the first command becomes:

   tar -cz dir | base64 | pbcopy
show 1 reply
zoky11/21/2024

Under certain circumstances, like where machines are not directly accessible to each other and you’re only able to connect by Remote Desktop or something, that’s not actually bad way to do that. But for machines that are on the same network, using a weird invocation of tar and nc instead of just using, say, rsync is an odd choice. And for machines connected to each other over the Internet, it’s positively insane.