PATH problem

For the sake of not going insane and not buggering a load of needed system stuff, I have created a dir /mybin. (This is a Debian system.)

I have then edited the /etc/profile and /etc/login.defs files and added :/mybin to all of the path variables. I have the file /mybin/mtp for testing which has a correct python hashbang.

This almost works perfectly, however from my home dir /home/Bill, this happens:

Bill# mtp   -   output perfect

Bill# sudo su
    # mtp   -   output perfect

Bill# sudo mtp   -   command not found

So where the blinking bloomery else do I have to modify the path variables?

Thanks.

In login.defs there is a variable 'env_supath' for the superuser path setting, and a 'env_path' variable for everybody else.

Did you modify both of these? If so, I agree that it should be working.

Post the output of:

echo $PATH

after 'command not found'.

Most Unix and Linux systems have a /usr/local directory, which contains bin, sbin, etc and man directories, into which you can add your own programs and associated configuration files and man pages, without worry about being overwritten by updates to the OS.

On my Ubuntu system these are also included in the ENV_PATH and ENV_SUPATH variables mentioned in post 2.

I understand that a newcomer to Linux may not be aware of the significance of this directory, causing them to re-invent the wheel, but unless you have a very good reason for using /mybin I would urge you to move everything into /usr/local/bin .

Andrew