It’s a common task: “Please, add my public ssh key to that host”.
And I usually get the key, copied it to buffer, ssh to the remote host, cd .ssh and finally I do a cat - >> authorized_keys and paste the key.
But you can do it in just one single line:
cat new_key.pub | ssh myRemoteHost "cat >> ~/.ssh/authorized_keys" That’s all!
You may need to rename several files in a folder following a pattern.
Say you have (as I do) a file /tmp/myFile.txt containing a list of unrelated folders with their size, as follows:
I have an old java project, with all files enconded as ISO-8859-1 . It was made back in time where most of our development team worked with Windows (fortunately, those times are over ;-)). Now (almost 10 years later -yep that is a really legacy project-) we’re updating it, mostly in the frontend user interface.
So, when we started working with it we had a mix of old ISO-8859-1 files and new UTF-8.