About the IP address format in the configuration file is/etc/profile configuration content:
# Improve the history content format
USER_IP=` -u who am i. 2 & gt;/dev/null | awk '{print $NF}' | sed -e 's/[()]//g' `
If [" $USER_IP "=" "]. Then
USER_IP=` hostname `
Fi
Export HISTTIMEFORMAT="% F % T ${USER_IP}"
Can be seen from the screenshot below, including the date of the % F % T time, save in the form of a timestamp in ~/. Bash_history historical records in the file, but not the IP address, so I would like to how to make the IP address and save to this file, so that history can print different network to connect to the system in the execution of orders: