🐧 Linux Basics

Navigation

pwd  # print working directory
cd   # change directory
ls -l # list files in long format
ls -la # list all files including hidden files
cd .. # go up one directory

Files & Directories

cp
mv
rm -rf
mkdir

Processes

ps aux
top
kill -9

πŸ“ Vim

Basic Commands

i          # insert mode
esc        # normal mode
:w         # save
:q         # quit
:wq        # save and quit

Navigation

h j k l    # move left, down, up, right
gg         # go to top
G          # go to bottom

πŸ’» Shell

Basic Commands

echo "Hello, World!"
cat file.txt
grep "pattern" file.txt

🐍 Python

Basic Commands

python3 script.py
pip install package
uv venv
source .venv/bin/activate
deactivate

πŸ—‚ SQL

Basic Commands

SELECT * FROM table;
INSERT INTO table (col1, col2) VALUES (val1, val2);
UPDATE table SET col1 = val1 WHERE condition;
DELETE FROM table WHERE condition;

🌱 Git & GitHub

Local Git Basics

git init
git status
git add .
git commit -m "message"
git log --oneline

Branching

git branch
git branch new-branch
git checkout new-branch
git switch -c new-branch
git merge main

Remote Repositories (GitHub)

git remote -v
git remote add origin git@github.com:user/repo.git
git push -u origin main
git pull origin main
git fetch

Undo / Fix

git restore file.txt
git reset HEAD file.txt
git reset --soft HEAD~1
git reset --hard HEAD~1

GitHub Workflow

# clone a repo
git clone git@github.com:user/repo.git

# typical workflow
git pull
git add .
git commit -m "update"
git push

🌐 Networking

Basic Commands

ping
curl
nslookup
traceroute

IP & Interface

ip addr
ifconfig
netstat -tuln

SSH

ssh user@host
scp file user@host:/path
ssh-keygen
ssh-copy-id

Nginx

nginx -t
systemctl restart nginx

🐳 Docker

Basic Commands

docker build -t image_name .
docker run -d -p host_port:container_port image_name
docker ps
docker stop container_id
docker rm container_id
docker rmi image_id

☸️ Kubernetes

Basic Commands

kubectl get pods
kubectl get services
kubectl apply -f deployment.yaml
kubectl delete -f deployment.yaml

☁️ AWS

Basic Commands

aws s3 ls
aws ec2 describe-instances
aws lambda invoke --function-name my-function output.txt
aws cloudformation deploy --template-file template.yaml --stack-name my-stack