Learn about Centmin Mod LEMP Stack today
Become a Member

I would like to have timestamps at history commands

Discussion in 'Feature Requests & Suggestions' started by pamamolf, Feb 10, 2018.

  1. pamamolf

    pamamolf Well-Known Member

    4,003
    420
    83
    May 31, 2014
    Ratings:
    +812
    Local Time:
    10:52 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    Hello :)


    I found VERY useful to have the date and time at history command and i think it is easy to add to Centminmod so i am requesting it :)

    We just need to edit bashrc and add there:
    Code:
    export HISTTIMEFORMAT="%d/%m/%y %T "
    (not sure 100% that export needed but anyway)

    Hope that you agree with my George and add it to Centminmod automation :)

    Thank you
     
    Last edited: Feb 10, 2018
  2. eva2000

    eva2000 Administrator Staff Member

    49,887
    11,488
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,845
    Local Time:
    5:52 AM
    Nginx 1.21.x
    MariaDB 10.x
    already default in Centmin Mod for several years already

    Code (Text):
    history | grep cmdir
        8  [10.02.18] 05:37:09   cmdir
       10  [01.02.18] 23:02:47   cmdir
       23  [02.02.18] 09:51:18   cmdir
       82  [02.02.18] 12:02:35   cmdir
      778  [04.02.18] 13:05:20   cmdir
     1325  [05.02.18] 16:06:16   cmdir
     5993  [08.02.18] 15:36:01   cmdir
     6336  [10.02.18] 05:37:41   history | grep cmdir

    Code (Text):
    grep HIST /root/.bashrc
    HISTTIMEFORMAT="[%d.%m.%y] %T   "
    export HISTSIZE=10000
    export HISTTIMEFORMAT
    
     
  3. pamamolf

    pamamolf Well-Known Member

    4,003
    420
    83
    May 31, 2014
    Ratings:
    +812
    Local Time:
    10:52 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    I was test it on my old server and for a reason i don't have it there .....

    On a newer installation exist. So i will add it manually where i miss it.

    Thank you !
     
  4. eva2000

    eva2000 Administrator Staff Member

    49,887
    11,488
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,845
    Local Time:
    5:52 AM
    Nginx 1.21.x
    MariaDB 10.x
    Yeah very old 123.09beta01 might not have had that added yet.

    FYI if you browse centmin mod github repo files and search for keywords you can find the file it's referrenced in and then use blame mode to see where and when each line of code was added/modified i.e. inc/cpcheck.inc line 2215 to 2217 was add ~3yrs ago centminmod/inc/cpcheck.inc at 80369ff2b86bc28e40404c5166c9d76d4ba200b0 · centminmod/centminmod · GitHub in 123.08 betas. Actual commit March 10, 2015 custom history format - timestamped for .08 beta · centminmod/centminmod@3db877e · GitHub

    blame mode

    upload_2018-2-11_3-14-9.png