Quick Reference



Linux Commands


CMD Commands

Common Terminal Commands (macOS/Linux vs Windows PowerShell)
TaskmacOS / LinuxWindows (PowerShell)Example
Show current directorypwdGet-Location (alias: pwd)pwd
List fileslsGet-ChildItem (alias: ls)ls -la
Change directorycdSet-Location (alias: cd)cd projects
Move up one directorycd ..Set-Location (alias: cd ..)cd .. projects
Make directorymkdirNew-Item -ItemType Directory (alias: mkdir)mkdir assets
Remove empty directoryrmdirRemove-Item -Force (alias: rmdir)rmdir old
Remove directory (recursive)rm -rRemove-Item -Recurserm -rf build
Copy filecpCopy-Item (alias: cp)cp a.txt b.txt
Move/RenamemvMove-Item (alias: mv, ren)mv app.js app.old.js
Delete filermRemove-Item (alias: rm, del)rm notes.tmp
View file (print)catGet-Content (alias: cat, type)cat README.md
Paged viewless / moremoreless big.log
Search in filesgrepSelect-String (similar to grep)grep -R "TODO" .
Find files by namefindGet-ChildItem -Recursefind . -name "*.js"
Show running processesps / topGet-Processps aux
Kill processkill / kill -9Stop-Process / taskkill.exekill -9 12345
Show usernamewhoamiwhoami (or $env:USERNAME)whoami
Environment variablesprintenv / exportGet-ChildItem Env: / $env:VAR=printenv PATH
Make empty filetouchNew-Item file.txt (or > file.txt)touch .gitignore
Download HTTPcurl / wgetInvoke-WebRequest (alias: curl, iwr)curl -O https://example.com/file.zip
Archive (tar)tartar (on recent Windows) / Compress-Archivetar -czf site.tgz dist/
Disk usagedu -shGet-ChildItem | Measure-Object -Sum Lengthdu -sh *
Free disk spacedf -hGet-PSDrivedf -h
Network configifconfig / ipipconfigipconfig
Ping hostpingpingping example.com
Change file modechmod(No direct equivalent; use file properties/ACLs)chmod +x script.sh
Change ownerchown(Use icacls / Set-Acl)sudo chown user:group file
Print textechoWrite-Output / echoecho "Hello"
Show manual/helpmanGet-Helpman ls

npm Commands

CommandAliasPurposeExampleNotes
npm initCreate a package.jsonnpm init -y-y skips prompts with defaults.
npm --versionnpm -vCheck installed version of npm
npm install <pkg>npm iInstall a dependencynpm i reactSaved to dependencies by default.
npm install --save-dev <pkg>npm i -DInstall a dev dependencynpm i -D typescriptSaves under devDependencies.
npm installnpm iInstall from package.jsonnpm installReads versions from package.json/package-lock.json.
npm uninstall <pkg>npm remove, npm rmRemove a dependencynpm uninstall lodashUpdates package.json and lockfile.
npm updatenpm upUpdate deps within semver rangesnpm upUses ranges in package.json.
npm outdatedShow available updatesnpm outdatedCompares current, wanted, latest.
npm run <script>Run a script from package.jsonnpm run buildScripts are under "scripts".
npm startRun scripts.startnpm startShortcut for npm run start.
npm testnpm tRun scripts.testnpm testShortcut for npm run test.
npm exec <bin>npm xRun a package binarynpm exec eslint .Uses local node_modules/.bin if present.
npx <bin>Execute a package (no install)npx create-vite@latestConvenience tool bundled with npm.
npm listnpm lsList installed packagesnpm ls --depth=0Add --depth=0 for top-level only.
npm view <pkg>npm v, npm infoShow package metadatanpm view react versionGreat for checking latest versions.
npm auditScan for vulnerabilitiesnpm auditUse npm audit fix to apply fixes.
npm cache clean --forceClear npm cachenpm cache clean --force--force required for cleaning.
npm ciClean install from lockfilenpm ciFaster, reproducible installs (CI).
npm linkSymlink a package for local devnpm linkUse in package & consumer repos.
npm packCreate a tarball of the packagenpm packUseful to inspect what will publish.
npm publishPublish to the registrynpm publish --access publicRequires login & proper settings.
npm login / logoutAuthenticate with the registrynpm loginStores credentials for publish, etc.
npm version <type>Bump version & tagnpm version patchpatch | minor | major or exact.
npm pruneRemove extraneous packagesnpm pruneKeeps only what’s in package.json.
npm dedupenpm ddpReduce duplicate dependenciesnpm dedupeFlattens dependency tree where possible.
npm config get/setManage npm confignpm config set registry <url>Use --global for global config.
npm doctorDiagnose common issuesnpm doctorChecks environment & configuration.
npm fundShow funding infonpm fundLists packages seeking funding.
npm explain <pkg>Explain why a pkg is installednpm explain ansi-regexShows dependency path(s).