How do I tab autocomplete for files with spaces in it?
1 Answer
Yes if you escape the space first,
e.g ls file\ abc<tab>
Otherwise the second abc
here would be considered as another parameter, completion won't work then.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityYes if you escape the space first,
e.g ls file\ abc<tab>
Otherwise the second abc
here would be considered as another parameter, completion won't work then.
echo $0
. Are you looking to do something likels file na<tab>
where the file name isfile name
? If so, your shell will look for a file starting with the lettersna
. You'd need to escape the space:ls file\ na<tab>
.bash
by default. If it's not working on your platform, we may need more info.