![]() ![]() Replace the hash (#) symbols with the starting and ending line numbers. In addition, you can delete all the lines within a specific range using the sed command: sed '#,#d' samplefile.txt For example, run this command to remove the first line from the cities.txt file: sed '1d' cities.txt Replace the hash (#) symbol with the line number you want to delete. For example, use the following syntax to remove a particular line number: sed '#d' samplefile.txt The d or delete command lets you remove lines from a file without a text editor. Using sed to Delete Lines From a Particular File
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |