cli-sedHow can I use SED in a Windows command line interface?
SED is a command line tool for stream editing and can be used in a Windows command line interface. To use SED, you will need to install the GNU version of SED for Windows.
Once installed, you can use SED in a Windows command line interface by using the following syntax:
sed [options] [script] [inputfile]
For example, the following command will replace all occurrences of the word "apple" with the word "orange" in the file "fruit.txt":
sed s/apple/orange/g fruit.txt
The output of this command would be the contents of the "fruit.txt" file with all occurrences of the word "apple" replaced with the word "orange".
The parts of the command are:
sed
- the command to invoke SEDs/apple/orange/g
- the script to execute, which replaces all occurrences of "apple" with "orange"fruit.txt
- the input file
Helpful links
More of Cli Sed
- How can I use sed in a command line interface?
- How do I use the command line to edit text using sed?
- How can I use the command line to print the output of a sed command?
- How can I use sed command line options to modify text files?
- How can I use sed in the command line on a Mac?
- How can I use the 'sed' command line utility to add quotes around a string?
- How can I use the command line to compress and edit files with sed and zip?
- 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?
See more codes...