Best 2 Know

The Ultimate Blogging Resource

  • Advertising
  • WebHosting
  • Contact Us
  • Blogger
    • Blogger Templates
    • Blogger Tutorials
  • Browser
    • Firefox
    • Google Chrome
  • Google
  • Internet
    • Facebook
    • Twitter
  • Thesis
  • Windows
  • WordPress
    • WordPress Themes
    • WordPress Plugins
  • More
    • Linux
    • Review
    • Solutions
    • Announcements

How to Check the Time of the Executed Command


We always check our History and Mostly for the work we have done. why do we save command history ? or what is the need to know when was it executed? the all questions are simple to answer. once you have install or edit something and now you need to again know how you did it then you just have to remember the time you did it and just See the command history you will get what you need.

To Check the time of the executed command, the environment variable for bash needs to be set as HISTTIMEFORMAT. After setting the variable you need to just execute the following command :

export HISTTIMEFORMAT="%F %T "

export HISTTIMEFORMAT="%F %T "

Now, Check the history by executing the command below.

history

history

This Command will show you the History in the following format (Just and Example) :

  131  2011-02-25 19:28:22 /opt/lampp/lampp start
  132  2011-02-25 19:28:22 sudo su
  133  2011-02-25 19:28:22 sudo /etc/init.d/nscd restart
  134  2011-02-25 19:28:22 sudo aptitude install nscd
  135  2011-02-25 19:28:22 sudo apt-get install nscd
  136  2011-02-25 19:28:22 sudo /etc/init.d/nscd restart
  137  2011-02-25 19:28:22 sudo su
  138  2011-02-25 19:28:22 service nscd remove
  139  2011-02-25 19:28:22 service nscd status
  140  2011-02-25 19:28:22 service nscd force-reload
  141  2011-02-25 19:28:22 sudo service nscd force-reload
  142  2011-02-25 19:28:22 service nscd status
  143  2011-02-25 19:28:22 sudo service nscd start
  144  2011-02-25 19:28:22 sudo su
  145  2011-02-25 19:28:22 ping www.zerotech.in
  146  2011-02-25 19:28:22 setip
  147  2011-02-25 19:28:22 getip
  148  2011-02-25 19:28:22 sudo su
  149  2011-02-25 19:28:25 history
  150  2011-02-25 19:28:53 export HISTTIMEFORMAT="%F %T "
  151  2011-02-25 19:28:59 history

131 2011-02-25 19:28:22 /opt/lampp/lampp start 132 2011-02-25 19:28:22 sudo su 133 2011-02-25 19:28:22 sudo /etc/init.d/nscd restart 134 2011-02-25 19:28:22 sudo aptitude install nscd 135 2011-02-25 19:28:22 sudo apt-get install nscd 136 2011-02-25 19:28:22 sudo /etc/init.d/nscd restart 137 2011-02-25 19:28:22 sudo su 138 2011-02-25 19:28:22 service nscd remove 139 2011-02-25 19:28:22 service nscd status 140 2011-02-25 19:28:22 service nscd force-reload 141 2011-02-25 19:28:22 sudo service nscd force-reload 142 2011-02-25 19:28:22 service nscd status 143 2011-02-25 19:28:22 sudo service nscd start 144 2011-02-25 19:28:22 sudo su 145 2011-02-25 19:28:22 ping www.zerotech.in 146 2011-02-25 19:28:22 setip 147 2011-02-25 19:28:22 getip 148 2011-02-25 19:28:22 sudo su 149 2011-02-25 19:28:25 history 150 2011-02-25 19:28:53 export HISTTIMEFORMAT="%F %T " 151 2011-02-25 19:28:59 history

Hope you like it , I would love to have your feedback

Subscribe via Email

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to print (Opens in new window) Print
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to email a link to a friend (Opens in new window) Email

Related

February 26, 2011 Ritesh Sanap Linux bash, Command, command history, executed command, History, How To, linux

Comments

  1. Sid says

    May 8, 2011 at 3:22 am

    Thanks a lot. Was searching for this option for so long.

    Reply
    • Ritesh Sanap says

      May 18, 2011 at 8:36 pm

      Thanks , its great that you got what you were looking for if you need anymore help then do say.

      Reply

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post navigation

Previous Previous post: How to Change Default SSH Port
Next Next post: How to Turn off/ Remove Admin bar in WordPress

Currently Trending

  • How to download Specific parts of YouTube videos
    How to download Specific parts of YouTube videos
  • Windows Vista CD key
    Windows Vista CD key
  • How to retrieve my Demonoid username
    How to retrieve my Demonoid username
  • How to add Logo to Thesis theme
    How to add Logo to Thesis theme
  • How to Delete Feedbacks from JetPack Contact Form
    How to Delete Feedbacks from JetPack Contact Form
  • List Of All 255 Keyboard All Alt Key Codes
    List Of All 255 Keyboard All Alt Key Codes
  • h4x0r ( Hacker ) - Blogger Template
    h4x0r ( Hacker ) - Blogger Template

Get Latest post in your Inbox

Random Posts

Add Social Bookmarking Icons After Every Post In Blogger Blog

April 29, 2010 By Ritesh Sanap 8 Comments

How to show 10 posts instead of 5 posts in blogger

April 16, 2010 By Ritesh Sanap Leave a Comment

How to host javascript on blogger

June 21, 2010 By Ritesh Sanap 5 Comments

FastestFox – Browse Faster

October 19, 2010 By Ritesh Sanap Leave a Comment

Explorer.exe Deleted Or Taskbar Deleted

April 9, 2009 By Ritesh Sanap Leave a Comment

WordPress

HTTP2 Server Push for W3 Total Cache Minify plugin

August 17, 2016 By Ritesh Sanap 5 Comments

How to Disable Emojis in WordPress

January 6, 2016 By Ritesh Sanap Leave a Comment

JetPack Related posts and Sharing not working with NGINX

November 10, 2015 By Ritesh Sanap Leave a Comment

Simply Pure – WordPress Theme

November 2, 2014 By Ritesh Sanap 2 Comments

Advanced What should we Write about next? – WordPress Plugin

July 28, 2014 By Ritesh Sanap Leave a Comment

How to Disable Self Pingback or TrackBack

January 16, 2014 By Ritesh Sanap Leave a Comment

BlueStrap – WordPress Theme

January 1, 2014 By Ritesh Sanap 15 Comments

How to Create Multiple Excerpts in WordPress

December 24, 2013 By Ritesh Sanap Leave a Comment

How to Disable Auto Update in WordPress

November 21, 2013 By Ritesh Sanap Leave a Comment

How to Delete Feedbacks from JetPack Contact Form

November 19, 2013 By Ritesh Sanap 9 Comments

Recent Posts

  • HTTP2 Server Push for W3 Total Cache Minify plugin
  • How to show hidden files and folders in Mac OS X
  • How to Disable Emojis in WordPress
  • Canva – Online Photo Editor
  • JetPack Related posts and Sharing not working with NGINX

Archives

Recommends

  • DigitalOcean – Cloud Hosting
  • Dropbox – Cloud Storage
  • Elegant Themes – WordPress Themes
  • LastPass – Password Manager
  • Like us on Facebook
  • Follow on Twitter
  • +1 on Google
  • Subscribe via Email
  • RSS Feed

© 2025 Best 2 Know · All Rights Reserved · We ♥ DigitalOcean