is there way to copy file or folder to remote machine with the same address as current directory where I'm running scp from defining only file's name, eg:

[user@machine current_location]$scp ./file_or_folder remote:$/

1 Answer 1


I assume $/ is what you wish would translate to your current location? You can achieve this with

$ scp ./file_or_folder "remote:$(pwd)"

$( cmd ) is a command substitution. It runs the command (here pwd to print the current directory) and then 'replaces' itself with the command output.


You must log in to answer this question.

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