我的终端行的默认格式如下所示:
David-Mac-mini:~ david$
如果有一种方法可以让它默认显示为:
David-Mac-mini:~ david$ [Hh:Mm:Ss]
最佳答案
您已编辑或创建您的 .bashrc 或 .bash_profile 配置文件。
添加命令 export PS1="\t"
您可以添加以下行来自定义您的终端提示:
\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/)
关于macos - 如何将执行命令的时间添加到 Mac 上的终端? (改变格式),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36503861/