To view all of the 300+ tutorials on Simple Dev, sign up for a 10-day free trial below.

Terminal Basics

Summary

Below you will find a collection of tutorials on the basics of using the terminal.

Before You Start

These tutorials assume no prior knowledge of the subject.

Exercises

You can download exercises to go along with these tutorials on our Terminal exercises GitHub repository. You don’t have to know how to use GitHub to use them. Just click the green Code button in the corner and click the Download ZIP option. Then unzip the folder and open it in your text editor.

Tutorials

Introduction

Why should I use the terminal?

Learn why you should use the terminal.

Setup

Learn how to set up your terminal for macOS and Windows.

Understanding the prompt

Learn about the different parts of the prompt.

Basic commands

Change directories

cd folder-name/

Move up a directory

cd ..

Move into your user directory

cd ~

Show files and folders in a directory

ls

Create a file

touch file-name

Create a folder

mkdir folder-name

View file contents

cat my-file
less my-file

Tips

Reuse previous commands

To reuse previous commands, press the up arrow key.

Complete the name of a directory or file

To complete the name of a directory or file in your terminal, type one or more characters, then press Tab.

Learn more about a command

man command-name

Move through text using these keyboard shortcuts

Learn how to move through text in your terminal using keyboard shortcuts.

Advanced commands

Move file or folder

mv my-file my-folder
mv first-folder second-folder

Rename file or folder

mv current-name new-name

Copy file or folder

cp file-name folder1
cp -R folder1 folder2

Delete file

Warning: You can’t undo this action!

rm file-name

Delete folder

rmdir folder-name