The difference between .bashrc, .bash_profile, .profile, and .bash_login (login vs non login shells)

preview_player
Показать описание
This video is part of my Bash Course for Complete Beginners. Perfect for those who want to get started with Linux shell scripting.

You can find resources and other information for this video at the Full Stack Foundations link below:

-------------------------------------------------------------------------------------

Connect with me:

-------------------------------------------------------------------------------------

Timestamps:

0:00 Intro
0:52 What is a "Login shell"?
4:44 Login process demonstration
6:35 What is a "Non-Login Shell"?
9:27 Setting your system defaults
Рекомендации по теме
Комментарии
Автор

Table of Contents
0:52 What is a "Login shell"?
4:44 Login process demonstration
6:35 What is a "Non-Login Shell"?
9:27 Setting your system defaults

zachgoll
Автор

Great clarity of thought and well explained.

girishmanwani
Автор

seriously, best explanation I have heard about this. Wish you had explained MAC a bit better, as in what the settings SHOULD be. I loved your slides first to show files, then very detailed use of what is needed. Thank you.

lisasievers
Автор

You can put aliases in your rc, I have about 40.
You can also make a file ~/.bash_aliases and do it that way if you want to be safe... Or you can put everything in your root and have everything there in one place.
My rc for all shells are long, and if anyone is wondering, rc means run command I believe.
But always have a backup of the original, there is usually one in the skel dir, but I do it anyway.
I also set $PATH in my rc and or append it, or just export it. It depends on what you are comfortable doing.
Bash is a very powerful tool, it's a programming language by itself, and it's based on the first real shell, so, you can run it on windows if you know the deep shell commands and just be sure to double check every long option and flag and etc EVERY time before you hit enter. Because that shell is talking directly to the hardware almost. One wrong syntax and it's game over sometimes.

aronwomack
Автор

I understood what runs during login and non-login shell but what is the difference between login and non-login shell? when to use one over the other? when I connect via putty is it a login shell or a non-login shell? when I ssh to another host from current one is that non-login? You showed su with --login that I assume invoking login shell but we also do su without mentioning --login .. does that mean that would not be a login shell or it still treats su as login implicitly even if you don't mention --login? Is interactive and non-interactive same as login and non-login?

adonisaseem
Автор

what if there is a contradiction between the /etc/bash.bashrc and the ~/.bashrc files? Does the .bashrc overwrite the first file? and if so, whats the need for the /etc/bash.bashrc?

LifeUnscripted
Автор

Hi,
excellent video, you explained everything. Just one question..
at minute 7:03 you said that was the code of auto-completion (with tab key) but i see that those lines are commented (line starts with '#')
that would mean that is other file that setups the auto-completion, or am I wrong ?

ivandres
Автор

Hi
I am using Linux mint 19.3
My terminal and menubar is not showing
Do u have any solution

haroonstutorials
Автор

But why these many files? any reasoning behind them?

KASANITEJ
Автор

hi, my terminal is gone. all I can see is :
"Last login: Tue May 5 08:29:01 on ttys007
[İşlem tamamlandı]". (it means "job completed")


I was making sth about bash profile and trying to save sth, I think i did sth wrong and terminal is not responding now, whatever I push. how can I fix it. even apple doesnt know, I called them. how can I fix it.


on the top, its written that " Terminal -- java_home --bash 80X24" and " Terminal -- bash --bash 80X24 " its trying to command sth. its blinking for like 2 minutes and then stops. it turns to just " Terminal 80X24 "


thank you very much..

izzettin