cli-sedHow do I delete a line using the CLI sed command?
The sed command can be used to delete a line from a text file. The syntax to delete a line using sed is sed 'Nd'. Here, N is the line number of the line to be deleted. For example, to delete the third line from a text file, the command would be:
$ sed '3d' file.txt
The output of the above command would be the contents of the text file, with the third line deleted.
The parts of the command are:
sed: the sed command'3d': the argument to the sed command, which specifies the line number to deletefile.txt: the name of the text file to be edited
For more information about using the sed command to delete lines, see the following links:
More of Cli Sed
- How do I use the CLI to configure Zabbix?
- How can I use the command line tool sed to create a tutorial?
- How can I use CLI sed and Yarn together to develop software?
- How can I use cli sed to select an Azure subscription?
- How can I use cli sed to configure credentials?
- How can I use cli sed to deploy an ARM template?
- How can I use CLI sed to authenticate to AWS?
- How do I use sed to add quotes around a string in a command line interface?
- How do I use a CLI sed query?
- How can I use the CLI sed command to encrypt a password?
See more codes...