I know that pwd
gives the current working directory, hostname
gives the current host and whoami
gives the current user. Is there a single unix command that will give me the output of
whoami@hostname:pwd
so that I can quickly paste the output into an scp
command?
echo $(whoami)@$(hostname):$(pwd)
? Why do you need this? The user for SSH/SCP defaults to the current user, the working dir defaults to the home directory if omitted. At least you needscp file.txt host:
(wherehost
can be a DNS name or alias from~/.ssh/config
)