Linux is picking up flowers

Source: Internet
Author: User
Tags aliases

Bash_profile and. BASHRC
. BASHRC to save personal personalization settings, such as command aliases, paths, and so on.
after each modification. BASHRC, using source ~/.BASHRC (or. ~/.bashrc), you can immediately load the modified settings to make them effective. The
is typically called explicitly in the. bash_profile file. bashrc. Log in to Linux to start bash first read the ~/.bash_profile file,
So ~/.BASHRC will be executed, your personalized settings will be effective. But not all Linux has bash_profile files.

/etc/profile: This file sets the environment information for each user of the system, and the file is executed when the user logs on for the first time.
and collect the shell settings from the configuration file of the/ETC/PROFILE.D directory.
/ETC/BASHRC: Executes this file for each user running the bash shell. When the bash shell is opened, the file is read.
~/.bash_profile: Each user can use the file to enter shell information that is dedicated to their own use, and the
file executes only once when the user logs on! By default, he sets some environment variables to execute the user's. bashrc file.
~/.BASHRC: This file contains bash information dedicated to your bash shell, which is read when you log on and every time you open a new shell.
~/.bash_logout: Executes the file each time it exits the system (exiting the bash shell).

In addition, variables set in/etc/profile (global) can be applied to any user, while variables set in ~/.BASHRC, etc. (local) only inherit variables from/etc/profile, they are "parent-child" relationships. The
 
~/.bash_profile is interactive, the login way into bash runs
~/.BASHRC is the interactive non-login way into the bash run
usually the two settings are roughly the same, so the former is usually tuned Use the latter.

The alias set for aliases to be permanently valid requires that the command be added to the. BASHRC

 

background runner
Nohup python cuckoo.py >/dev/null  2>&1 & nohup==>run COMMAND, ignoring hangup signals. The current terminal disconnect process still runs
>/dev/null standard output to the trash, otherwise standard output to Nohup.out,
2 >&1 error output to standard output
& program background run, if there is no nohup, the current terminal if closed, the background process exits
corresponding other commands:
jobs   View Background process,-l parameter shows process number

[email protected]:/polyhawk_building/analysis/sandbox# jobs-l
[1]+ 22471 running                  nohup python cuckoo.py >/dev/ Null 2>&1 &

FG 1   the command in the background to the foreground to continue running

ctrl+z   suspend current program

[email  protected]:/polyhawk_building/analysis/sandbox# jobs-l
[1]+ 22471 stopped                  nohup python cuckoo.py >/dev/null 2>&1

BG 1    A command that pauses in the background to continue execution

Linux is picking up flowers

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.