SL

Fun Linux Commands

A cache of useful linux commands

General / Basic:

  • dpkg-reconfigure tzdata --> set timezone
  • htop
  • nettop
  • nethogs
  • tasksel --> package installation (LAMP)
  • less xxxx.log --> / to search and G goes to the end
  • journalctl -f or dmesg --> syslog follow

Packages:

  • apt list --upgradable
  • apt upgrade --show-upgraded

Networking:

  • lsof -iTCP -sTCP:LISTEN
  • lsof -iTCP -sTCP:ESTABLISHED
  • lsof -UDP
  • ufw status
  • hostname --> host
  • hostname -f --> fqdn
  • hostname -F XXX.XXX --> set fqdn

Disk:

  • df -h --> disk usage all partitions
  • du -hc | sort -rh | head -20 --> show file/folder sizes with total, add sort, then show only top 20

Files:

  • /etc/hostname
  • /etc/hosts

© SLC 2023