Source command in linux

Source: Internet
Author: User


The source command in linux is a built-in command of bash shell, which comes from C Shell. Another method of writing the www.2cto.com source command is the dot symbol, which is used in the same way as source and comes from the Bourne Shell. The source command can force a script to immediately affect the current environment. The source Command forces all commands in the script to ignore the file permissions. The source command is usually used to re-execute the modified initialization file, such as. bash_profile and. profile. The source command can affect the environment of the parent shell that executes the script, while the export can only affect the environment of its subshell. Method 1: Make the/etc/profile file take effect immediately after modification. You can use the following command :#. /etc/profile Note :. and/etc/profile have space method 2: Make the/etc/profile file take effect immediately after modification, you can use the following command: # source/etc/profile attachment: use the source command in Linux. The source command is also called the "dot command", which is also a dot symbol (.). The source command is usually used to re-execute the modified initialization file to make it take effect immediately without logging out and logging on again. Usage: The source filename or. filenamesource command has another usage besides the preceding usage. When compiling the system core, you often need to enter a long string of commands, such as: make mrpropermake menuconfigmake depmake cleanmake bzImage ............ If you make these commands into a file and execute them in sequence automatically, it is very convenient for users who need to recompile the core of the system multiple times. You can use the source command to achieve this, its role is to take the content of a file as shell to execute, first in the linux source code directory (such as/usr/src/linux-2.4.20) to create a file, such as make_command, enter the following content: www.2cto.com make mrproper & make menuconfig & make dep & make clean & make bzImage & make modules & make modules_install & cp arch/i386/boot/bzImage/boot/ vmlinuz_new & cp System. map/boot & vi/etc/lilo. conf & lilo-v
After the file is created, every time you compile the core, you only need to enter: source make_command under/usr/src/linux-2.4.20, if you are not using lilo to guide the system, you can remove the last two lines and configure your own boot program to guide the kernel. By the way, the & command indicates that the commands connected by it are executed sequentially, but the commands following it can be executed only after the previous commands are successfully executed.

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.