In Linux, the tilde symbol ~ is a special shortcut that represents your Home Directory.
Here are a few key things to know about it:
- Personal Space: It points to the specific folder where your user's personal files, settings, and documents are stored. In this lab environment,
~stands for/home/labex. - User-Specific: If you were logged in as a user named "john", the
~would represent/home/john. - Time Saver: Instead of typing the full path every time (like
/home/labex/some_folder), you can simply type~/some_folder.
Examples of use:
echo ~: Displays the full path of your home directory.cd ~: Instantly takes you back to your home directory from anywhere else in the system.ls ~: Lists the contents of your home directory regardless of which folder you are currently in.
It is one of the most frequently used shortcuts in the Linux command line!