1

Does/can Bash history store the location where a command was run in addition to what the command was and the date?

I'm trying to retrace some commands that were run and trying to work out which folder they were run in.

1

Bash does not store the name of the current working directory in its history, but may be made to store a timestamp by setting the HISTTIMEFORMAT to a strftime(3) format string:

HISTTIMEFORMAT="%F %T"

will create timestamps on the form "YYYY-MM-DD HH:MM:SS".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.