Share your Bash prompts!
-
I'm looking for inspiration for a custom Bash prompt^[1]^. I'd love to see yours!
::: spoiler References
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
:::
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
computer /usr/share/ $>
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
-
I'm looking for inspiration for a custom Bash prompt^[1]^. I'd love to see yours!
::: spoiler References
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
:::
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
-
I'm looking for inspiration for a custom Bash prompt^[1]^. I'd love to see yours!
::: spoiler References
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
:::
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
Mine shows the full path and a new line for commands.
It will also print the exit code of the last command in red above the prompt, if the exit code is not 0.
PS1='$(ec="$?"; if [ $ec -gt 0 ]; then echo -e "\n"[\e[91m]"exit code: $ec"[\e[0m]; fi)\n[\e[92m]\u[\e[38;5;213m]@[\e[38;5;39m]\h[\e[0m]:$PWD\n$ '
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
-
I'm looking for inspiration for a custom Bash prompt^[1]^. I'd love to see yours!
::: spoiler References
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
:::
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
Mine is just status(if not zero) and wd
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
-
C:>
/s
Convert the PWD value to use backslashes, too, for extra cursedness.
-
Convert the PWD value to use backslashes, too, for extra cursedness.
c/FoundSatan
-
I'm looking for inspiration for a custom Bash prompt^[1]^. I'd love to see yours!
::: spoiler References
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
:::
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
[username@host ~]$ >
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
-
I'm looking for inspiration for a custom Bash prompt^[1]^. I'd love to see yours!
::: spoiler References
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
:::
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
and rather elaborate. From left-to-right:
- name@server-name
- Uptime (multiplied by 10 and rounded to the nearest integer to save space)
- Percentage disk space available on
/
- Number on established network connections
- Git branch
:
commit - Python virtualenv
- [new line]
- date and time
The code for this is on GitLab.
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
-
I'm looking for inspiration for a custom Bash prompt^[1]^. I'd love to see yours!
::: spoiler References
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
:::
- Β§6.9 "Controlling the Prompt". URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
- Type: Documentation. Title: "Bash Reference Manual". Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
-