LoginSignup
0
2

More than 3 years have passed since last update.

#ターミナルをかっこよくする

Posted at

プロンプト

.bashrc
PS1='\[\e[30;47m\] \u \[\e[37;46m\] \W \[\e[0m\]\$'
$ source ~/.bashrc

説明
[\e[ 0x;3x;4x m]]の中身の文法

書体,文字色,背景色の順位に;で区切る

エスケープシーケンス
00 普通
01 ボールド
02 細字
03 イタリック
04 アンダーライン
05 点滅

3x 文字色
4x 背景色

x0 黒
x1 赤
x2 緑
x3 黄
x4 青
x5 紫
x6 水
x7 灰

変数の説明

\h ホスト名 パソコンの名前
\u ユーザ名
\w カレントディレクトリ絶対パス
\W カレントディレクトリ相対パス
\t 時間 24h
\T 時間 12h
\@ 時刻PM  AM
\d 日付
\D タイプスタンプ \D{}として%y,%m,%d,%H,%M,%Sの引数をとれる
\# コマンド番号
\n 改行する
\$ $ or #の表示 末尾に入れるべき

ひとまずここまで

参考

0
2
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
2