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
./configure
to configure the program for your system. - Run
make
to build the program. - Run
make install
to install the program. - Run
sed --help
to view the available options for using Sed. - To use Sed, you can run a command such as
sed 's/foo/bar/g' foo.txt
which will replace all instances offoo
withbar
in 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 offoo
withbar
.foo.txt
: The file to apply the substitution to.
Helpful links
More of Cli Sed
- How can I use sed in a command line interface?
- How can I use SED in a Windows command line interface?
- How can I use the command line to compress and edit files with sed and zip?
- How do I use the sed command line in bash?
- How can I use CLI sed and Yarn together to develop software?
- How can I use the command line to print the output of a sed command?
- How can I use CLI sed to create a new VPC?
- How can I use the 'sed' command line utility to group text?
- How do I use the commandline sed tool to edit a file?
- How do I use the command line to compress a file using SED and ZIP?
See more codes...