Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

prompt

BASH – customizing PS1 to run a command

August 7, 2022 by Magenaut

I wanted to modify my PS1 to run some commands every time. Let’s say I want it so that if the last executed command was successful, it would add a green smile at the end of PS1, otherwise the smile should be red.
I extracted it to a function:

Categories Q&A, Unix & Linux Tags bash, colors, prompt Leave a comment

How can I get my PS1 prompt to show time, user, host, directories, and Git branch

August 7, 2022 by Magenaut

I’ve seen others add all this information to their PS1 prompt.

Categories Q&A, Unix & Linux Tags bash, prompt Leave a comment

Show only current and parent directory in bash prompt

August 7, 2022 by Magenaut

I’m new to bash and would like my prompt to show something that in tcsh was trivial, yet after a good google search I still cannot do.

Categories Q&A, Unix & Linux Tags bash, prompt Leave a comment

How do I stop a bash shell PS1 color to stop at the end of the command?

August 6, 2022 by Magenaut

I have a custom PS1 colour where I have the actual shell commands in a distinct colour, just so I can quickly see what commands I typed and separate it from the command output itself.

Categories Q&A, Unix & Linux Tags bash, prompt Leave a comment
Newer posts
← Previous Page1 Page2 Page3
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress