maxprkr
maxprkr

Reputation: 1

where the $PATH is created in ubuntu (16.04) and how to change it

when checking my $PATH on ubuntu (16.04) I get a long list of directories, few of which even do not exist in my file system, and some of them I just don't need:

echo $PATH

.../usr/games:/usr/local/games:/snap/bin

where they are created and how can I remove them? I wnant to control the creation of the $PATH, rather than correct it later by the tricks described in https://unix.stackexchange.com/questions/108873/removing-a-directory-from-path

Upvotes: 0

Views: 2518

Answers (3)

randy
randy

Reputation: 1

I found the answer to your question today. The path you want to edit is in /etc/environment.

Upvotes: 0

sudr minz
sudr minz

Reputation: 91

Some typical places where $PATH can be set when starting up a bash shell on Ubuntu include:

  • /etc/profile
  • ~/.profile
  • ~/.bashrc

where ~ represents your home directory.

Also look at any scripts called by those scripts.

There may be other things that get called when starting up a bash shell, depending on various conditions. For details, take a look at the INVOCATION section from the command:

    $ man bash

Upvotes: 1

FedeMITIC
FedeMITIC

Reputation: 93

See this answer from askubuntu.com to edit the path either using a text editor or the command line.

Upvotes: 0

Related Questions