Cómo Linux agrega tiempo y parámetros de usuario a la historia

  
                

Bajo el sistema Linux, puede usar el comando de historial para ver el historial de las instrucciones. Para mejorar la eficiencia del comando de historial, también puede agregar algunos parámetros al comando de historial, como el tiempo, el usuario y los parámetros de IP. Entonces, ¿cómo agregar estos parámetros a la historia?

1. Ajuste del tiempo de visualización y el usuario:

Echo ‘ exportación HISTTIMEFORMAT = "% F% T `whoami` y " ’" "/etc /perfil

Ejecutar fuente para que tenga efecto:

fuente /etc /profile

Ver resultados:

historial

1852 2016-01-11 16:24 : 52 xubo hs

1853 2016-01-11 16:24:53 xubo ls

1854 2016-01-11 16:24:56 xubo history

1855 2016 -01-11 16:25:02 xubo history --help

1856 2016-01-11 16:26:35 xubo vi /etc /profile

1857 2016-01-11 16 : 27: 27 xubo echo ‘ export HISTTIMEFORMAT = "% F% T `whoami` " ’》 /etc /profile

1858 2016-01-11 16:27:29 xubo vi /Etc /profile

1859 2016-01-11 16:27:42 xubo source /etc /profile

1860 2016-01-11 16:27:46 xubo history

1861 2016-01-11 16:27:59 xubo ls

1862 2016-01-11 16:28:01 xubo history

1863 2016-01-11 16:31:00 Xubo claro

1864 2016-01-11 16:31:02 xubo history

2. Solo vea su propio registro de operación (hora, usuario, nombre de ip):

USER_IP = `who -u am i 2》 /dev /null

Copyright © Conocimiento de Windows All Rights Reserved