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! |
| 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-31-2005, 04:31 PM
|
#1
|
|
LQ Newbie
Registered: Oct 2005
Posts: 10
Rep:
|
Strange root behaviour
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?
Thanks in advance.
|
|
|
|
10-31-2005, 05:39 PM
|
#2
|
|
Senior Member
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,179
Rep:
|
I tried many Linux distros and i always found strange issues. Then i installed Slackware.
|
|
|
|
10-31-2005, 06:01 PM
|
#3
|
|
Senior Member
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100
Rep:
|
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 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.
Peace,
JimBass
|
|
|
|
10-31-2005, 06:49 PM
|
#4
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
You may want to check the PATH for root. It looks like /usr/local/sbin is not in the path.
|
|
|
|
11-01-2005, 03:33 PM
|
#5
|
|
LQ Newbie
Registered: Oct 2005
Posts: 10
Original Poster
Rep:
|
Quote:
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.
|
|
|
|
11-10-2005, 06:03 AM
|
#6
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
|
11-10-2005, 07:32 AM
|
#7
|
|
Senior Member
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522
Rep:
|
Quote:
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.
|
|
|
|
11-10-2005, 09:25 AM
|
#8
|
|
LQ Newbie
Registered: Oct 2005
Posts: 10
Original Poster
Rep:
|
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.
Thanks again for all the help.
James
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:00 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|