While Googling how to customize my shell prompt via the PS1 variable, I'm seeing tables of special characters that can be used. In particular:
\! the history number of this command
\# the command number of this command
"History number" seems to be more commonly used, and I know how to use commands like !523
to redo commands from history. But I can't figure out if "command number" has similar functionality. I've tried putting \#
in my PS1 variable, and it seems to output the number of commands entered in a particular session (unlike \!
, which persists after logout/exit).
Anyone know how to use "command number" in a convenient or meaningful way?