[Solved] Missing .bashrc file from /etc/skel/

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
RobertLM78
Level 3
Level 3
Posts: 183
Joined: Sat Apr 28, 2012 4:19 am
Location: US

[Solved] Missing .bashrc file from /etc/skel/

Post by RobertLM78 »

I'm still a complete noob when it comes to bash :shock: :oops: . Anyway, I'm trying to establish some aliases for use in the terminal, and created a .bash_aliases file in my home folder, but I think that the aliases aren't working since the .bashrc is non-existant in the /etc/skel/ folder. Is this a bug in Mint, by design, or simply something that is left for the user to create (the missing .bashrc file, that is) ?
Thanks for reading!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Gateway DX4860, Sapphire Radeon HD 5450, 8 GB RAM, Mint 17.3 64-bit (Rosa), MATE
AMD Ryzen 3-3100, AMD Radeon RX 570, 16 GB RAM, Mint 21 (Vanessa), MATE
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: Missing .bashrc file from /etc/skel/

Post by xenopeek »

There is no default .bashrc. So you won't find a .bashrc in /etc/skel (where the default preferences files are kept, to be copied to a new user's home folder when you create said user). You can create a .bashrc in your home folder, and as you can see in your .profile file it will be loaded from there upon login. If you make changes to the .bashrc file or the .bash_aliases, you will have to load those files manually (with the dot command, so ". .bashrc") to load them in your terminal session or just logout and login.

If you want to create the .bashrc, put the following in it at least:

Code: Select all

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
You can of course also put the alias commands directly in your .bashrc file, as the above does nothing else but load the .bash_aliases file and continue loading bash settings from there (not limited to aliases). Perhaps also this post will help: http://stefaanlippens.net/bashrc_and_others. Sheds some lights on what file does what.
Image
User avatar
RobertLM78
Level 3
Level 3
Posts: 183
Joined: Sat Apr 28, 2012 4:19 am
Location: US

Re: Missing .bashrc file from /etc/skel/

Post by RobertLM78 »

Awesome! Thank you Vincent, you've given me some food for thought, and now I know why there wasn't a .bashrc file as well :D. Looks like I have some reading to do, thanks for the link, too :mrgreen: !
Gateway DX4860, Sapphire Radeon HD 5450, 8 GB RAM, Mint 17.3 64-bit (Rosa), MATE
AMD Ryzen 3-3100, AMD Radeon RX 570, 16 GB RAM, Mint 21 (Vanessa), MATE
Locked

Return to “Scripts & Bash”