:::: MENU ::::

Display time with history command

  • Apr 07 / 2017
  • 0
Linux

Display time with history command

When you are using the history command on a UNIX system, by default, you’re only getting an action list with numbers but no date and/or time to complete this history. For that, you have to define an environment variable HISTTIMEFORMAT that will describe how you want to display the timestamp for each command.

To display the timestamp temporarily (during session), you can just export the variable before sending the command:

You will get:

If you want to keep that display for a future session, you have to add this variable to your bash profile and reload your profile:

Share...Share on Google+Tweet about this on TwitterShare on RedditShare on LinkedInShare on FacebookEmail this to someone

Comments are closed.

Question ? Contact