How to replace the sed command in Linux

WBOY
Release: 2022-02-25 16:25:06
Original
15418 people have browsed it

Method: 1. Set the parameter "c", c can be followed by strings, these strings can replace the specified lines, the syntax is "sed 'line number c content after replacement'"; 2. Set The parameter "s" can be used for substitution directly, and the syntax is "sed 's/string to be replaced/new string/g'".

How to replace the sed command in Linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to replace the sed command in Linux

The Linux sed command uses scripts to process text files.

sed can process and edit text files according to the instructions of the script.

Sed is mainly used to automatically edit one or more files, simplify repeated operations on files, write conversion programs, etc.

Syntax

sed [-hnV][-e<script>][-f<script文件>][文本文件]
Copy after login

Parameter description:

  • -e

    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template