19
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

macOSのTerminalでログの自動生成

Last updated at Posted at 2016-10-11

ログ出力用のディレクトリを作成する

$ mkdir -p /Users/${USER}/Documents/Terminal-Logs

[ターミナル.app]を起動し、メニューの[ターミナル] - [環境設定]を開く

2016101101.jpg

[設定]- [シェル]を開いて、[コマンドを実行]にチェックを入れる

2016101102.jpg

以下のソースを改行コードを入れずに1行でテキストボックスに入力する

NOW=`date +%Y%m%d%H%M%S`;LOGFILE=/Users/${USER}/Documents/Terminal-Logs/terminal-log_${NOW}.log;script ${LOGFILE}

[ターミナル.app]を再起動する。

19
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?