コマンドの実行結果をテキストファイルに保存する
$ date > test.txt // ファイルを新規作成してい保存
$ date >> test.txt // test.txt にコマンドの結果を追記
$ date > test.txt // ファイルを新規作成してい保存
$ date >> test.txt // test.txt にコマンドの結果を追記
$ touch dairy_$(date +"%Y%m%d").txt
messagesファイル中の、3月31日のログファイルを log.txt に保存します。
sudo less /var/log/messages | grep 'Mar 31' > log.txt