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.
grepコマンドを使用して、com$で終わるすべての行をgrepします
grep'com$'入力>出力
しかし、結果-パターンに一致する1行のみ。
その結果は、com$パターンに一致するすべての行でした。
例:
site.com
site2.com
site3.tv
site4.com
GNU grep 2.6.3
あなたの入力を使用して、それは私のために働きます。しかし、末尾のスペースが問題になる可能性はありますか?試す:
grep 'com[ ]*$' input >output
結果を確認すると便利です。