jvinhit//lab

Search posts

Type to search across journal entries.

navigate open esc close

Series · 10 parts

Command Line cho Developer - Commands, Bash Script & Workflow

Series tiếng Việt dạng handbook/cookbook cho developer làm việc trong terminal mỗi ngày: điều hướng file, đọc log, tìm code với rg/find, pipe và redirection, Git workflow, curl+jq để debug API, process/port/network debugging, Node package manager, Docker/SSH, và cách gom tất cả thành bash script tự động hóa an toàn.

  1. Nền tảng terminal cho developer: prompt, cwd, command/args/flags, exit code, path, ls/cd/pwd, tạo-di chuyển-copy-xóa file, shortcut và bài tập.

  2. Các lệnh đọc file và log hằng ngày: cat, less, head, tail -f, wc, file, du, df, sort, uniq, cut, diff và cách inspect output không mở editor.

  3. Tìm kiếm codebase như senior: rg cho nội dung, find/fd cho file, glob/exclude, context lines, file list, null separator và recipe tìm config/TODO/symbol.

  4. Ghép command thành workflow: stdin/stdout/stderr, pipe, >, >>, 2>, tee, command substitution, xargs, while read và pattern xử lý file hàng loạt an toàn.

  5. Git CLI hằng ngày cho developer: status, diff, add -p, commit, log, branch/switch, stash, restore, rebase/pull, review trước khi push và rollback an toàn.

  6. Debug HTTP API bằng terminal: curl GET/POST, headers, auth, status code, redirects, timeout, verbose mode, lưu response và jq để đọc/lọc JSON.

  7. Debug máy dev bằng CLI: ps, pgrep, kill, lsof, ss/netstat, nc, top/htop, env, PATH, command -v, df/du và recipe xử lý port bị chiếm.

  8. Workflow Node/package manager trong terminal: node/npm/pnpm version, corepack, npm run, pnpm exec/dlx, npm ci, frozen lockfile, env vars, npm ls và pnpm why.

  9. Command line cho môi trường thật: ssh config, scp, rsync, tail log remote, docker ps/logs/exec/cp/stats, compose up/logs/exec/down và checklist debug container.

  10. Capstone command line: khi nào viết script, template bash an toàn, strict mode, trap cleanup, require_cmd, dry-run, parse args đơn giản và project doctor script.