Score:0

Linux novice with tab completion question unrar

ru flag
MDS

I have bash-completion installed.

When attempting to unrar a rar to a destination directory with spaces in it, tab completion will add the \ and a space but will not tab complete past that. For example:

unrar e /mnt/STORAGE/test.rar /mnt/TVSHOWSTOO/What\ 

It will not tab complete past the space after What\ even though there are 2 possibilities. I have to type the complete path at this point.

I have been googling through forums for a couple hours now and just can't seem to find anything to get me pointed in the right direction. I plead my ignorance on this one. I am admittedly a Linux novice and don't even know where to start if it involves editing the .bashrc file. Any help would be greatly appreciated.

Score:0
ng flag

"even though there are 2 possibilities"

Different shells behave differently, but the default bash shell in Ubuntu will not tab complete all the way to the end of the path if there are multiple paths that match what you've typed so far. It will only complete what is unique to what you've typed so far and stop when there are multiple files that diverge at that point.

If you continue typing until only one single file matches what you've typed so far, you can use tab completion to the end of the path.

MDS avatar
ru flag
MDS
That's where I'm fouled up because there are 2 possibilities for /mnt/TVSHOWSTOO/Wh What If...?/ and What We Do In The Shadows/. If I tab complete on /mnt/TVSHOWSTOO/Wha it autocompletes to /mnt/TVSHOWSTOO/What\ with a space after the backslash. If I try to autocomplete with /mnt/TVSHOWSTOO/What\ W it will not autocomplete. I would expect adding the W after /What\ would be interpreted as the What We Do In The Shadows/ and not What If...?/
Nmath avatar
ng flag
Without formatting it's extremely difficult to parse your comment. Please use the [edit](https://askubuntu.com/posts/1363031/edit) link under your post to add more details. This type of info cannot be effectively communicated as a comment. Be sure to use `monospace` formatting so that we can distinguish the paths from the surrounding text. Since your path includes spaces it's probably easier to just put the entire path in quotes. Spaces are not intrinsically supported in POSIX / UNIX so it's generally best if you do not use spaces in your filenames.
Nmath avatar
ng flag
I cannot reproduce that behavior you are describing. I created three folders: `what if it`, `what if they`, and `what we do` and tab autocompletes each. Which shell are you using? What is the output of `echo $SHELL`?
MDS avatar
ru flag
MDS
/bin/bash Here's a link to a screenshot https://photos.app.goo.gl/tep2EePusoTrDrdYA The first line is me just trying to show what the matches are in that directory. As soon as I add a and tab complete, it finishes out to What\ and will not table complete after that no matter what.
MDS avatar
ru flag
MDS
I should add this seems to be only happening with unrar.
muru avatar
us flag
@MDS do you have the `bash-completion` package installed?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.