Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Basic introduction of sed

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Overview of course knowledge.

1) Overview of the three Musketeers sed command

2) the basic syntax of the three Musketeers sed command execution principle command

3) three Musketeers sed command practical exercises to add (add information) delete (modify) check (find)

4) scripting: system-based optimization scripts

Script-- put it in the system-- execute the script-- optimize it all (easy)

2. Review of curriculum knowledge

1) basic regular symbols: 7 ^ $. *\ [] [^]

2) extended regular symbols: 5? + {} | ()

Extended regular use:

Grep-E = = egrep

Sed-r

3) summarize the parameter filtering information of grep command

-I-ignore case search information

-n-display the line number after searching for information

-c-count the number of rows filtered

-v-invert the search information

-o-only output and display matching information

-w-match information by string

-A-filter the information after the specified content

-B-filter the information before the specified content

-C-filter the information above and below the specified content

-E-identify extended regular information

-r-Recursive search for specified data content []

3. An overview of the three Musketeers command sed

Sed-stream editor for filtering and transforming text

1) you can find, filter and filter out the specified information

2) be good at editing the content information of files

3) be good at manipulating the lines of a file

4. The execution principle of the three Musketeers' command sed

1) implement the principle process:

2) Command syntax structure:

Sed [parameters] (add as appropriate) 'conditions, instructions (actions processed)' file information (processed files)

Condition definition: processing according to line number content regular information

Instruction definition: information processing actions that meet the conditions (add, delete, modify output)

5. Three Musketeers sed command practice

Prepare the test file:

Cat > > person.txt

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report