Jump to Start
Moves your cursor to the beginning of the line. Perfect when you need to fix something at the start of a long command.
Speed up your workflow with keyboard shortcuts and helpful techniques
Master these shortcuts to work faster in the terminal
Moves your cursor to the beginning of the line. Perfect when you need to fix something at the start of a long command.
Moves your cursor to the end of the line. Useful after using arrow keys to navigate through history.
Deletes everything from cursor to the beginning. Quick way to start over without backspacing.
Deletes everything from cursor to the end. Handy when you want to keep the start but change the rest.
Removes the word before the cursor. Much faster than holding backspace.
Same as typing clear. Gives you a fresh, clean terminal window.
Stops the current running command. Essential when something is stuck or taking too long.
Closes the terminal session. Same as typing exit.
Browse through previously used commands. Press up to find that long command you typed earlier.
Completes file names, folder names, and commands. Type a few letters and press Tab to save time.
Learn from these common beginner errors
rmThe rm command permanently deletes files. There's no trash bin or undo.
$ rm -rf /
# ❌ NEVER DO THIS - Deletes everything!
Tip: Always double-check the file name before pressing Enter. Use ls first to verify.
Running commands in the wrong directory is a common mistake.
$ pwd
# Always check where you are first
Tip: Use pwd before running important commands.
sudoRunning commands as administrator (sudo) can be dangerous if you're not sure what the command does.
$ sudo rm important-file
# ❌ Bypasses safety checks
Tip: Only use sudo when you understand the command and really need it.
Level up your command line skills
Instead of typing full file names, type the first few letters and press Tab. The terminal will auto-complete it for you.
$ cd Doc[Tab]
$ cd Documents/
Press Ctrl + R and start typing to search through your command history. Much faster than pressing up arrow 50 times.
(reverse-i-search)`git': git commit -m "fix bug"
Make shortcuts for commands you use often. Add these to your .bashrc or .zshrc file:
alias ll='ls -la'
alias gs='git status'
alias ..='cd ..'
&& to Chain CommandsRun multiple commands in sequence. The next command only runs if the previous one succeeds.
$ mkdir new-project && cd new-project && git init
When something goes wrong, the terminal tells you why. Read the error message carefully—it usually explains the problem.
$ cd nonexistent-folder
cd: no such file or directory: nonexistent-folder
history CommandSee all your recent commands with history. You can even re-run a specific command by number.
$ history
1 cd Documents
2 ls -la
3 git status
$ !2
# Runs command #2 (ls -la)
Important differences between operating systems
/ for paths (e.g., /Users/name)~ or /Users/namels command works by default\ for paths (e.g., C:\Users\name)%USERPROFILE%dir instead of ls (or install Git Bash)Install Git Bash or use WSL (Windows Subsystem for Linux) to get a Unix-like terminal experience. This makes following tutorials much easier since most guides use Mac/Linux commands.