Why Doesn't Tab Autocomplete to File?

Why Doesn't Tab Autocomplete to File?

I have the file analysis6_1.py So I entered in terminal python ./ and used tab autocomplete. Since I wanted to execute analysis6_1.py I entered a and pressed tab again. However now analysis6_1 is no longer an option and if I enter the file python says that the file does not exist.

I have no clue why that could be. Running UbuntuStudio 14.04 and Python2 with Thunar ((If that helps)). Also see image:

2

1 Answer

Look at the spacing of the second column after python ./. Those files (except for "analysis3.pyo") each have a space at the start of their filename.

You can rename the files with this:

for file in " "*; do 
  mv "$file" "${file#' '}"
done

Or if you need to keep the filenames the way they are, you can use autocomplete like so:

$ python " a

Press Tab

$ python " analysis

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.