This question already has an answer here:

we have redhat Linux machine version 7.2

when we type history we get the history but without date and time

    1  ifconfig
    2  cd /etc/udev/rules.d/
    3  ls
    4  cat 99-vmware-scsi-udev.rules
    5  nano /etc/sysconfig/network-scripts/ifcfg-ethde032
    6  ifconfig
    7  service libvirtd statua
    8  service libvirtd status
    9  chkconfig -list | grep -i lib
   10  chkconfig -list
   11  chkconfig
   17  virsh net-destroy default
   18  virsh net-undefine default
   19  serice libvrtd
   20  serice libvirtd stop
   21  service libvirtd stop
   22  service libvirtd status

how to display from history command also the date & time for each number

marked as duplicate by muru, Rui F Ribeiro, Jeff Schaller, thrig, roaima Oct 29 '18 at 14:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


i used this command and it worked:
echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bashrc ; source ~/.bashrc
(for more details of how this command works read links in above comments)

Not the answer you're looking for? Browse other questions tagged or ask your own question.