Tag:sed
-
Time:2021-1-8
Sed is the abbreviation of stream editor, which is mainly used to process standard output or files. Grammar: stdout | sed [option] “pattern command” sed [option] “pattern command” file1 Common options #- N print only silent pattern matching lines, not original lines #P is the print command ➜ sed ‘/hello/p’ helloWorld.sh #!/bin/bash HELLO bash echo […]
-
Time:2020-11-25
Sed is the abbreviation of stream editor, that is, stream editor. It processes one line of content at a time. When processing, it stores the currently processed line in the temporary buffer, which is called “pattern space”. Then it uses the SED command to process the contents of the buffer. After processing, it sends the […]
-
Time:2020-9-22
The SED tool of Linux is very powerful. It can easily add content in the front line or the next line of a keyword. Today, this function is used when batch modifying Tomcat logs. 1、 Add content on the line before or after a rowThe operation is as follows: Copy code The code is as […]
-
Time:2020-5-27
summary Sed command is a non interactive editor for character stream, which means sed does not allow users to interact with it. Sed processes the text content by line. In shell, it is very convenient to use sed to modify text content in batch. Options for the SED command Sed [options] [actions] Options and parameters: […]
-
Time:2020-4-15
Sed is very powerful for text processing, and sed is very small, with few parameters and easy to master. Its operation mode is similar to awk. Sed reads the files line by line in order. It then performs all the operations specified for the line, displays the content after the requested modification, and can also […]
-
Time:2020-2-28
awkBasic conceptsAwk regards the file (or other input streams, such as redirected input) as a recordset, each line as a record, and the string separated by a space (or a separator specified by the user) in each line as a field. This seems to regard the file record as a database. However, Awk is still […]
-
Time:2020-2-9
Sed usage: Sed is a very good file processing tool. It is a pipeline command. It is mainly processed in behavioral units. You can replace, delete, add, select data lines and other specific work. Let’s learn about the use of SED first The SED command line format is: Sed [- nefri] ‘command’ enter text Common […]
-
Time:2019-11-7
AndvimDifferent,sedIt is a non interactive text editor. At the same time, it is character flow oriented. Each line of data passes throughsedOutput after processing. sed [OPTION]… [script] [file]… sedFirst, initialize two data buffersMode spaceandKeep space;sedRead a line of input (from a standard input or file), remove the line break (\ n) at the end and […]
-
Time:2019-10-31
A. the contents of TXT are as follows: 111 222 baidu 333 444 google 555 666 Exchange the lines containing Baidu and Google to get: 111 222 google 333 444 baidu 555 666 Code 1: sed ‘/baidu/{:a;N;/google/!ba;s/\([^\n]*\)\n\(.*\)\n\(.*\)/\3\n\2\n\1/}’ a.txt Code 1 execution: Code 2: sed ‘/baidu/{:a;N;/google/{s/\(^[^\n]*\)\(.*\)\(\n\)\([^\n]*$\)/\4\2\3\1/;t};ba}’ a.txt Code 2 execution: Features of code 1 and code […]
-
Time:2019-10-12
The Linux Foundation announced a new LFCS (Linux Foundation Certified Sysadmin) certification program. This program aims to help people all over the world gain certification of their ability to handle Linux system management tasks. These capabilities include system services to support operations, as well as first-hand fault diagnosis, analysis, and informed decision-making for the engineer […]
-
Time:2019-10-4
sedIt is a stream editor. It is a very useful tool in text processing. It can perfectly match regular expressions, and its functions are outstanding. When processing, the currently processed rows are stored in a temporary buffer, called pattern space, and then the contents of the buffer are processed with sed command. After processing, the […]
-
Time:2019-9-17
sedCommands are widely used and easy to use. They are powerful tools for fast text processing. In fact, it does not have many skills, recitation, use is the most appropriate learning channel, belongs to the hard skills. But it’s complicated because there are too many advanced functions. This article does not focus on the advanced […]