So, when running FreeBSD, i used csh, and used a prompt that began with : and ended with ; so that i could copy/paste commands by just highlighting entire lines and the prompt was commented out.
I’ve been messing with my prompt in bash (used to always just with [email protected]:/dir).
I think I’ve settled on (for now):
PS1="# \t - \[email protected]\h:\w\n\n"
Which gives me something like this
# 10:26:29 - [email protected]:~ ls Desktop Downloads Pictures source Videos Documents Music Public Templates VMware # 10:26:32 - [email protected]:~
I like this for the following reasons:
- I have a datestamp on any commands i ran, so i can do retroactive post mortem if i fuck things up.
- i can copy/paste entire previous commands without needing to extract the prompt. If there are a series of commands with no output displayed, i can just highlight many lines and the prompt is hashed out and will do nothing.
- the extra new-line, whilst taking up vertical space makes it very clear where a command-line begins and ends.
Anyone have any other nifty prompt tricks?
i might add colour, but that’s just going to be for further clarity… with csh i set up root’s prompt to be RED instead of blue or white so it was abundantly clear you were logged in as a potentially destructive user.
Might also add the date. I definitely think i prefer having the prompt with relevant info on its own line…