0

Generally when I am copying files from a local instance to a server, I find it difficult to generate the SCP string for the server to copy the files. I need to execute the following three commands whoami, ifconfig & pwd and then copy the outputs of each of them to generate the SCP copy string.

Is there a better way to generate the copy string?

0

The following command works for me.

paste -d'@:' <(whoami;) <(ifconfig | awk -F':' '/inet addr/&&!/127.0.0.1/{split($2,_," ");print _[1]}') <(pwd)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.