Skip to content
AgileLogics
4 min read

Your First Commands

Prerequisites: Opening a terminal

Type a command and press Enter to run it.

echo "Hello, world!"

Expected output

Hello, world!

echo prints its arguments. A few more to try:

# illustrative
whoami
date
pwd
ls
ada
Tue Apr 22 09:30:00 BST 2025
/home/ada
Documents  Downloads  Music  Pictures
  • whoami — your username.
  • date — the current date and time.
  • pwd — "print working directory": the folder you're in.
  • ls — list the files and folders here.

Commands, options, and arguments

Most commands follow the same shape:

command  -options  arguments
echo -n "no newline at the end"
echo
echo one two three
no newline at the end
one two three
  • Options (also called flags) change how a command behaves. They start with - (short, like -n) or -- (long, like --help).
  • Arguments are what the command works on.
  • Spaces separate the parts — which is why spaces matter so much in Bash.

Useful keys

  • ↑ / ↓ — scroll through previous commands.
  • Tab — complete a file or command name. Press it constantly; it saves typing and prevents typos.
  • Ctrl + C — stop the running command.
  • Ctrl + L or clear — clear the screen.

Common mistakes

  • Typos in command names: ehco hi gives bash: ehco: command not found.
  • Forgetting that the shell is case-sensitive: Echo isn't echo.

Practice

Print your name on one line and your favorite food on the next with two echo commands.

Show solution
echo "Ada"
echo "Pizza"
Ada
Pizza