Bash Prompt Basics | Linux Today

Bash Prompt Basics

Written By
Web Webster
Web Webster
Dec 5, 2008

“Bash prompt variables

“As anything else in the linux system also bash prompt can be
customized. Bash prompt can be customized by changing the values of
bash PS1, PS2, PS3, PS4 variables. To keep the things simple, this
article will be concerned just with PS1 and PS2 variables.

“Use echo command to see the current value of PS1 and PS2
variables.

“echo “Bash PS1 variable:” $PS1
echo “Bash PS2 variable:” $PS2

“Bash PS1 prompt variable

“PS1 is a primary prompt variable. Currently it holds u@h:w$
special bash characters. This is the default structure of the bash
prompt on many Linux systems and is displayed every time you log in
using a terminal.Please see the following section “Bash prompt
special characters” for explanation of u, h, w and $ symbols.”

Complete
Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.