Explain a command
Paste any command and I will show you what each part does.
Commands already broken down
The lines people look up most. Each one opens a full breakdown you can run in the sandbox.
- ls -laShow every file, hidden ones included, as a detailed list.
- rm -rfDelete a folder and everything in it without asking — the most dangerous command there is.
- mkdir -pCreate nested folders in one go.
- grep -rniFind text in every file recursively, ignoring case, with line numbers.
- cat … | grepFeed a file's contents into grep through a pipe.
- find -nameFind every file matching a name pattern in this folder and the ones inside it.
- chmod +xMake a file executable so you can run it like a program.
- echo > fileWrite text into a file, replacing whatever was in it.
- echo >> fileAdd a line to the end of a file without erasing what's already there.
- tail -nShow the last 20 lines of a file — handy for logs.
- head -nShow the first 5 lines of a file.
- wc -lCount the lines in a file.
- sort | uniqSort the lines and drop the repeats.
- cp -rCopy a whole folder, contents and all.
- git initStart a new Git repository in the current folder.
- git add .Stage every change for the next commit.
- git commit -mSave a snapshot of your changes with a message.
- git statusSee which files changed and what's staged for the next commit.
- git pushSend your commits to a remote repository (GitHub, for example).
- npm installInstall all of the project's dependencies from package.json.
- npm run buildRun the project's build.
- node app.jsRun a JavaScript file with Node.js.
- export NAME=…Create an environment variable for this session.
- aliasMake a short alias for a long command.