Home Linux BasicsHidden Files, Home Directory Shortcuts and Symbolic Links in Linux

Hidden Files, Home Directory Shortcuts and Symbolic Links in Linux

by Knowledge Base Linux
Hidden Files Home Directory Shortcuts and — Hidden Files, Home Directory Shortcuts and Symbolic Links in Linux

Your Linux home folder is hiding things from you — on purpose. Some files are invisible until you ask to see them, the tilde symbol ~ is secretly an address, and some “files” are actually signposts pointing at other files. This guide explains hidden files, home directory shortcuts, and symbolic links in Linux in plain English, so the everyday magic tricks of the file system stop being mysterious.

Hidden Files in Linux: The Dotfile Secret – Hidden Files Home Directory Shortcuts and

On Linux, any file or folder whose name starts with a dot is hidden from normal listings. Run ls in your home folder and you see your documents; run ls -a and a crowd of extra names appears: .bashrc, .profile, .config, and more. These are called dotfiles.

Why hide them? Not for security — anyone can reveal them with ls -a, so a dot is not a lock. The point is tidiness. Dotfiles are mostly settings: .bashrc holds your shell preferences, and the .config folder holds settings for many programs. Hiding them keeps your home folder looking clean while the machinery stays one flag away. Two rules for beginners: do not delete dotfiles you do not recognize (a program is probably using them), and when a tutorial tells you to edit .bashrc, it means the file in your home folder — which is exactly where the next section’s shortcut takes you.

Home Directory Shortcuts: ~, . and .. Explained – Hidden Files Home Directory Shortcuts and

Three tiny symbols act as addresses in every path you type:

  • ~ (the tilde) means your home directory. If your username is alex, then ~ is /home/alex, and ~/Documents is the Documents folder inside it. Typing cd ~ from anywhere teleports you home.
  • . (a single dot) means the current folder. That is why you run scripts as ./hello.sh — you are saying “the hello.sh in this folder, right here”.
  • .. (two dots) means the parent folder, one level up. cd .. climbs one step; cd ../.. climbs two.

These three appear everywhere once you start noticing them — including inside the ls -la output, whose first two entries are always . and .. themselves. Mastering them is part of learning how Linux user accounts and their home folders fit together, the same foundation covered when you add a user and manage permissions on Debian.

Symbolic links in Linux: two folders connected by a glowing chain and a shortcut arrow

Symbolic Links in Linux: Shortcuts That Point to Files

Symbolic links in Linux (often called symlinks) are special files whose entire job is to point at another file or folder. They are the Linux version of a shortcut: double-clicking a desktop shortcut does not open the shortcut itself, it opens the thing it points to. Programs treat a symlink the same way — open the link, and you get the target’s content.

Why would you want one? Imagine a program insists on reading its data from /var/data, but your big disk is mounted at /mnt/bigdrive. A symlink at /var/data pointing to the real folder makes everyone happy, without moving or copying a single byte. Website setups, version switching (current pointing to app-v2.3) and tidy home folders all use this trick.

Creating a symbolic link takes one command:

ln -s /mnt/bigdrive/photos ~/photos-link

Read it as: “link, symbolic, from this real folder, to this new name”. Afterwards, ls -l ~/photos-link shows an arrow revealing the trick: photos-link -> /mnt/bigdrive/photos. Any program opening ~/photos-link lands in the real photos folder.

Common Beginner Mistakes

  • Thinking hidden means protected. A dotfile is hidden from view, not from people. Never store passwords in a file just because its name starts with a dot.
  • Deleting the target and blaming the link. If you delete or rename the real file, the symlink points at nothing and is called broken. The link is not corrupt; its destination is simply gone.
  • Fearing rm on a symlink. Deleting a symlink with rm linkname removes only the signpost, never the file it points to. (The dangerous exception: adding a trailing slash or -r can act on the target folder’s contents — when in doubt, check with ls -l first.)
  • Using relative targets carelessly. A symlink stores exactly the path you gave it. If you create it with a relative path and later move the link, it may point somewhere unexpected. Beginners should use full paths starting with /.
  • Confusing ~ with /. ~ is your home; / is the root of the whole system. ~/Documents and /Documents are completely different places.

Conclusion

Three small ideas unlock a lot of everyday Linux: dotfiles hide settings in plain sight (reveal them with ls -a), the symbols ~, . and .. are pocket-sized addresses for home, here and one-level-up, and symbolic links in Linux let one name point gracefully at another file or folder via ln -s. Try them in a scratch folder until they feel obvious. The official ln manual page documents every link option when you need the fine print.

You may also like

KbLinux

Typically replies within a day

Hello, Welcome to the site. Please click below button for chatting me through Telegram.