1

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

1

1 Answer 1

3

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 .