LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 10-31-2005, 04:31 PM   #1
wardjame
LQ Newbie
 
Registered: Oct 2005
Posts: 10

Rep: Reputation: 0
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.
 
Old 10-31-2005, 05:39 PM   #2
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
I tried many Linux distros and i always found strange issues. Then i installed Slackware.
 
Old 10-31-2005, 06:01 PM   #3
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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.

Peace,
JimBass
 
Old 10-31-2005, 06:49 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You may want to check the PATH for root. It looks like /usr/local/sbin is not in the path.
 
Old 11-01-2005, 03:33 PM   #5
wardjame
LQ Newbie
 
Registered: Oct 2005
Posts: 10

Original Poster
Rep: Reputation: 0
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.
 
Old 11-10-2005, 06:03 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 11-10-2005, 07:32 AM   #7
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
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.
 
Old 11-10-2005, 09:25 AM   #8
wardjame
LQ Newbie
 
Registered: Oct 2005
Posts: 10

Original Poster
Rep: Reputation: 0
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
 
  


Reply



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
Strange behaviour Anmol SUSE / openSUSE 2 10-27-2005 11:05 PM
strange xrandr behaviour? devUrandom Linux - Software 1 03-15-2005 10:27 AM
SCP strange behaviour sbalasuriya Linux - Software 0 09-21-2004 10:50 AM
Strange Mandrake 9.2 behaviour Erik Kuhlmann Linux - Security 3 03-26-2004 01:18 AM
Strange Behaviour mikeyt_3333 Linux - General 4 08-06-2001 03:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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