Shell and Shellscript

Source: Internet
Author: User

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

Related Article

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.