mrzakaria at Documents $If you're tired of the default, boring terminal prompt, you can customize it to be more visually appealing and informative. This guide shows a clean prompt — pink username · white "at" · yellow-green directory · $ — for every major shell and OS.
Colors used everywhere: 197 = pink (username), 15 = white ("at"), 191 = yellow-green (directory).
| Shell / OS | File |
|---|---|
| Bash (Debian, Ubuntu, Mint, Kali) | ~/.bashrc |
| Bash (Fedora, RHEL, Arch, openSUSE) | ~/.bashrc |
| Bash (macOS) | ~/.bash_profile |
| Zsh (macOS default, Linux) | ~/.zshrc |
| Fish | ~/.config/fish/functions/fish_prompt.fish |
| PowerShell (Windows) | $PROFILE |
System-wide bashrc locations (if you'd rather set it globally):
/etc/bashrc (Redhat, Fedora) · /etc/bash.bashrc (Debian, Ubuntu, Mint, Kali) · /etc/bash.bashrc.local (Suse, OpenSuse)
PS1='${debian_chroot:+($debian_chroot)}\[\e[1;38;5;197m\]\u\[\e[0m\]\[\e[38;5;15m\] at \[\e[1;38;5;191m\]\W\[\e[0m\] \$ 'Instructions
- Open your config:
nano ~/.bashrc - Paste the line below at the bottom (remove any old
PS1=line first). - Save (
Ctrl+O,Enter) and exit (Ctrl+X). - Apply:
source ~/.bashrc
Tokens: \u = username · \W = current folder only (\w = full path) · \e[1;… = bold · \e[38;5;Nm = 256-color text · \e[0m = reset · \[ \] marks invisible characters so line-wrapping stays correct. ${debian_chroot:+…} is Debian/Ubuntu-specific and shows the chroot name when present.
PS1='${debian_chroot:+($debian_chroot)}\[\e[1;38;5;197m\]\u\[\e[0m\]\[\e[38;5;15m\] at \[\e[1;38;5;191m\]\W\[\e[0m\] \$ 'PS1='\[\e[1;38;5;197m\]\u\[\e[0m\]\[\e[38;5;15m\] at \[\e[1;38;5;191m\]\W\[\e[0m\] \$ 'Instructions — same steps as Debian (~/.bashrc → paste → source ~/.bashrc). The only difference: these distros don't set debian_chroot, so that part is dropped. On Arch the file may not exist yet — just create it.
Fedora/RHEL keep their default prompt in
/etc/bashrc. SettingPS1in your personal~/.bashrcoverrides it cleanly — no need to touch system files.
PS1='\[\e[1;38;5;197m\]\u\[\e[0m\]\[\e[38;5;15m\] at \[\e[1;38;5;191m\]\W\[\e[0m\] \$ 'PS1='\[\e[1;38;5;197m\]\u\[\e[0m\]\[\e[38;5;15m\] at \[\e[1;38;5;191m\]\W\[\e[0m\] \$ 'Instructions
- (Optional) switch to bash:
chsh -s /bin/bash - macOS reads
~/.bash_profilefor login shells:nano ~/.bash_profile - Paste below, save, exit.
- Apply:
source ~/.bash_profile
Add export BASH_SILENCE_DEPRECATION_WARNING=1 above the line to hide the macOS "bash is deprecated" notice. Works in Terminal.app, iTerm2, Ghostty, Kitty, WezTerm.
export BASH_SILENCE_DEPRECATION_WARNING=1
PS1='\[\e[1;38;5;197m\]\u\[\e[0m\]\[\e[38;5;15m\] at \[\e[1;38;5;191m\]\W\[\e[0m\] \$ 'PROMPT='%B%F{197}%n%f%b%F{15} at %F{191}%1~%f %# 'Instructions
- Zsh is the default on macOS (since Catalina) and available on any Linux.
- Open config:
nano ~/.zshrc - Paste the line below, save, exit.
- Apply:
source ~/.zshrc
Tokens: %n = username · %1~ = current folder (%~ = full path with ~ for home) · %B/%b = bold on/off · %F{N}/%f = color on/off · %# = # when root, else %. Zsh tracks invisible characters automatically — no \[ \] needed.
PROMPT='%B%F{197}%n%f%b%F{15} at %F{191}%1~%f %# 'function fish_prompt
set_color -o 197; echo -n (whoami)
set_color 15; echo -n ' at '
set_color -o 191; echo -n (basename (pwd))
set_color normal; echo -n ' $ '
endInstructions — Fish uses a fish_prompt function, not PS1.
- Create the file:
nano ~/.config/fish/functions/fish_prompt.fish - Paste the function below.
- Save and exit — Fish reloads automatically (open a new prompt to confirm).
Tokens: set_color -o N = bold 256-color · whoami = username · basename (pwd) = current folder · set_color normal = reset.
function fish_prompt
set_color -o 197; echo -n (whoami)
set_color 15; echo -n ' at '
set_color -o 191; echo -n (basename (pwd))
set_color normal; echo -n ' $ '
endfunction prompt {
$e = [char]27
"$e[1;38;5;197m$env:USERNAME$e[0m$e[38;5;15m at " +
"$e[1;38;5;191m$(Split-Path -Leaf $PWD)$e[0m $ "
}Instructions
- Find your profile path: run
$PROFILE. - Create/open it:
notepad $PROFILE(click Yes if prompted to create it). - Paste the function below, save, close.
- Apply:
. $PROFILE(or open a new window).
Requires Windows Terminal or PowerShell 7+ for ANSI colors. $env:USERNAME = user · Split-Path -Leaf $PWD = current folder.
function prompt {
$e = [char]27
"$e[1;38;5;197m$env:USERNAME$e[0m$e[38;5;15m at " +
"$e[1;38;5;191m$(Split-Path -Leaf $PWD)$e[0m $ "
}prompt $E[91m%USERNAME%$E[0m at $E[93m$M$E[0m$GInstructions — CMD has no 256-color or username token, so this uses 16-color codes and %USERNAME%.
- Quick test (current window): paste the line and press Enter.
- Permanent:
regedit→HKEY_CURRENT_USER\Software\Microsoft\Command Processor→ new String valueAutoRunset to the same command. - Colors need Windows 10+ (VT processing, on by default).
Tokens: $E = escape · [91m/[93m = bright red / bright yellow · $M = full path · $G = > sign.
prompt $E[91m%USERNAME%$E[0m at $E[93m$M$E[0m$G| Code | Color | Used for |
|---|---|---|
| 197 | Pink | username |
| 191 | Yellow-green | directory |
| 15 | White | "at" text |
Change any number to recolor. Preview all 256 colors on Linux/macOS:
for i in {0..255}; do printf "\e[38;5;${i}m%3d\e[0m " $i; done; echo