Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, 'echo $PATH' return : usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games I'm using zsh and have no PATH definition in my .zsh* files in my home directory. Under zsh the default configuration should be (if ...
  1. #1
    Linux Newbie
    Join Date
    Dec 2008
    Location
    Luxembourg
    Posts
    130

    system default $PATH : where it is defined ?

    Hello,

    'echo $PATH' return :
    usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games

    I'm using zsh and have no PATH definition in my .zsh* files in my home directory.
    Under zsh the default configuration should be (if I'm correct) under /etc/zsh.

    'cat /ets/zsh/zshenv' return :

    # /etc/zsh/zshenv: system-wide .zshenv file for zsh(1).
    (...)
    if [[ -z "$PATH" || "$PATH" == "/bin:/usr/bin" ]]
    then
    export PATH="/usr/local/bin:/usr/bin:/bin:/sbin:/usr/local/sbin"
    fi

    From where come the '/usr/games' in PATH ??
    This definition does not match the default one in /etc/zsh/zshenv, and again I have no PATH definition in my home .zsh* files.

    So where is the default PATH defined ?

    Bye,
    Bruno

  2. #2
    Linux Guru
    Join Date
    May 2011
    Posts
    1,813
    Try this command to search files in your home path and in /etc for any files containing "/usr/games":

    Code:
    find /etc/ ~ -maxdepth 2 -type f -exec grep -H --color /usr/games {} \;
    If any are found, they may be profile scripts that your shell is sourcing when you log in.

  3. #3
    Linux Newbie
    Join Date
    Dec 2008
    Location
    Luxembourg
    Posts
    130

    SOLVED : system default $PATH : where it is defined ?

    Thanks Atreyu.
    Your command helped me to find the file.

    Under Debian the file is /etc/login.defs.
    It contains default PATH for (apparently) all logins.
    So I modified this file.

    Note : I also add to specify option 'UseLogin yes' in sshd_config as I log to this Debian server via ssh.

    Bye,
    Bruno

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •