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 を使用しています。
grep -A 100 "2013/02/13 19*" log.out > newfile.txt
テキストファイルの新しい行が特定のテキストで始まるように、コマンドラインでフォーマットする方法はありますか? たとえば、「info」を新しい行から始めたいとします。
sed を使用して grep の出力から \r および \n 文字を削除してから、sed を使用して「特定のテキスト」を「特定のテキスト\n」文字に置き換えます。それはうまくいくはずです。