0

Scouring the internet about the difference between a login shell and a non-login shell, it turns out that the ultimate difference is merely the files that are being sourced. A login shell sources some files, and a non-login shell sources some different files.

So that's the definition. But then, so what? What is the main point or idea why there is a login shell and why there is a non-login shell? What can you do in a login shell that you cannot do in a non-login shell and vice versa?

The way I see it is that the purpose of a login shell is to let users customize their shell environment, while the purpose of a non-login shell is to have like a "default" uncustomized shell environment. Pretty much like the idea of having "user preference". Is this correct?

1 Answer 1

-3

The idea of login shell and non-login shell is like using a desktop GUI with with a user account and using it with a Guest account.

In a desktop GUI, each user may have a different wall paper, shortcut icons, settings, etc. from each other user. Each user sees their own desktop environment when they login. This corresponds to a login shell in CLI.

A non login shell is like a Guest account in a desktop GUI. When you use a Guest account, you see a default, uncustomized desktop environment. When you use a non-login shell, you see a default, uncustomized shell environment.

So yes, the idea basically to allow having user preferences.

1
  • 3
    How comes this answered in less than 1 minute after it was asked, and already accepted? While, also, being fundamentally incorrect (this is a way more correct explanation)? Commented Jul 25, 2024 at 11:12

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.