I use the Tab key a lot when I use the shell (bash).
But I'm getting annoyed that ~
always gets expanded to /home/"user"
. I don't think it's always been like this; is there any way to stop this behaviour?
An example:
cj@zap:~$ ls ~/
- Press Tab
cj@zap:~$ ls /home/cj/
I would like to continue to have ~/
and not end up with /home/cj/
.
Best Answer
Disabling tilde expansion is quick and painless. Open up
~/.bashrc
and insert this:This will override the expand function from
/etc/bash_completion
. I'd recommend commenting on what it does above the function in case you want the expansion back in the future. Changes will take effect in a new instance.