Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Whenever I want to copy a file from my home directory, I run into the same issue: scp (using openssh-client 1:5.9p1-5ubuntu1, GNU bash, version 4.2.24(1)-release (x86_64-pc-linux-gnu)) won't autocomplete paths preceded by ~ (tilde). This is very simple to verify by typing scp ~/ and pressing Tab twice - No file completions are shown. Even if I specify a unique path prefix such as scp ~/.bash_hist it won't complete. Is this by design, configurable, or a bug?

To clarify, all other parts of the completion work: Host names and paths on remote hosts both complete just fine. Completions of paths with tilde also work with other commands, such as ls.

Could there be some restriction on completing a non-standard ~? Mine points to /home/users/username and is an NFS 3 mount to another host (/home/username is used for speed-critical things like the browser profile). I have not changed $HOME (/home/users/username) or some other craziness.

share|improve this question
3  
on my system scp ~/ followed by two tabs expands ~/ by $HOME and show me all valid candidates for autocompletion. I use bash version 4.1.5. Probably you have a custom completion enabled for scp so ~ isn't examined by your shell anylonger. – user1146332 Sep 6 '12 at 12:16
Question would be nice for autocompleting on the host :) – Bernhard Sep 6 '12 at 12:20
@user1146332 Tested on two Ubuntu 12.04 hosts without any custom completion that I know of, and it gets the same result. Which platform/version are you using? – l0b0 Sep 6 '12 at 16:54
i'm working with debian lenny. – user1146332 Sep 6 '12 at 16:59
1  
@l0b0 oh, I thought he wants to complete the files on remote machine. – warl0ck Sep 6 '12 at 23:58
show 2 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.