Shell chapter (i)

Source: Internet
Author: User
Tags terminates

Login Shell and Non-login Shell:

Login Shell: When you get the shell, you need a full login process. such as: Tty1~tty6 login, you need to enter a user name and password. The shell you get at this point is called login

Shell

Non-login Shell: When you get the shell, you don't need to repeat the login process. such as: The X window to log in to Linux, and then the X graphical interface to start the terminal, at this time

Machine does not need to enter the user name and password again, this bash environment is non-login shell.

such as: In the original bash environment again release bash this command, do not require the user name and password, this bash environment is Non-login

Shell

Interactive shell and non-interactive Shell:

The interactive Shell:shell waits for the command, and then executes the command. such as: User Login---> Execute command ...--->logout,shell also terminates.

Non-interactive Shell:shell reads the command in the file, executes the command, reads the last line of the file, and the shell terminates. such as shell script files.

BASHRC and profile are used to save the user's environment information, BASHRC is used to save the interactive Non-login shell,profile for the interactive login shell.

/etc/profile,/ETC/BASHRC is the system global environment variable setting. Some systems have not/ETC/BASHRC this file.

~/.profile, ~/.BASHRC is a private environment variable setting under the user directory. ~/.profile only executes once when you log in, ~/.BASHRC each time you open a shell

will be executed.

Login Shell's initial execution process:/etc/profile This file also calls/etc/profiled/*sh/etc/inpurc and so on itself.

~/.bash_profile ~/.bash_login ~/.profile calls each file in turn, and there is one after execution, which stops.

Non-login Shell's initial execution process: ~/.BASHRC This file itself calls/ETC/BASHRC,/ETC/BASHRC again to call/etc/profiled/*sh and so on.

Shell chapter (i)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.