Skip to content

Instantly share code, notes, and snippets.

@santiagosony
Last active March 14, 2026 17:02
Show Gist options
  • Select an option

  • Save santiagosony/4fff281e9122d206b0876e59f8d7ae24 to your computer and use it in GitHub Desktop.

Select an option

Save santiagosony/4fff281e9122d206b0876e59f8d7ae24 to your computer and use it in GitHub Desktop.
Linux Cheatsheet
### OS ###
# Get hostname
hostnamectl
hostname
# Get OS release
cat /etc/os-release
uname -a
lsb_release -a
# Repeats the same command by 1 sec
watch -n 1
# Fix locale mismatch
# enable local in /etc/locale.gen
# and run
locale-gen
#
getent
### FILES ###
whereis
tree
stat
pwd
ncdu (alt du)
dust (alt du)
fd OR fd-find (alt find)
### NETWORKING ###
# Get host IP
hostname -i
# Get open ports
netstat -tulpn
### TEXT ###
# Parse JSON
jq
# Best documentation
tldr
# Draw ins ASCII
figlet
### GKE ###
# To enable autocomplete for kubectl commands in bash
source <(kubectl completion bash)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment