Laruence's Linux private House dish-basic learning Article 5

Source: Internet
Author: User
24. vi, vim text processor/word ,? Word, dd, ndd, yy, nyy, p, P, I, Esc,: q !, : Wq,: setnuvim has the color display function and supports many syntaxes. the vim setting values of both C and shell scripts are generally stored in the/etc/vimrc file. we recommend that you modify them ~ /. Vimrc file...

24. vi, vim text processor
/Word ,? Word, dd, ndd, yy, nyy, p, P, I, Esc,: q !, : Wq,: set nu
Vim supports color display and many program syntaxes, whether C or shell scripts.
The vim setting value is generally stored in the/etc/vimrc file. we recommend that you modify it ~ /. Vimrc file
 
25./bin/bash, Linux default shell
Command memory function ~ /. Bash_history
Command and file completion full-featured tab key
Alias lm = 'ls-Al'
Job Control (jobs), foreground, and background control
Powerful functions of Shell scripts
Wildcard
 
26. type [-tpa] name
Displays whether the name is an external command or a bash built-in command.
 
27. get and set variables: echo, variable setting rules, unset
# PATH = $ PATH:/home/allen/bin
Environment variable function: env
Set command: except for environment variables, other custom variables and all variables are listed.
Convert custom variables to environment variables: export
Variable keyboard reading, array and declaration: read, array, declare
Constraints on file systems and programs: ulimit
Command alias and history commands: alias, unalias, history
Login message display data:/etc/issue,/etc/motd
 
28. system setting value
/Etc/sysconfig/i18n
/Etc/profile,/etc/profile. d,/etc/inputrc
/Etc/bashrc
/Etc/profile. d/*. sh
/Etc/man. config
 
29. individual price settings
~ /. Bash_profile ,~ /. Bash_login ,~ /. Profile
~ /. Bashrc: the file will be read again every time the shell script is executed.
~ /. Bash_history
~ /. Bash_logout
 
30. read/etc/profile first, and then read other additional settings files, such as/etc/profile. d and/etc/inputrc.
Read data from the user's home directory based on different users ~ /. Bash_profile or ~ /. Bash_login or ~ /. Profile and other setting files
According to different users, go to the home directory to read ~ /. Bashrc
Login shell and non-login shell
 
31. data stream redirection
Standard input stdin: code 0, use <或<<
Standard output stdout: the code is 1, use> or>
Stderr output for standard errors: Code 2, use 2> or 2>
# Find/home-name testing> list 2> & 1
 
32. command execution judgment basis:;, &, |
# Ls/tmp & touch/tmp/test
Variable $ ?, If there is no error message in the command execution result, $? is returned? = 0. if there is an error, the return value is not 0. with this judgment, we can use & to determine whether the current execution result is correct, and then execute subsequent commands.
# Ls/tmp | touch/tmp/test
| Opposite to &, the current command is executed only when an error occurs |
 
33. MPs queue ls-al/etc | less
 
34. select command: cut, grep
# Cut-d 'delimiter'-f fields
# Echo $ PATH | cut-D': '-f5
# Echo $ PATH | cut-D': '-f3, 5
# Grep [-acinv] 'search string 'filename'
# Last | grep 'root'
# Last | grep-v 'root'
# Last | grep 'root' | cut-D'-f1
 
35. sorting commands: sort, wc, and uniq
Sort by data type./etc/passwd content is separated by:, and the third column is used for sorting.
# Cat/etc/passwd | sort-t': '-k 3
# Last | cut-d ''-f1 | sort | uniq-c
# Cat/etc/man. config | wc-l
Bidirectional redirection: tee
# Last-l/home | tee home.txt | cut-D'-f1

Author "allenhu0320"
 

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.