Home >Operation and Maintenance >Linux Operation and Maintenance >What does sed mean in linux
Sed in Linux is a non-interactive character stream-oriented editor. sed can process the contents of multiple files and multiple lines at the same time. It can input the entire file to the screen without changing the original file. The command format of sed: [sed [option] 'sed command'filename].
sed introduction
(Recommended learning: linux tutorial)
sed: Stream Editor text Stream editing, sed is a "non-interactive" character stream-oriented editor. sed can process the contents of multiple files and multiple lines at the same time. It can input the entire file to the screen without changing the original file, or it can input only the content that matches the pattern to the screen. You can also make changes to the original file, but the results will not be returned on the screen.
Sed command syntax format:
sed command format:
sed [option] 'sed command'filename
sed script format:
sed [option] -f 'sed script'filename
sed command option:
-n: Only print lines matching the pattern
-e: Perform sed action editing directly on the command line mode, this is the default option
-f: Change sed The action is written in a file, use –f filename to execute the sed action in filename
-r: Support extended expressions
-i: Directly modify the file content
Let’s take a look at how to use it, as shown in the picture:
The above is the detailed content of What does sed mean in linux. For more information, please follow other related articles on the PHP Chinese website!