The sed command to delete the line containing special characters

1. Delete special characters

sed -e'/abc/d' tt.txt // Delete the line containing "abc" in tt.txt, but do not change the tt.txt file itself, the result after the operation is displayed in the terminal

2. The sed command deletes all lines starting with a character

sed -i ‘/^a/d’ abc.txt

Guess you like

Origin blog.csdn.net/weixin_44881103/article/details/103313200