Tell me what to add to the team

sed -n '/\.com/p' all.txt > com.txt 

to select only those lines that end in .com?

  • 2
    sed -n '/\.com$/p' all.txt> com.txt - kmv

1 answer 1

The end of the line in sed denoted by $ .
So you need sed -n '/\.com$/p' all.txt > com.txt