Linux Cheat Sheet

Top Linux Commands find: Search for files and directories based on various criteria. find /path/to/search -name "*.txt" grep: Use advanced patterns and options for searching text. grep -E "pattern1|pattern2" file.txt awk: A powerful text processing tool for extracting and manipulating data. awk '{print $1}' file.txt sed: Stream editor for modifying text using patterns. sed 's/search/replace/' file.txt tar: Create or extract compressed archive files. tar -czvf archive.tar.gz /path/to/directory rsync: Synchronize files and directories between two locations....

March 5, 2024

Kubernetes Cheat Sheet

Create a Job which prints output $ kubectl create job hello --image=busybox:1.28 -- echo "Hello World" Create a CronJob that prints Hello World every minute kubectl create cronjob hello --image=busybox:1.28 --schedule="*/1 * * * *" -- echo "Hello World" Get all running pods in the namespace kubectl get pods --field-selector=status.phase=Running Check which nodes are ready JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}' \ && kubectl get nodes -o jsonpath="$JSONPATH" | grep "Ready=True" List Events sorted by timestamp kubectl get events --sort-by=....