[Linux setting series] Prompt setting of bash. / prompt / bash / shell

[Linux setting series] bash prompt setting

Introduction

--The side of your personal memo is strong ...

procedure

vi ~/.bashrc

~/.bashrc


#Add the following
PS1="\e[32m--------------------------[USR:\u / HST:\h /DIR:\W] \n$ \e[0m "

meaning

prompt meaning
\e[32m Change color to green
\u Show current user
\h The first "host name".Display the part up to
\t The current time is 24 hours "HH":MM:Display in "SS" format
\n new line
\e[0m Change color to white

Other special characters

--Refer to the HP on the left: https://www.atmarkit.co.jp/flinux/rensai/linuxtips/002cngprmpt.html

Recommended Posts

[Linux setting series] Prompt setting of bash. / prompt / bash / shell
[Bash / linux] Notes in case of trouble
[Linux] Learn the basics of shell commands
docker alpine bash git prompt completion setting memo
Linux [shell command]
I want to use Linux commands at the command prompt! Use Linux commands at the command prompt instead of Git Bash
[Linux] Basics of authority setting by chmod for beginners
Meaning of Linux permissions
[Linux] Installation of nvm
Database autostart setting linux
[Linux] IPv6 invalidation setting