The default program for linux logon appears and is executed again. The default program for linux Logon

Source: Internet
Author: User

The default program for linux logon appears and is executed again. The default program for linux Logon

1. linux environment variables

2. How to set the default program when there are multiple versions of programs in linux?

When compiling the source code in linux, there are many problems with the version of the compiler. The Compiler requirements of many source files may be incompatible with the compiler version that comes with your system. In other cases, you need to manually add environment variables. Otherwise, it will be very troublesome to find the executable file every time.

The so-called environment variable is that when you execute an executable program, you only need to name it (you can give it a name), instead of typing out the entire path. For example, gcc can be compiled directly. You do not need to use/usr/bin/gcc to compile it every time.

Environment variables.

These files are actually some script files, all of which are executed sequentially by default during login. In fact, this is equivalent to if you are familiar with it, you can also manually.

In my linux version, I did not find the default path related items in files such as/etc/profile, so let's talk about the basic things.

The so-called default PATH is nothing more than export PATH: $ PATH :.... that's all. The writing to the script file is the same, but it will be done every time you log on, that is, at the beginning.

What is stored in PATH is... /... /... /bin is the path of a bunch of executable files, and every time you use it, you will find it here.

Then there is a multi-version problem. In fact, you can directly write down the entire path.

If you do not do this, you can use a different name, for example, gcc gcc6 gcc7.

You can also change the link of the default path. Take gcc as an example. If you want to change the version to version 5, you can do so.

Mv/usr/bin/gcc/usr/bin/gcc5

Ln-s/usr/bin/gcc7/usr/bin/gcc (assuming gcc7 is the path of the executable file) is actually a dumb example...

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.