Linux Startup and landing environment

Source: Internet
Author: User

Linux startup process

Reference: http://www.ruanyifeng.com/blog/2013/08/linux_boot_process.html

    The
    1. loads the kernel, first reading the kernel files in the/boot directory. The
    2. initiates the initialization process/sbin/init, which is the function of initializing the system environment. Since Init is the first program to run, its process number (PID) is 1. All other processes derive from it, all of which are its child processes.
    3. determines the run level. Linux presets seven RunLevel (0-6).
      In general, 0 is shutdown, 1 is single-user mode (that is, maintenance mode), and 6 is a reboot. Different levels correspond to different start-up programs, which are called "services" in Windows and are called "daemons" (daemon) on Linux. The
      Init process first reads the file/etc/inittab, which is the run-level settings file.
      Each runlevel below the/etc directory has a corresponding subdirectory,/etc/rcn.d,n, indicating the run level, specifying the program to load.
    4. loads the boot loader. The programs listed in the/ETC/RCN.D directory are set as link files, pointing to another directory/ETC/INIT.D, containing the location of the program
    5. user login.
      1. looks for the account entered from the/etc/passwd and reads the UID and GID (/etc/group the relationship that stores the corresponding group name)
      2. find the password for UID from/etc/shadow
      3. Enter shell
    6. enters the login shell and configures the shell:
      First read into/etc/profile, which is a valid configuration for all users;
      then look for one of the following three files , reading one ignores the other columns, which is the configuration for the current user.
      ~/.bash_profile
      ~/.bash_login
      ~/.profile
/etc/profile

This file includes:

    1. Global or local environment variables. It is easy for users and their processes and applications to access it.
    2. Path information. Contains executable files, library files and general text files directory location, convenient for users to quickly access.
    3. Terminal settings. The system learns the general characteristics of the user terminal.
    4. Security commands. Double sign-in prompt including file creation mode or sensitive area.
    5. Date information or discard operation information. is a text file that holds the record of the event that is about to occur when the user logs on or discards the logged-in information file.
~/.profile

User's environment variable settings

Stty

The Stty command is used to display and modify terminal line settings.

The command format is: Stty SETTING CHAR

Setting can be as follows

    • EOF: End of input, end of file, default is Ctrl+d. For example: When creating a file with Cat>file, press Ctrl+d to end the input.
    • Erase: Remove characters backwards, erase the last input character, Ctrl +?. Note By default, the backspace backspace is not a delete character.
    • Intr: Interrupts the current program, the default is CTRL + C.
    • Kill: Deletes the entire command, deletes the entire line, and defaults to Ctrl+u.
    • Quit: Exits the current program, which defaults to ctrl+\ or ctrl+|.
    • Start: Start screen output, default is Ctrl+q.
    • Stop: Stops the screen output, which defaults to Ctrl+s. Sometimes the terminal suddenly zombie, may be accidentally pressed Ctrl+s's sake, because we habitually press Ctrl+s to save the file.
    • Susp:terminalstop the current program, the default is CTRL + Z. This will turn the current process into a background process.
    • Werase: Deletes the last word, which defaults to ctrl+w.
    • The Stty command also has some other uses, such as:
    • Stty-echo turns off Echo. For example, when entering a password in a script.
    • Sttyecho Open echo.
Environment and Shell variables

Shell variables: Customizing the user's own working environment.

Local variables: defined in the current shell and meaningful in the current shell.

Environment variables: environment variables are used for all user processes (often referred to as child processes). The logon process is called the parent process. User processes that are executed in S H e l l are called child processes.
When set, the Export command needs to be exported as an environment variable.

Linux Startup and landing environment

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.