How do I make the command line prompt display different information?

Updated -

To manipulate the prompt on the command line, the PS1 environment variable can be used. The PS1 environment variable is part of the bash package. It can be useful to users who wish to know the system's hostname, the directory they are currently working on, the date and the current time.

Some of the most common PS1 options are listed below:

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content