Changes between Version 3 and Version 4 of Csle2022/Agenda/linuxfilters
- Timestamp:
- Nov 29, 2022, 12:34:38 AM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Csle2022/Agenda/linuxfilters
v3 v4 136 136 10.Deleting lines from a particular file : SED command can also be used for deleting lines from a particular file. SED command is used for performing deletion operation without even opening the file 137 137 Examples: 138 1 .To Delete a particular line say n in this example138 10.1.To Delete a particular line say n in this example 139 139 Syntax: 140 140 `$ sed 'nd' filename.txt` … … 143 143 `$ sed '5d' filename.txt` 144 144 145 2. To Delete a last line145 10.2. To Delete a last line 146 146 147 147 Syntax: … … 149 149 `$ sed '$d' filename.txt` 150 150 151 3. To Delete line from range x to y151 10.3. To Delete line from range x to y 152 152 153 153 Syntax: … … 159 159 `$ sed '3,6d' filename.txt` 160 160 161 4. To Delete from nth to last line161 10.4. To Delete from nth to last line 162 162 163 163 Syntax: … … 169 169 `$ sed '12,$d' filename.txt` 170 170 171 5. To Delete pattern matching line171 10.5. To Delete pattern matching line 172 172 173 173 Syntax: