Remember that you can use AI tools to help you debug any errors or help answer any questions you might have. You can also use the cheatsheet below to help you with command line syntax.

Command Line Cheatsheet for Windows

SHORTCUTS

Command Description
Tab Auto-complete files and folder names
Up Arrow Scroll through previous commands
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + R Lets you search through previously used commands
Ctrl + C Kill whatever you are running
exit Exit the current shell

SHELL COMMANDS

Command Description
cd Print full working path
dir or gci List contents of a directory
chdir [folder] or sl Change into a directory
sl .. Go one directory up
cls Clear the view
open [file] Opens a file
open . Opens the directory
ni [file name] Creates a new file
del [file name] Remove a single file
ni -ItemType dir [directory name] Make a new directory
copy [file] [new file/new directory] Copy file to file or new directory
move [file] [new file/new directory] Move file into new file or directory
rmdir [directory] Remove directory ( only operates on empty directories )
rmdir /s [directory name] Force remove a directory and all its contents
help Prints all possible commands

Advanced Commands

Command Description
sudo [command] Run command with the security privileges of the superuser (Super User DO)
cp *.js Use wildcards to get all files of a certain type when moving or copying
edit [file] Opens file in Terminal editor
exit Exit

Command Line Cheatsheet for MacOS

SHORTCUTS

Command Description
Tab Auto-complete files and folder names
Up Arrow Scroll through previous commands
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + R Lets you search through previously used commands
Ctrl + C Kill whatever you are running
Ctrl + D Exit the current shell

SHELL COMMANDS

Command Description
pwd Print full working path
. Current folder
cd [folder] Change into a directory
cd .. Change directory upwards
ls List contents of a directory
ls -la List all contents including hidden files
clear Clear the view
open [file] Opens a file
open . Opens the directory
touch [file name] Creates a new file
rm [file name] Remove a single file
mkdir [directory name] Make a new directory
cp [file] [new file/new directory] Copy file to file or new directory
mv [file] [new file/new directory] Move file into new file or directory
rmdir [directory] Remove directory ( only operates on empty directories )
rm -rf [directory name] Force remove a directory and all its contents

ADVANCED COMMANDS

Command Description
sudo [command] Run command with the security privileges of the superuser (Super User DO)
cp *.js Use wildcards to get all files of a certain type when moving or copying
!! Use double bang to repeat last command
nano [file] Opens file in Terminal editor
q Exit

Updated: