David Radan
David Radan

Reputation: 93

How to add time at which commands were executed to terminal on Mac? (change format)

The default format for my terminal line looks like this:

David-Mac-mini:~ david$

I'd love if there was a way for it to show by default as:

David-Mac-mini:~ david$ [Hh:Mm:Ss]

Upvotes: 6

Views: 2643

Answers (1)

Eugene
Eugene

Reputation: 1895

You have edit or create your .bashrc or .bash_profile profile file. Add the command export PS1="\t"

You can add the following lines to customize your Terminal prompt:

\d – Current date
\t – Current time
\h – Host name
\# – Command number
\u – User name
\W – Current working directory (ie: Desktop/)
\w – Current working directory with full path (ie: /Users/Admin/Desktop/)

Upvotes: 9

Related Questions