Why doesnt tab autocomplete to file?

I have the file analysis6_1.pySo 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:Screenshot of Terminal

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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like