bash

  • redirect to file
1
cmd >>file.log 2>&1

Compressing

  • compressed to volumes
1
2
# 100m 1G
tar jcf - 2017.log | split -d -b 100m - logs.tar.bz2.
  • uncompressed by volumes
1
cat logs.tar.gz* | tar jx
  • Check which listen to the port
1
2
lsof -nP -iTCP -sTCP:LISTEN
lsof -nP -i:[port-number]
  • random 32-bits password
1
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1

Reboot

1
2
3
who -b
last -x | head | tac
sudo journalctl --list-boots
  • set timezone
1
sudo timedatectl set-timezone UTC