1. Variable Reading example: Echo $PATH echo $ (PATH)
2, Variable assignment: AA=ASDF Note: There is no space around the equals sign
3. View all environment variables: env
4. Id:echo $$ of the current thread
5. Custom variable to environment variable: Export variable name (purpose: The variable is still valid in the child process)
6. Read Atest
This is a test
Echo $atest
7. Ulimit-a: The limit amount listed
8. View an existing alias: Alias
New definition alias: Alias lm= ' Ls-l | More
9. Historical command: History: Located in ~/.bash_history
10. Cat/etc/issue: View operating system
11, Uname-r: Display version information
12, Description:/etc/profile: Is the system overall settings, easy not to change, but can change the system level design
~/.bash_profile or ~/.bash_login or ~/.profile: The user's personal settings, you can change your settings here
13, source configuration file name: Read into the Environment profile: source ~/.BASHRC equivalent to. ~/.bashrc
14, Grep-n ' The ' Regular_express.txt: With line number display Regular_express.txt with ' the ' line
15, Grep-n ' [^g]oo ' re*.txt: Find lines with ' oo ' before ' g '
Shell Script
1. Execution: SH sh01.sh
2, Permission: Must have RX permission, can also do this: chmod a+x sh01.sh;. /sh01.sh
3. Templates:
#!/bin/bash
path=/usr/java/jdk1.7.0_76/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/ Sbin:/home/zhangping/bin:~/bin
Export PATH
4, Echo $ ((13/2)): Echo ((expression)): Perform numeric operations
Shell and Shellscript