Skip to content

Instantly share code, notes, and snippets.

@volkbay
Last active July 6, 2023 14:49
Show Gist options
  • Save volkbay/1c47f6dc7d9b5aeaf84c8e0f82d04f11 to your computer and use it in GitHub Desktop.
Save volkbay/1c47f6dc7d9b5aeaf84c8e0f82d04f11 to your computer and use it in GitHub Desktop.
Adding time information to your bash command history

💰 Tip

This is useful tip when you need to check exact time of a bash command you've run in the past. You can check your CLI command history by history command on your terminal.

Warning Time information will be recorded in your system as soon as you make to following changes. The commands prior to that will not have correct dates.

Solution is to identify HISTTIMEFORMAT variable. The following command line can be pasted in ~/.bashrc file.

    HISTTIMEFORMAT="%F %T "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment