Which Command Will Delete the Lines Containing the Pattern This from the File in Unix?
Contents

Sed Command to Delete Lines: Sed command can be used to delete or remove specific lines which matches a given pattern or in a particular position in a file.

How do I delete a line in Linux?

Deleting a Line

  1. Press the Esc key to go to normal mode.
  2. Place the cursor on the line you want to delete.
  3. Type dd and hit Enter to remove the line.

19 июл. 2020 г.

Which vi command deletes the current line?

To Delete Text:

Command Action
dd delete current line
5dd delete 5 lines starting with the current line
dL delete through the last line on the screen
dH delete through the first line on the screen
Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest