Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-17-2008, 05:59 PM   #1
LQ Newbie
Registered: Dec 2008
Location: (near) Philadelphia, PA
Distribution: Ubuntu currently
Posts: 9

Rep: Reputation: 0
Still getting to know Bash, question about tab-completion

Hey guys.

Preface: Ubuntu 8.10: I've been doing a lot of tinkering with various software lately, but I haven't (deliberately or directly) made modifications to any system files except /etc/fstab

I'm currently having an issue with operating in bash via either PuTTY or xterm. I'm fully willing to believe that I caused the change by doing something I didn't mean to, but I really am unclear as to what I did or how to fix it.

Here's the problem: commands that I try to execute in Bash seem to be looking at a different directory than my working directory. Take a look at this sample output:

andrew@toumar:~$ pwd
andrew@toumar:~$ ls
Templates <-- !
andrew@toumar:~$ Thunar <-- ?
As you can see, I am in a directory with one item that starts with a capital T, which is Templates, but when I type a 'T' and hit tab, I get Thunar. I also can't seem to execute with ./ when I'm in that directory (although I could be mistaken about ./ as the way to execute .sh files).

I'm pretty lost about what I need to do, because I'm not clear on how I got myself here. Any advice would be greatly appreciated, and I can gladly provide more information if it might be useful.

Old 12-17-2008, 06:16 PM   #2
Registered: Jun 2008
Location: Ottawa, Ontario, Canada
Distribution: debian, dsl-n
Posts: 55

Rep: Reputation: 15
This is because bash is looking for an executable file in it's path. You need to tell bash what you want to do to a regular file before hitting tab. For example, to edit Templates you would type gedit T then hit tab. To change directory you would do cd T then tab etc.

To execute a file in the current directory you need to do the ./"command". The file is probably not set to executable. Do a chmod 755 then try again.
Old 12-17-2008, 06:18 PM   #3
Senior Member
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,153
Blog Entries: 3

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
when you type T then hit tab the bash looks for a bin execute file hence /bin/bash and Thunar is a executable file in any file named bin. thunar so if you have a litle file and turn it to a executable chmod -x-a your file or open with a gui and set permission to executable. sence it is not in a bin folder you will have to type ./your file name. or sh your file name.if it was in bin or /usr/bin or /usr/local/bin or any folder you name bin the if the file is in a folder owned by root you will need to have SU privaledges to execute it and the bash will not see it. but if the folder is set to -x-a all users then you can type it and run it. in a terminal. hope this helped please go to unix comands and
Old 12-17-2008, 06:24 PM   #4
LQ Newbie
Registered: Dec 2008
Location: (near) Philadelphia, PA
Distribution: Ubuntu currently
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for the help! I still need to learn my way around bash
Old 12-17-2008, 10:16 PM   #5
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,874
Blog Entries: 27

Rep: Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163

Look at my sig!
Old 12-19-2008, 08:51 AM   #6
john test
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Rep: Reputation: 35
The ground has been pretty well covered, but the thing is:
"Thunar" is an executable.
"Templates" is a Sub-Directory containing templates for your use.
$ T (tab) gets the executable, not the Directory.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash auto-completion question PatrickNew Linux - General 3 05-02-2008 11:31 PM
Tab-completion kzr_merchant Programming 2 12-17-2007 04:00 PM
Tab-Completion in bash script Buto Linux - General 1 12-04-2007 06:50 PM
filetype aware tab completion bash gearoid_murphy Linux - General 2 10-29-2006 06:52 AM
question about bash completion Guest1234 Linux - Software 4 02-25-2006 04:09 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:53 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration