1: The current directory is more important than several files
... anaconda-ks.cfg.bash_history.bash_logout.bash_ Profile.bashrc.cshrcinstall.loginstall.log.syslog.tcshrc.viminfo
2: Set environment variable $PATH usually defined in/etc/profile or ~/.BASHRC
Export path= "Path:/home/user/bin" or path= "Path:/home/user/bin" export PATH
2: Format substitution symbol
printf "%-5s%-10s%-4s\n" No Name Mark
printf "%-5s%-10s%-4.2f\n" 1 Sarath 80.3456
%-5s indicates a string substitution with a left-aligned format and a width of 5 (-left-justified). If not used-Specifies the alignment, the string is in the right-justified form.
%-4.2f, where. 2 specifies that 2 decimal digits are reserved Note that there is a newline character after each line of format string \ n.
4: Color Printing
Echo-e "\E[1; 42m Green Background \e[0m "
To set the color background, the frequently used color code is: reset = 0, black = 40, red = 41, green = 42, yellow = 43, blue = 44, magenta = 45, cyan = 46, white = 47.
5: Get environment variables for a process
Pgrep my #获取PID for example for 12500cat/proc/12500/environ
Linux Small Knowledge points