0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

プロンプトに現在の時刻を表示させる

Last updated at Posted at 2024-06-27
--プロンプトの先頭(左端)に「HH:MM:SS」形式で(コマンド実行直前の)時刻を表示する
PROMPT_COMMAND='echo -ne "\e[0K\r$(date +%H:%M:%S) "'


--おまけプロンプト設定
PS1='[\u@\h \W]\$ '

\u:現在のユーザー名
\h:ホスト名の最初の部分
\W:現在の作業ディレクトリのベース名
\$:通常のユーザーの場合は $、スーパーユーザーの場合は #
[と]:プロンプトの開始と終了を示す角括弧
最後に空白文字:プロンプトとコマンド入力の間にスペースを追加
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?