This is the PS1 bash prompt I've been using for a while now. It shows the line number in bash history and the latest exit code. As well as the common info such as username, hostname and full pathname. Put this line in the startscript for bash, for me its ~/.bashrc (in a quite recent ubuntu release). It might be needed in ~/.bash_login as well.
PS1=\!,$? \u@\h:\w\$Example:
export PS1
502,0 username@hostname:/etc/init.d$ ls omgthisfiledoesnotexistls: cannot access omgthisfiledoesnotexist: No such file or directory503,2 username@hostname:/etc/init.d$
With this PS1 prompt it's very easy to backtrace to where the command occured using the history command.
Inga kommentarer:
Skicka en kommentar