I recently switched from OSX to Linux for my personal use. I have a home media server running headless Ubuntu, and now a laptop running Mint. My habit is to move things to the server with scp. In the past, on OSX, when I typed to copy target I would painstakingly type each character of the path, because if out of habit I tried to tab complete the machine would get all cranky and I'd have to start over again.However, I just set up the ssh keys of my new computer and was in the process of scping a file from laptop to server, when I accidentally hit tab, and much to my surprise, it completed the path correctly! Is this normal behavior? Why did it not work on term2 on OSX? Note, I did have an open connection to the the server in another terminal window.
scp aware of target machine path?
bash;command line;autocomplete;scp
This is your shells command completion in action: it knows that when the current command-line starts with scp, in certain contexts it needs to connect to the target system (if it can) to complete paths there. This can be done transparently because youve loaded your key.Youll see this typically implemented in /usr/share/bash-completion/completions/scp (if youre using Bash), or /usr/share/zsh/functions/Completion/Unix/_ssh (for Zsh).