The commands a network engineer actually uses on a Linux box, and enough Git to work in a team.
🖨 Print or save as PDF
Network state Command Shows ip addrInterfaces and addresses ip routeThe routing table ip linkLink state and MAC addresses ip neighThe ARP table ss -tulpnListening ports and the process behind each
Testing reachability Command Use ping -c 4 <host>Basic reachability and round-trip time traceroute <host> or mtr <host>The path, hop by hop dig <name>DNS lookup with details nc -zv <host> <port>Is a TCP port open? curl -v https://<host>Full HTTP and TLS conversation tcpdump -ni eth0 port 443Capture packets on an interface
Files, logs and system Command Use grep -i error file.logFind lines containing a word tail -f file.logWatch a log as it grows less filePage through a file; / to search journalctl -u <service> -fFollow a service log systemctl status <service>Is a service running? df -h / free -hDisk and memory topWhat is using CPU scp file user@host:/pathCopy a file over SSH
Git: the daily loop Six steps, every working day git pull get the latest git switch -c new branch edit make the change git add stage it git commit save with a message git push share, open a pull request The loop in one picture Command Use git clone <url>Get a copy of a repository git switch -c my-changeStart a branch for your work git statusWhat changed? git diffExactly what changed, line by line git add <file>Stage a change git commit -m "message"Record it with a note git push -u origin my-changeSend the branch to the server git pullBring in other people's changes
Git: getting out of trouble Command Use git log --onelineHistory, one line per change git stashPut unfinished work aside git restore <file>Throw away local edits to a file git revert <commit>Undo a change with a new commit (safe on shared branches)
Team workflow: branch, commit, push, open a pull request, get a review, merge. Never commit passwords or keys.
CCIE Journals cheat sheet. Free to print and share for study.
0 Comments
Post a Comment