Bash & Linux·Bash from first command to automation

Shell basics

Understand the prompt, run commands and read help without guessing.

Beginner 11 min read Lesson 1 of 300 Challenge included
What you will be able to do
  • Use pwd to see where you are.
  • Use which or type to find a command.
  • Check $? for the previous exit code.
  • Use man or --help to learn options.

In plain English

The shell reads a line, finds an executable on your PATH and runs it with arguments. Exit codes tell you whether it worked: 0 means success and anything else means failure. Read them instead of assuming.

terminalTerminal
pwd
type git
echo "exit: $?"
ls --help | head
Your turn

Check a command result

Easy

Run a command and print its exit code.

BASH · starter
ls
Check your understanding before moving on.
Knowledge checkQuestion 1

What exit code means success?

Select an answer to continue
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Files and directories
Lesson 1 of 300 · 0% of course