delete everything before pattern including pattern using awk or sed
问题 aaa aaaa aaaa aaaa sss ssss ssss ssss ddd dddd dddd dddd fff ffff ffff ffff abc pattern asd fde 111 222 333 444 555 666 777 888 999 000 Desired output : If the 111 222 333 444 555 666 777 888 999 000 回答1: Just set a flag whenever the pattern is found. From that moment on, print the lines: $ awk 'p; /pattern/ {p=1}' file 111 222 333 444 555 666 777 888 999 000 Or also awk '/pattern/ {p=1;next}p' file It looks for pattern in each line. When it is found, the variable p is set to 1. The tricky