cli-sedHow do I download and use the CLI version of Sed?
- Download the source code for the CLI version of Sed from GNU ftp.
- Unpack the source code using your favorite unzip program.
- Navigate into the source code directory and run
./configureto configure the program for your system. - Run
maketo build the program. - Run
make installto install the program. - Run
sed --helpto view the available options for using Sed. - To use Sed, you can run a command such as
sed 's/foo/bar/g' foo.txtwhich will replace all instances offoowithbarin the filefoo.txt.
Example code block:
$ sed 's/foo/bar/g' foo.txt
Output of example code:
bar
Code explanation
sed: The Sed command.s/foo/bar/g: The substitution command which replaces all instances offoowithbar.foo.txt: The file to apply the substitution to.
Helpful links
More of Cli Sed
- How do I use the CLI to configure Zabbix?
- How do I use the command line to edit text using sed?
- How can I set up the Xcode command line interface?
- How can I use SED in a Windows command line interface?
- How do I use the command line to compress a file using SED and ZIP?
- How can I use a variable with the sed command line tool?
- How can I use the sed command in the Ubuntu command line interface?
- How can I use cli sed to select an Azure subscription?
- How can I use the sed command line tool to modify file permissions?
- How can I use CLI sed and Yarn together to develop software?
See more codes...