.bashrc not loading when logging in

  • Code
    user@omv:~$ ls -l .bashrc
    -rw-r--r-- 1 user users 82 Sep 11 10:20 .bashrc
    user@omv:~$ cat .bashrc
    #  Aliases
    #alias ls='/bin/ls -FCs '
    alias s='. ~/.bashrc'
    alias l='/bin/ls -l '

    I'm expecting the above .bashrc to be loaded when I log in. Unfortunately, that's not happening. I can load it manually but I'd prefer not to have to do that. Any ideas on what might be wrong?

    • Offizieller Beitrag

    does your ~/.profile contain something like this?


    Code
    # ~/.profile: executed by Bourne-compatible login shells.
    
    
    if [ "$BASH" ]; then
      if [ -f ~/.bashrc ]; then
        . ~/.bashrc
      fi
    fi


    https://askubuntu.com/question…when-opening-new-terminal

  • I just added it but it didn't make a difference.


    I'm using stock OMV and I'm not a programmer or admin but I have been using Linux for a good while. Can't figure out how to get this to work ....


    Any help is most appreciated.

  • Put your aliases in your .profile file instead of .bashrc.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • Then something is seriously wrong with how you are doing this or you are not logging in as the same user you are modifying the environment for.


    Also, you have to save the .profile file and log out and then log in again. Are you doing that?

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

    Einmal editiert, zuletzt von gderf ()

  • Then something is seriously wrong with how you are doing this or you are not logging in as the same user you are modifying the environment for.


    Also, you have to save the .profile file and log out and then log in again. Are you doing that?

    I've set up OMV with default settings. All users exhibit this behavior.


    I certainly did write, log out, and log back in.


    I've been a Unix/Linux user for 30+ years. Admittedly, I am not an admin but I am pretty good moving around in the shell. I'm also pretty good at searching and finding things and this has me stumped.


    *EDIT* Did more searching. FYI to anyone else, the file to edit is .bash_profile. Not .bashrc or .profile.


    Thanks for the help.

  • I have a highly populated with aliases and working .profile here.


    I do not have a .bash_profile file at all.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • I have a highly populated with aliases and working .profile here.


    I do not have a .bash_profile file at all.

    Just reporting. I can't explain it. All I can say is that it is working now and that I am running stock so I can't see why your .profile works but mine does not.

  • /etc/skel - These files are copied into the user's /home directory when a new user is created.


    My OMV 4.x box started life as OMV 2.x, was upgraded to OMV 3.x and then to OMV 4.x. Here's what's in mine:


    -rw-r--r-- 1 root root 220 Sep 25 2014 .bash_logout
    -rw-r--r-- 1 root root 3526 May 15 2017 .bashrc
    -rw-r--r-- 1 root root 675 Sep 25 2014 .profile

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • My /etc/skel/ directory is empty.

    No idea why that is unless there was a change in Debian and from the dates on mine they might be left over from the older versions of OMV.


    You did take into account that those are hidden files when you looked in the directory?

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • Wow. I am a dummy. It's not empty:


    root@omv:~# ls -la /etc/skel/

  • Those are the files that are generally copied into a new user's home directory when the user is created. But it is possible to create users without doing this. If you added the user within OMV, perhaps it is doing something unusual.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!