Linux - NewbieThis 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!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi All,
I recently got a copy of Fedora Core 4 running LAMP with SSL thanks to the wonderful tutorial at linuxhowto.
Things were going fine until recently. For some reason my root user is behaving a little differently. I first noticed the problem when I tried to use the shutdown command as root and it came back with command not found.
I noticed another oddity when I attempted to start proftpd, I navigated to /usr/local/sbin and type proftpd and also got command not found. ls showed that proftpd was clearly in the current directory.
The final oddity came when I typed pro and hit tab to try to let it autocomplete to make sure a typo was not to blame. The results where as follows:
procmail profiles proftpd protoize prove
Pressing tab used to just autocomplet the current directory, all the files other than proftpd exist elsewhere on my system.
Runing proftpd seems to work fine now but the tab oddness continues. I assume I did something to change the way the shell is behaving. Any thoughts on what I may have done and how I could undo it?
You are making errors in bash usage. If the location of the proftp binary is /usr/local/sbin/proftpd, you can't cd to /usr/local/sbin and then manually run proftpd by typing proftpd. You need to preface it with ./ So if you are in /usr/local/sbin/ the command to launch proftpd from there is
Code:
./proftpd
From anywhere else, all you need is the full patch, but launching executable files from the directory they are contained in requires the ./ before the file name.
The tab problem is that tab can only autocomplete for you to a non-unique digit. You say you have
Quote:
procmail profiles proftpd protoize prove
all in the same directory, How is tab supposed to know with only pro typed in wether you want procmail or proftpd? You have to get to unique digits. If you typed prof then hit tab, the shell would see that it can't be procmail, profiles,protoize, or prove, and it would fill in the rest of the proftpd command for you.
Originally posted by JimBass
The tab problem is that tab can only autocomplete for you to a non-unique digit. You say you have
all in the same directory, How is tab supposed to know with only pro typed in wether you want procmail or proftpd? You have to get to unique digits. If you typed prof then hit tab, the shell would see that it can't be procmail, profiles,protoize, or prove, and it would fill in the rest of the proftpd command for you.
Peace,
JimBass [/B]
Hi Jim,
Thanks for the info about using ./ before commands in the current directory. I should have realized that was my problem.
The tab thing is still a little odd though. I actually say specifically that they are NOT in the the same directory and that is what I find odd. I have never seen this behaviour before where tab autocompletes to files outside the current directory and I have to say I don't much like it. Any idea how to make it stop doing that? From the root dir "/" if I type pro and hit tab I get the exact same list.
There are different types of autocompletion, depending on the context of what you are doing. If you type in "pro[tab]" for example, you will get a list of commands that start with "pro". If you type "./pro", then only commands in your current directory will be listed. If you type "ls pro[tab]", then files beginning with "pro" in the current directory are listed. There may be package on your system that adds even more context and capabilities. Such as arguments to "modprobe". Suppose you need to load in the "ehci-usb" module but only remember the first 2 letters. Entering "modprobe eh[tab]" will help you find it.
Originally posted by wardjame Hi Jim,
Thanks for the info about using ./ before commands in the current directory. I should have realized that was my problem.
The tab thing is still a little odd though. I actually say specifically that they are NOT in the the same directory and that is what I find odd. I have never seen this behaviour before where tab autocompletes to files outside the current directory and I have to say I don't much like it. Any idea how to make it stop doing that? From the root dir "/" if I type pro and hit tab I get the exact same list.
if you type pro [tab] it will autocomplete anything that meets those criteria from your PATH (a list of directories your system looks in for commands) echo $PATH will show yours (root normally has different paths to a user by default). AFAIK this has always been the default way in fedora.
if you type ./pro[tab] it will autocomplete in that directory.
Thank you,
That was very helpful. After reading your post and a little experimenting I realized why things looked so different to me.
The bahaviour changed when I had finished setting up my box and added a normal user. When I "su" from that user the $PATH is not the same as it is when I was logging in as root during installation. Hence the bahaviour seemed different to me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.