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?

1 Answer 1


The following command works for me.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .