Beginner question - adding lines in .bashrc file

Hi everybody,
how can I add aliases in the .bashrc file?
Or how am I supposed to handle the modification of .bashrc in bluefin (or immutable distros in general) ?
thanks

I do it the same way I did it before, I edit my ~/.bashrc and add what I want.

1 Like

aha! my bad didn’t try it. I was convinced I couldn’t change anything on the image and that all the customization had to be done in distrobox…
thanks @j0rge

1 Like

@Bambiraptor: Your home directory is located under /var/home. The directories /var and /etc are writable, so that you can 1) edit your personal data and personal configuration in /var/home and 2) overshadow system configuration values in /usr with configuration files in /etc. If you don’t configure anything, then the configuration files in /usr will provide default values for your system.

3 Likes

Hi @stego! :raised_hands:
thank you for taking the time to provide those valuable info, seriously!
I would really appreciate if you could give in a few lines practical examples of what you said.
As a beginner it would really help me make more concrete.
Thanks a lot

1 Like

One important file in a Linux system is /etc/hostname. It contains the name of the system. By default, this file is empty (you can check this yourself). The Bluefin image cannot provide a default, because every computer should have a separate (creative) name.

Fortunately, /etc is writable and that is why we, as the administrators of our system, can change the file. We can either do this by editing the file directly, or by using the hostnamectl command:

sudo hostnamectl hostname triceratops

And after that you can verify that the file /etc/hostname is no longer empty and that it contains the content triceratops. When you now run the command

hostname

Then it will also print the new host name.

Another example are the configuration files under /usr/lib/tmpfiles.d. These files configure the automatic deletion of old temporary files. The files below /usr are read-only. If you want to change any of these files, you need to create a new file with the same name in the directory /etc/tmpfiles.d. And that new file will have a higher priority than the file under /usr.

Those two previous examples are relevant for system administration. But if you only want to change something for your personal user, then you are actually completely free to do whatever you want in your home directory, because you have full write access to it.

There is still one thing that you should know: When you use a distrobox container, your home directory will be made available inside that distrobox container (read-write). This means that if you change your .bashrc in your home directory, that .bashrc will be visible in all your distrobox containers.

3 Likes

So valuable @stego thanks a lot for taking the time. Really clear explanation, thank you.

1 Like