0

This question already has an answer here:

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?

marked as duplicate by Panther, Thomas Ward, Ravan, Pilot6, user364819 Dec 15 '15 at 12:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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
  • Not always. On my system it is in ~/.bashrc. – dadexix86 Dec 14 '15 at 20:11
  • @dadexix86: Then you don't have Ubuntu, do you? – Gunnar Hjalmarsson Dec 14 '15 at 20:14
  • Sure I do! 15.10 w/ Unity :) In my .profile there is only something for emacs. – dadexix86 Dec 14 '15 at 20:15
  • @dadexix86: That's odd indeed. Please see my edited answer. – Gunnar Hjalmarsson Dec 14 '15 at 20:26
  • Indeed I carry on my home since some release, so it might be that my .profile is empty because it was so some times ago. Do you know when did it change in Ubuntu? – dadexix86 Dec 14 '15 at 20:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.