Hi i want to run a linux command that automates a scp with the location of origin that varies and the destination location that remains contant. For example -
scp 123.txt [email protected]:~/
the destination ([email protected]) will always be the same, however the file name (123.txt) will always be different.
I would like to run this entire scp command (scp 123.txt [email protected]:~/) without typing the destination location
note: ([email protected] in this case might seem short however i have a much more complex destination that is cumbersome to type out every single time)
Try using a function instead of an alias. Put the following function in your .bashrc file.
function do-scp() {
scp "$1" [email protected]:~/
}
And thus you invoke it as follows:
do-scp 123.txt