sed -i -e '2d' file | delete 2nd line in the file | sed script to delete last line of a file: $d
[lisa@localhost sales]$ cat file
October 2017
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
=====
[lisa@localhost sales]$ sed -i -e '2d' file
[lisa@localhost sales]$ cat file
October 2017
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
======
sed script to delete last line of a file: $d
October 2017
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
=====
[lisa@localhost sales]$ sed -i -e '2d' file
[lisa@localhost sales]$ cat file
October 2017
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
======
sed script to delete last line of a file: $d
Comments
Post a Comment