Common Linux Commands Explanation (eighth day)--bash Shell operating environment

Source: Internet
Author: User
Tags variable scope

For the new company, the company's leadership is very good. I feel more of the place is, their work efficiency is obviously higher than before. In the past will be very impatient for frequent changes in demand, now received after the demand will be careful thinking, for the overall construction. Even if the demand changes in the future, it can be relatively easy to change on the basis of the original. The project manager, who used to talk about frequent changes in demand, was an idiot, but we all fell into a bureau where we thought we were a programmer. Self-thinking is a programmer, only care about the editor of the point of a three-acre code of people, is never grow up project managers and even the CTO. As for someone who says I like to write code, I just want to say that a soldier who doesn't want to be a general is not a good soldier. Code is only to achieve the requirements of a product to make a step, so do not take yourself too seriously, good and other colleagues to cooperate, there is a contradiction is the opportunity to exercise their communication skills, everyone's common purpose is to make safe, simple, can rely on the product, we were strangers before, for a goal to get together, Don't get distracted by other targets and forget your intentions.

This final series of parsing Linux commands is in September 2015. After listening to a Linux teacher, did not continue to delve into the Linux, and moved to a more practical JS and MySQL. The two have played an important role in the job and job hunting, and if not in time, I may still be a junior programmer with a level dish. But Linux is a threshold on the road to growth, and the same as English will become the road to the future development of roadblocks. So in this company's probation period, the main plan is to learn the Linux system over and over. The Book of study is also "bird Brother's Linux private dish".

Before listening to some of the garden's "old comrades" said do not often send some entry-level articles in, but I will persist in the hair down.

Today, the boss gave me a test service account, then I was logged on to the server login information to make a laugh.

So how is this effect implemented? Why does it appear when you log in? Then we should first understand the login and welcome information of BASHD:

1. Bash login information and welcome information

There are three files under/etc/to print the login information when you log in.

/etc/issue Enter the welcome message you want to add directly after the line break.

/etc/issue.net when using Telnet to connect to a host, the login interface of the host displays the welcome information in this file.

/ETC/MOTD's content is to modify this file and then produce the effect. MOTD is the message of the day everyday messages mean. When I want to notify this server all the logins, today to stop maintenance, this is a better way.

2. Bash Environment configuration

When we log on to Linux, we have acquired the environment variables of Linux. This, like any other language, has its own built-in variables. For example, the client's JavaScript also has built-in objects, browser objects, and user-set objects, and so on, the first two built-in objects can be collectively referred to as the original object, which is the same as Linux. This example is for students who do not understand the service-side program to popularize.

When we go from one bash to another bash (subprocess), why are the variables set in the parent process not being fetched in the child process? This involves the problem of variable scope. For an explanation of variable scopes, see

1, Common Linux command Interpretation (fifth day)--shell variable learning

2. Interpretation of common Linux commands (sixth day)--shell environment variables

So how does the function of the variable scope be implemented? This will mention bash's environment profile: Login and Non-longin Shell

When we log in, we will first load the login shell.

The login shell will go to/etc/profile to load the entire system's environment configuration. So we're not going to move the files inside.

/etc/profile Login Shell to read

/ETC/INPUTRC defines the keyboard shortcut keys

/etc/profile.d/*.sh defines a few scripts

/ETC/SYSCONFIG/I18N defines the current language variable

The login shell reads only one of the following three files, reads sequentially, and then reads the second one if the first exists, and so on.

~/.bash_profile user-defined variables

~/.bash_login

~/.profile Custom Variables

Personal configuration. Login shell and Non-login Shell will read

~/.bashrc

Late at night, the rest of the chapters will be written tomorrow.

Common Linux Commands Explanation (eighth day)--bash Shell operating environment

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.