What does the `echo ~` command do?

QuestionsQuestions8 SkillsProDec, 23 2025
0118

Great question! The command echo ~ is a simple way to find out where your Home directory is located.

Here is a breakdown of how it works:

  1. echo: This is a command used to display (or "print") text or variables to the terminal.
  2. ~ (Tilde): In Linux, the tilde symbol is a special shortcut that represents your Home directory.
  3. Result: When you combine them, the system translates ~ into the full path of your home directory and prints it on the screen.

In this lab environment:

When you run echo ~, it should output:

/home/labex

Why is this useful?

  • The Home directory (/home/labex) is your personal space where you have full control over your files.
  • The Working directory you are currently in (/home/labex/project) is a specific folder inside your home directory designed for this lab.

You can try running it now in your terminal to see it in action! Don't forget to try the ls command next to see what files are inside your current folder.

0 Comments

no data
Be the first to share your comment!