Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个类似的文本文件:
lineat2 corrupt exitCode()
等等...
每行都有一些文本。我想从这个文件中复制那些corrupt以另一个文件开头的行。任何命令(sed/ grep)来做到这一点?
corrupt
sed
grep
grep ^corrupt textfile > anotherfile
sed -n '/^corrupt/p' FILE > NEXTFILE