A Bash prompt is the command line indicator displayed in Linux terminals.
It is controlled by the PS1 variable and defines how the shell
prompt appears before each command. With this Bash Prompt Generator you
can visually create a custom PS1 prompt with colors, system information,
Git context and formatting.
Bash Prompt Generator is a browser tool that helps you build Linux prompts visually instead of writing PS1 syntax manually. You can assemble prompt elements, rearrange their order, customize colors and formatting, and instantly preview the final result. The generator supports practical fields such as date, time, user, host, directory path, command status, and Git information.
Once the layout is ready, the tool generates a valid PS1 string that can be copied directly into your shell configuration. This makes prompt customization easier for beginners and faster for advanced Linux users who frequently experiment with different terminal layouts.
The tool follows a simple workflow: build the prompt, customize styling, and export the final PS1 code.
PS1 string from the Prompt Code panel
and paste it into your shell configuration.The interface is designed for both desktop and mobile environments. On smaller screens you can reorder prompt elements directly inside the canvas while keeping the preview visible for quick adjustments.
Here are several common PS1 prompt layouts used in Linux terminals.
\u@\h \W $
Minimal prompt showing user, host and current folder.
\d{+%Y-%m-%d} \t \u \W $
Adds date and time to track terminal sessions.
\u on \h in \w $(git branch --show-current 2>/dev/null) $
Displays the active Git branch when inside a repository.
\n[\u|\h] \w \n$
Two-line prompt layout for better readability.
\d{+$?} \u \W $
Shows exit status of the last command for debugging.
\u - current username\h - short hostname\H - full hostname\w - full working directory\W - current folder name\d - current date\t - current time (24-hour format)\! - command history number\# - command count in the current session$? - exit status of the previous commandThese variables allow a Bash prompt to display useful context about the current session. By combining them with colors and formatting you can create prompts that are easier to read and safer to use when working across multiple servers or environments.
After generating a prompt in the tool, click Copy to Clipboard in the Prompt Code section. Then open your Bash configuration file:
nano ~/.bashrc
Add the generated PS1 line to the file:
PS1="your generated prompt"
Reload the configuration to apply the changes:
source ~/.bashrc
Open a new terminal window to verify that the prompt displays correctly. If necessary, return to the generator, adjust the layout, and copy the updated code again. Keeping a backup of the previous PS1 line allows easy rollback if you want to restore the original prompt.