Find the answer to your Linux question:
Results 1 to 5 of 5
When i ran the command: $PATH, I got something as following: bash: /sbin:/usr/sbin:/usr/local/sbin:/opt/kde3/sbin:/opt/gnome/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin: No such file or directory and i found out that, the directories /usr/lib/mit/bin and /usr/lib/mit/sbin do not ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! beginner's Avatar
    Join Date
    Feb 2006
    Location
    Kiel, Germany
    Posts
    32

    Question a Question on PATH, an environment variable


    When i ran the command: $PATH, I got something as following:

    bash: /sbin:/usr/sbin:/usr/local/sbin:/opt/kde3/sbin:/opt/gnome/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin: No such file or directory

    and i found out that, the directories /usr/lib/mit/bin and /usr/lib/mit/sbin do not exist anymore

    Please help me to remove these from the PATH, and tell me how to add other directories to the PATH.

    Thank you very much

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    First off, to read the value of PATH you should do:
    Code:
    echo $PATH
    not
    Code:
    $PATH
    .
    Second, to change the value of PATH permanently, there are several places where it is set: /etc/profile, ~/.bash_profile, ~/.bashrc, /etc/bash/bashrc, and potentially other places.

  3. #3
    Banned CodeRoot's Avatar
    Join Date
    Sep 2005
    Posts
    567
    It is probably better to find and modify the code where '/usr/lib/mit/bin' and '/usr/lib/mit/sbin' are actually added to the PATH -- but, if for some reason you are not able or you think it would not be wise - place the following lines in your ~/.bashrc file:

    Code:
    PATH=`echo " $PATH " | /usr/bin/sed 's.:. .g' | /usr/bin/sed 's. /usr/lib/mit/bin . .g' | /usr/bin/sed 's. /usr/lib/mit/sbin . .g'`
    PATH=`echo $PATH | /usr/bin/sed 's. .:.g'`
    (It is just a little bit "elaborate", but it is needed to make sure it always works properly no matter what is in the PATH list... )

  4. #4
    Just Joined! beginner's Avatar
    Join Date
    Feb 2006
    Location
    Kiel, Germany
    Posts
    32

    Question Where is my .bash_profile...?

    Yes, I try to find these files: /etc/profile, ~/.bash_profile, ~/.bashrc, /etc/bash/bashrc, but there exists only /etc/profile. The files, /etc/bash_profile, ~/.bashrc, and the folder /etc/bash/, do not exist in my system

    What can i do now? (I am running SuSE 10.0). are there any other folders in SuSE 10.0 where i can find the above missing file and folder?

  5. #5
    Linux User muha's Avatar
    Join Date
    Jan 2006
    Posts
    290
    Quote Originally Posted by beginner
    The files, /etc/bash_profile, ~/.bashrc, and the folder /etc/bash/, do not exist in my system
    The only i do have on my suse 10.0 is ~/.bashrc
    If you want mine go ahead ~>
    Code:
    # Sample .bashrc for SuSE Linux
    # Copyright (c) SuSE GmbH Nuernberg
    
    # There are 3 different types of shells in bash: the login shell, normal shell
    # and interactive shell. Login shells read ~/.profile and interactive shells
    # read ~/.bashrc; in our setup, /etc/profile sources ~/.bashrc - thus all
    # settings made here will also take effect in a login shell.
    #
    # NOTE: It is recommended to make language settings in ~/.profile rather than
    # here, since multilingual X sessions would not work properly if LANG is over-
    # ridden in every subshell.
    
    # This might be helpful for Linux newbies who previously used DOS...
    test -f /etc/profile.dos && . /etc/profile.dos
    
    # Some applications read the EDITOR variable to determine your favourite text
    # editor. So uncomment the line below and enter the editor of your choice :-)
    #export EDITOR=/usr/bin/vim
    #export EDITOR=/usr/bin/mcedit
    
    # For some news readers it makes sense to specify the NEWSSERVER variable here
    #export NEWSSERVER=your.news.server
    
    # If you want to use a Palm device with Linux, uncomment the two lines below.
    # For some (older) Palm Pilots, you might need to set a lower baud rate
    # e.g. 57600 or 38400; lowest is 9600 (very slow!)
    #
    #export PILOTPORT=/dev/pilot
    #export PILOTRATE=115200
    
    test -s ~/.alias && . ~/.alias || true
    
    # My startupaliases
    # lsd is now the command for list only directories
    alias lsd="ls -la | grep ^d"
    
    # never remove without prompting, to remove without prompting now use rm -f (force option)
    alias rm="rm -i"
    
    # start pico with options -e -k, resp. for tab-completion and cut until end of line.
    alias pico="pico -e -k"
    
    # This alias creates a new command called "today" that will display today's date with nice formatting.
    alias today='date +"%A, %B %-d, %Y"'
    
    # user added binds to special keys:
    # <Alt>+w to show all possible completions for a command from history.
    bind '"\M-w"':"\"\C-k\C-ahistory | grep '^ *[0-9]* *\C-e.'\C-m\""
    
    # the prompt for the user is also set in /etc/bash.bashrc.local
    You can delete the part from 'My startupaliases' since i put that in, although if you look at it, it adds some nice functionality.
    Now what? You have Linux installed and running. The GUI is working fine, but you are getting tired of changing your desktop themes. You keep seeing this "terminal" thing. Don't worry, they'll show you what to do @
    <~ http://www.linuxcommand.org/ ~>

Posting Permissions

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