Jun
4

When did you execute a command in Linux?

Here is a tip that will help you understand when you did what. history will give the list of commands which you have executed earlier. If you want the information on when you executed these commands, you need to do the following.

 

Open the /etc/bashrc file in a text editor and add the following:

 

export  HISTTIMEFORMAT="%h/%d - %H:%M:%S"

After adding this line, re-login into the terminal and execute the history command again. Now you will see the commands along with their time of execution. Here is the example

975 Jun/04 – 01:33:19bc
976 Jun/04 – 01:33:19~./bashrc
977 Jun/04 – 01:33:19~/.bashrc
978 Jun/04 – 01:33:19sudo ~/.bashrc
979 Jun/04 – 01:33:19~/.bashrc
980 Jun/04 – 01:33:19vi ~/.bashrc
981 Jun/04 – 01:33:19source .bashrc
982 Jun/04 – 01:33:19calc 1+1
983 Jun/04 – 01:33:19vi ~/.bashrc
984 Jun/04 – 01:33:19vi /etc/bashrc
985 Jun/04 – 01:33:31history

1 Comment to “When did you execute a command in Linux?”

Post comment

Follow us on Twitter! Follow us on Twitter!
http://twitter.com/efheem
The next version of Ubuntu is coming soon

Recent Posts

Recent Comments

Firefox Download Button
Google Analytics Alternative Add to Technorati Favorites Technology Blogs - BlogCatalog Blog Directory Free Hit Counter Technology Google Analytics Alternative Blog Buzzer