1 of 32

The Command-Line for Beginners

An Introvert's Guide to Crawling into Your Shell

with Eric Poe

2 of 32

Chapter 1: Fear

3 of 32

Why The Terminal Feels Scary

It looks like a black box.

Where’s the undo button?

You type something and it yells at you.

We’ve all been there

4 of 32

A Different Kind of Conversation

The shell isn’t judging you – It’s listening carefully

Just like programming, it does exactly what you tell it to do.

Or maybe, it does what you ask it to do

You are having a conversation with your computer, not commanding it

Don’t command, converse!

5 of 32

My Journey into the Shell

Started with a blinking cursor on an IBM PCjr

Enjoyed the direct control of the computer

Today, I use it to configure, debug, and deploy

You don’t need decades of experience—�You need curiosity

6 of 32

Chapter 2: Curiosity

7 of 32

Meet Your Companion: The Shell

🪟 Terminal: A window to talk to your OS

⌨ Command Line: Where you speak

🐚 Shell: A program that interprets what you say

8 of 32

Your First Words

You are not memorizing spells�—you are learning a language

pwd “Where am I?”

ls “What’s around me?”

cd “Let’s go somewhere”

rm “Eww, throw that away!”

9 of 32

Why Developers Still Love the CLI

  • It’s faster than the GUI
  • It’s precise and repeatable
    • It’s scriptable
  • There’s a lot of overlap between MacOS & Linux
  • There’s some overlap between MacOS/Linux and Windows

Ex: Copy a Directory from Your Downloads folder to your Documents folder

cp -R ~/Downloads/foo ~/Documents/

10 of 32

The Power of Small Wins

Find a file in seconds:

  • find ./ -name 'secrets.php'
  • find ./ -name '*.md'

See what’s running:

  • top
  • htop

Know yourself:

  • uname -a
  • whoami

Know your space:

  • df -hP

11 of 32

Congratulations!

You now know how to ask your computer questions and get answers!

12 of 32

Chapter 3: Clarity

13 of 32

Respecting Permissions

Your system protects itself for a reason

sudo = “Please do this with authority”

chmod & chown Decide who gets to touch what

chmod = Decide read/write/execute permissions for user/group/ogres

chown = Decide to which user/group these permissions apply

14 of 32

Connecting to Other Computers

Insecure way: Telnet

Communication via postcard

Useful for checking if a port is open on a site

  • telnet longhornphp.com won’t work
  • telnet longhornphp.com 443 will work.

Secure way: SSH

Communication via encrypted text

Connect to the terminal on another computer!

  • ssh git@github.com
  • ssh git@github.com -p 22

15 of 32

Copying Files

Small, Local 🥱

cp source/this.txt target/this.txt

  • ❤️Small things
  • 💔Big things
  • 👹System to System
  • 👿Data Integrity

Secure, Remote 🏦

scp ~/dir/this.txt me@target.loc:~/dir/this.txt

scp me@source.loc:~/dir/this.txt ~/dir/this.txt

  • ❤️Small things
  • 💔Big things
  • 💕System to System
  • 👿Data Integrity

16 of 32

Syncing Files

Living in the Future 🚀

Push: rsync -aP ~/dir/this.txt -e ssh me@target.loc:~/dir/this.txt�Pull: rsync -aP -e ssh me@source.loc:~/dir/this.txt ~/dir/this.txt

  • ❤️Small things
  • 💖Big things
  • 💕System to System
  • 💞Data integrity

17 of 32

Learning from the Shell: Man Pages

Your shell is not just a tool—it’s a teacher, too!

Converse with the shell to learn more about a command

man = “manual”

man printf

18 of 32

Alternatives to Man: Local

  • cheat.sh - github.com/chubin/cheat.sh
    • Quick cheat sheet
  • tldr (better: Tealdeer)
  • qman - github.com/plp13/qman
    • Same as manpages, but pretty and hyperlinked

tldr printf

19 of 32

Alternatives to Man: Online

  • linux.die.net/man/1/
    • slightly prettier than man pages
    • linux.die.net/man/1/printf
  • cheat.sh | cht.sh
    • cheat.sh/rsync
    • curl cheat.sh/rsync
    • curl cht.sh/rsync

20 of 32

Combining commands: Pipe

Pipe command: |

Takes output, feeds it forward

Ex. To find the running instance(s) of PHP on your machine:

ps aux | grep php

Top 5 Shell Commands On My Computer

history | tr -s ' ' | cut -d ' ' -f3 | sort | uniq -c | sort -nr | head -n5

21 of 32

Saving Output

> = Save for Later

date > timeNow.txt

diff file1 file2 > diff.txt

>> = Append and Save for Later

php generateBugs.php >> bugs.log

22 of 32

Compounding Commands

Now we can write sentences with composition!

ps aux | grep php > runningPHP.txt

23 of 32

Automating Scripts with Bash

Now we can combine sentences into paragraphs and stories!

bash script = a todo list for your computer

Note: Script files typically end in .sh

# installApplication.sh

composer install�bin/cmd cache:clear�bin/cmd cache:warmup

24 of 32

Chapter 4: Mastery

25 of 32

Sidekicks for the Road

Self Correction

The F*ck

  • Very helpful when you mistype a command
  • github.com/nvbn/thefuck
  • I alias this as “please”
    • eval $(thefuck --alias please)

PHP REPL (Read Eval Print Loop)

PsySH

  • Test out PHP in a scratch pad
  • Like 3v4l.org in the CLI!
  • AKA artisan tinker
  • psysh.org

Calendar

  • This month: cal
  • A year’s calendar: cal 2026

26 of 32

Command Line Fun

Nostalgia

  • Telehack
    • A ton of distractions
    • telnet telehack.com
    • List of commands - Type: ?
    • ASCII Starwars - starwars

Wonder

  • ASCII Aquarium
    • {(sleep 5; printf 'aquarium\r\n') & cat;} | telnet telehack.com

Adventure

  • Nethack

27 of 32

Learning Quietly

Julia Evans (aka b0rk) Wizard Zines

  • Amazing zines: wizardzines.com
  • Blog: jvns.ca
  • Follow on the socials:

Games to Learn BASH

  • Command Line Murder Mystery: A fun problem-solving game set in your terminal
  • Terminus: This online game teaches important shell commands in a fun and interactive way. Like Zork
  • Bashcrawl: A text-based dungeon crawl game played entirely in the Bash shell
  • Vim Adventures: A game to learn Vim, a text editor found on Unix-like systems
  • OverTheWire Bandit: A Capture The Flag type game designed for beginners to learn Bash commands
  • Learn Shell: An interactive tutorial that allows you to practice Bash commands within your web browser

Copied from: gist.github.com/zacWCCI/170f4e1d1420ce80fdd31ab78d462d21

28 of 32

Reflection: You and Your Shell

  • You started as a guest
  • Now you’re more at home in your shell
  • You have the tools to paint and wax your shell!

29 of 32

Final Takeaways

✅ The shell listens to you

✅ You should command with clarity

✅ You should know how to find out what each command and option does

✅ Automation frees your time for the fun stuff

🐚 You now have a friend in your terminal

30 of 32

Extra Credit

Is this good advice?

What will it do?

31 of 32

Chapter 5: Confidence

This chapter is written by you

32 of 32

Thank You!

Eric Poe�Application Manager�Stowers Institute for Medical Research�stowers.org

Email: eric.poe@gmail.com

Mastodon: https://phpc.social/@ericpoe

Blog: ericpoe.com