0

So in my "the linux command line" book, it says this

"The PATH variable is often (but not always, depending on the distribution) set by the /etc/profile startup file and with this code:

PATH=$PATH:$HOME/bin"

when i open the etc/profile to see if it's there, it's not....but surely this bit of code has to be in the system? In the environment, there is the path variable, but it's not the same, there are several paths seperated by colons.

Where is this bit of code on my system, if at all?

1 Answers1

0

That particular piece of code is located in ~/.profile, which by default looks like this:

$ cat /etc/skel/.profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi
Gunnar Hjalmarsson
  • 33,540
  • 3
  • 64
  • 94