improving your bash prompt with a prompt command
You stare at your prompt all day every day, so we might as well make it look a little nicer, right?
I recently migrated to using a PROMPT_COMMAND, which allows you to get very creative with your prompt, and wanted to share it with y’all.
Above you can see how my prompt looks like.
In order, we have,
a checkmark if last status was 0, x otherwise date/time when the prompt was printed (useful to time things if you forget to wrap them with time) hostname user current umask current path actual command prompt The first line that includes status and date was my most recent addition, and so far I’ve been enjoying it.