Programación Para Tontos

Herramientas

Tutorial: the terminal for beginners - your first commands

Lose your fear of the terminal by learning the commands you'll actually use every day.

The terminal looks like it's straight out of a hacker movie, but it's really just a way to give your computer instructions by typing text instead of clicking. Let's lose the fear with the commands you'll actually use.

Step 1: where am I?

pwd

pwd (print working directory) tells you which folder you're currently standing in. It's the "you are here" of a mall map, but for your file system.

Step 2: what's in here?

ls

ls (list) shows the files and folders inside wherever you are. On Windows with PowerShell, the equivalent command is dir (or ls also works in newer versions).

Step 3: move between folders

cd Documents
cd ..
cd /

cd (change directory) moves you to another folder. cd .. goes up one level (to the "parent" folder). cd / takes you to the root of the whole system. No mouse, no double-click, just text.

Step 4: create folders and files

mkdir my-project
cd my-project
touch index.html

mkdir creates a new folder. touch creates an empty file (on Windows with PowerShell, use New-Item index.html instead).

Step 5: clear the screen when you can't stand the mess anymore

clear

(On Windows: cls). It doesn't delete anything from your project, it just visually clears the terminal. Use it freely whenever the screen starts feeling like a window covered in sticky notes.

What did you just learn?

  • How to know where you are (pwd) and what's there (ls).
  • How to move between folders with cd.
  • How to create folders (mkdir) and files (touch) without touching the mouse.