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:

  • Twitter
  • Facebook
  • Pocket
  • Print
  • Email

Related

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

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
  • Windows Vista CD key
  • How to Increase Dropbox upload speed
  • How to Change the Welcome/Login Screen in Windows XP ?
  • ZooZooo - Vodafone Logos
  • You might also like this Widget for blogger or Related post widget
  • HTTP2 Server Push for W3 Total Cache Minify plugin
  • How to download torrents without utorrent
  • HORIZONTAL AND VERTICAL SPACING
  • How to download Subtitles from YouTube Videos

Random Posts

How to Change Drive Letter and Customize

May 16, 2010 By Ritesh Sanap Leave a Comment

How to add Favicon to your WordPress site

February 3, 2012 By Ritesh Sanap Leave a Comment

How to Copy files from Google Drive to DropBox or Box.net - Mover.io

December 24, 2013 By Ritesh Sanap 1 Comment

HTTP2 Server Push for W3 Total Cache Minify plugin

August 17, 2016 By Ritesh Sanap 5 Comments

Total Posts and Total Comments Widget

April 18, 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

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

This website uses cookies to improve your experience. We'll assume you're ok with this, If you do not want to accept cookies, adjust your browser settings to deny cookies or exit this site. Accept
Privacy & Cookies Policy
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.