Find the answer to your Linux question:
Results 1 to 3 of 3
Hi. Pls is there a way to make commands in my /sbin to work in my bash permanently. like using the service and chkconfig commands, i have to use /sbin/service ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2005
    Posts
    41

    making /sbin commands work permanently in bash


    Hi. Pls is there a way to make commands in my /sbin to work in my bash permanently.
    like using the service and chkconfig commands, i have to use /sbin/service instead of just service

  2. #2
    Just Joined!
    Join Date
    Sep 2005
    Posts
    6
    /etc/bashrc

    That is the configuration file that is mostly common, but it depends on your distribution you have. Do a search on the main site of the distribution you are using and see how they handle the /etc/bashrc file or if they even use a bashrc file. If they don't use bashrc do a search in google for your distro and alias and see if anything comes up about setting a permenant alias and you will see where you can set the environment variables. I say to use alias because I think it might be easier to find what your looking for with those search parameters.

    I know suse 9.3 has a /etc/bash.bashrc file that is usually changed when the system is updated so they tell you to use /etc/bash.bashrc.local. That files doesn't exist by default so you have to create it and put what you want in it.

  3. #3
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    Quote Originally Posted by man bash
    When bash is invoked as an interactive login shell, or as a non-interactive shell
    with the --login option, it first reads and executes commands from the file
    /etc/profile, if that file exists. After reading that file, it looks for
    ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and exe-
    cutes commands from the first one that exists and is readable. The --noprofile
    option may be used when the shell is started to inhibit this behavior.
    I put the following in my ~/.bash_profile:

    Code:
    export PATH="${PATH}:/sbin:/usr/sbin"
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

Posting Permissions

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