简体   繁体   中英

The sed command to delete lines in range doesn't work

i saw online that we can use sed to delete lines in a range within a file but it doesn't work, why?

sed '1,39192d' file 

that command should delete lines from 1 to 39192 in that file (my file contains 259k lines)

You need "-i" (--in-place) flag:

sed '1,39192d' -i file 

But be careful this will change the file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM