shell-mastery — Power Moves
One-Liner Power Moves (impress the hermits)
Count lines of code by language
find . -name "*.py" -o -name "*.sh" -o -name "*.adoc" | xargs wc -l | sort -rn | head -20
Generate a random password
< /dev/urandom tr -dc 'A-Za-z0-9!@#$%' | head -c 32; echo
Create a quick HTTP server
python3 -m http.server 8080
Watch a command (refresh every 2s)
watch -n2 'ss -tlnp | grep LISTEN'
Parallel execution
cat servers.txt | xargs -P4 -I{} ssh {} "uptime"
Base64 encode/decode
echo "secret" | base64
echo "c2VjcmV0Cg==" | base64 -d
Quick checksum
sha256sum file.txt
echo -n "string" | sha256sum
Hex dump
xxd file.bin | head -20
od -A x -t x1z file.bin | head -20