AI Hints
Home›Linux Tutorial›The Prompt and echo
Linux · Lesson 7 of 120

Reading the Prompt

Who and where you are.

⏱ 2 min read▶ Video at 6:10🎓 Free
Watch this lesson in the Linux courseWatch on YouTube ↗Full Linux course

Before every command, the terminal shows a little line of text. It's called the prompt. It looks like a jumble of symbols at first, but it's actually telling you three useful things.

Reading the Prompt
From the video: Reading the Prompt
  • The text before every command
  • Called the prompt
  • It tells you three things

Reading sam at laptop

Let's read our prompt, piece by piece. Sam is the user you're logged in as. After the at sign, laptop is the name of the computer. After the colon comes the folder you're in right now. The wavy line, called a tilde, means your home folder. And the dollar sign means, I'm ready, type a command.

samyour username
@laptopthe computer's name
:~the folder you're in
$ready for a command

The prompt changes as you move

Watch the prompt while we move into a different folder. CD means change directory. After CD/TMP, the prompt shows slash t m p, instead of the tilde. The prompt always shows where you are, so you never get lost. CD on its own takes you back home, and PWD confirms it.

Terminal
cd /tmp
cd
pwd
/home/sam

Dollar or hash

One more detail. A dollar sign means you're a normal user. If you ever see a hash sign instead, it means you're the all powerful root user, and every command can change anything. We'll talk about root much later. For now, a dollar sign is exactly what you want.

keyvalue
$a normal user
#the root user
Normal usersafe for everyday work
Rootcan change anything

Summary

The prompt shows your username, the computer, the folder you're in, and whether you're root. Next, the echo command, and how commands take extra words.

Key takeaways
  • user@computer
  • the current folder
  • $ normal, # root
Next up: echo and Arguments — giving commands extra words