"CentOS" Learning Bash

Source: Internet
Author: User
Tags echo display

First, the characteristics

Command history,!! ,!$,! character,!n (n is the first few commands)

tab can complete file path or command

Alias a= "B", unalias A, how to see which alias is defined, just hit alias

input and output redirection; >>, <,2>,2>>

Pipe Symbols |

Job Control CTRL + Z, CTRL + C, FG, BG

"Weak parsing, ' strong parsing, ' equivalent to returning ' The result of the command,

* Wildcard,? Wildcard, #注释, $ reference variable, multiple commands are written on one line, & run in the background, && logic and

Second, the variable

Env Current user all environment variables

Set user-owned variables + their own defined variables, unste

Export declared as global variable

echo Display Variable

Third, bash shell configuration file

1. System Setting value

/etc/profile

/etc/bashrc

2. Personal Setting value

~/.BASHRC, open a shell when executing

~/.bash_profile, when the user logs on to execute

~/.bash_history

~/.bash_logout

For the execution order, if the user logs on, the RC is executed before the profile is executed.

Then → figure this out. = = Source, which is the immediate new configuration

Three, Pipeline command

1.cut-d "Split symbol" [-CF] Fields

-D followed by delimiters, default to spaces

-C is followed by the first few characters

The number of blocks is followed by-F.

Eg:cut-d ":"-F 1/ETC/PASSWD

2.sort [-t delimiter] [-NRU]

-N using pure numeric sorting

-R Reverse Sort

-U the same line that appears is listed only once

2.1 Uniq [-c]

Show only one

-C in digital arrangement

3.WC [-LMW] [filename]

-L How many lines

-m number of characters

-W How many words

4.tee

Equivalent to being redirected and displaying content on the screen

5.tr replacement

Eg:ls-al |tr ' A-Z ' A-z change all lowercase to uppercase

6.split [-BL] Split

-B Split according to file size

-L Divide line according to number of lines

Eg:split-l 100/etc/passwd Thenameyouwant

Split-b 1m/etc/passwd Thenameyouwant

Written in the back//////////////////////////////////////////////////////////

I dragged it even more! Drag the more!! Drag the more!!!

It turns out I'm really a bit of a procrastination!!!!

Some feel that their study efficiency is a little low AH recently!!!!!

"CentOS" Learning Bash

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.