NixUser

NixUser.com | Unix User | Linux User | NixUser

How to delete lines of a file using pico

How do you delete a line or a number of lines in a file while using pico editor? Please follow the steps below for that.

Move your cursor directly just before the area or the line you want to delete. Set a mark by pressing Ctrl-6 or Ctrl-^.
Move the cursor to the end of the region you want to delete and press Ctrl-k.

The selected lines will be deleted from the file.

Or there is also another way to do it.

Select the line you want to delete using your mouse. Use Ctrl-k to delete it.

If you have selected multiple lines, use Ctrl-k multiple times to delete all the lines.