Announcement

Collapse
No announcement yet.

[SOLVED] bash filename completion not working

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] bash filename completion not working

    Before I swtiched to kubuntu, the flavor of Linux I was using had the following feature:

    On the command line, I'd type a command and then I'd start typing the file I want the command to do something with. Before I was done typing the filename, I'd hit tab and magically the rest of the file name would appear.

    Unfortunately with Kubuntu, I've discovered that tab completion only works with the first word on the command line. It seems unable to find filenames for the command to operate on.

    Is there a way to fix this?

    I suspect it has something to do with /etc/bash_completion However I can't figure out what and where to put anything to make it work correctly.

    Can someone please help?

    Thanks in advance.

    #2
    Re: bash filename completion not working

    I thought bash-completion was included by default. If you open Konsole and issue
    Code:
    sudo apt-get update && sudo apt-get install bash-completion
    what does it say?

    Comment


      #3
      Re: bash filename completion not working

      It does work. Are you possibly, forgetting the cASe SEnsaTiviTY of the file you are trying to access?
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        Re: bash filename completion not working

        It will also only complete up until the point where the characters are no longer unique. Check to see if you have a file where the first part of the name is the same as another.

        Comment


          #5
          Re: bash filename completion not working

          I figured out the problem. I had to comment out the lines
          Code:
          if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
           . /etc/bash_completion
          fi
          in /etc/bash.bashrc and in $HOME/.bashrc

          Now magically tab completion works as expected.

          Who would have thought enabling "smart" completion would actually break it.


          [Edit: Am I supposed to mark this thread "resolved" or something? If so how?]

          Comment


            #6
            Re: bash filename completion not working

            Return to your original (first) post in this thread, click the modify button and add [SOLVED] to the subject.
            Windows no longer obstructs my view.
            Using Kubuntu Linux since March 23, 2007.
            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

            Comment

            Working...
            X