Home
PHP
Tech Tube
MySQL
Linux
CSS&HTML
JavaScript

Logs and history tricks

The article will contain some useful tricks related to Linux logs and history Store date and time in the history log: https://samiwell.eu/linux/bashrc Disable linux histroy:
set +o history
Enable linux histroy:
set -o history
Show last logins:
last
Clear the logs for the last logins (as root only):
sudo su
>/var/log/lastlog
>/var/log/wtmp
>/var/log/btmp
The shell history file
~/.bash_history
Set bash history to 2038-01-01
touch -a -m -t 203801010000.00 ~/.bash_history
Disable history and hide the trails. In the example 2000 is the last line in the history log. Don't forget to add spaces before your commands.
history | tail
HISTCONTROL=ignorespace && history -d 2000 && history -d 2000