Running a script on login

Discussion in 'Command Line' started by Kryyll, Apr 25, 2014.

  1. Kryyll

    Kryyll Active Member

    Messages:
    111
    Likes Received:
    38
    Trophy Points:
    28
    I have been playing around with making my CLI have colors and things. However, they do not show up when I log in. That being said, there are different colors for the root user and the regular users. I have a ~/.bashrc file for both root and normal users but they don't run on login. I would have to run 'source ~/.bashrc' to have the colored text appear. I believe bash is suppose to check that file on login. How do I get this to run on login? Any ideas?

    DevynCJohnson likes this.
  2. rstanley

    rstanley Member

    Messages:
    56
    Likes Received:
    38
    Trophy Points:
    18
    Best Answer
    You need to place the commands into .profile, or .bash_profile, depending on the Distro. Do a 'ls -la'. If you only have one of these two files, place them in that file, otherwise see if one file calls the other, or check the documentation for the specific Distro you are using.
    DevynCJohnson and Kryyll like this.
  3. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,214
    Likes Received:
    1,019
    Trophy Points:
    113
    I have used rstanley's idea before in the past with success.
    Kryyll likes this.
  4. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,209
    Likes Received:
    406
    Trophy Points:
    83
    Putting the commands in .bashrc works for me on Arch. .bash_profile for other distros.
  5. Kryyll

    Kryyll Active Member

    Messages:
    111
    Likes Received:
    38
    Trophy Points:
    28
    Well that explains it, I got my info from the arch wikis!

Share This Page