Show Dot-Prefixed Entries

Show Dot-Prefixed Entries

A teacher's program saves settings in a file called .school-config, but an ordinary listing does not show it. The file has not vanished. Many Linux tools follow the convention that a name beginning with a dot is hidden from the default directory listing.

You can ask ls to include those entries. We will compare the options that reveal them, including the special names for the current and parent directories. This is about what the listing shows, not about whether a user has permission to read the file.

What you’ll learn

  • List dot-prefixed entries with ls.
  • Distinguish -a from -A and interpret the special dot entries.

Listing options reveal different entries

  1. Ordinary listing

    ls normally omits names beginning with a dot.

    .school-config omitted
  2. Include hidden

    ls -A includes dot-prefixed names.

    .school-config shown
  3. Special entries

    Unlike -a, -A excludes the current and parent directory entries.

    . and .. omitted
A hidden name is still an ordinary directory entry.

List the dot-prefixed school configuration

Prepare the example

Start in a fresh directory. The first line creates a dot-prefixed file for the exercise, and the next line lists entries with the option we want. There is no separate visibility switch to set: the leading dot in the name establishes this convention.

Bash · Linux terminal

touch .school-config
ls -A

Expected result

.school-config

touch .school-config creates the empty settings file. ls -A displays hidden names as well as ordinary ones, but leaves out . and ... Those two special entries mean the current directory and its parent, so excluding them can make a practical listing less noisy.

By comparison, ls -a includes them too. Neither option changes the file, its name or its access permissions. If you cannot open a hidden report, diagnose its actual path and access rules instead of assuming that 'hidden' is a security feature.

Why dot-prefixed names are omitted

Linux treats a file or directory as hidden when its name begins with a dot, such as .bashrc or .config. Hidden does not mean protected; it simply keeps routine directory listings less cluttered.

What Are Hidden Files?

In Linux, any file or folder whose name starts with a dot (.) is considered hidden. These are usually configuration files, system files, or user-specific settings like:

.bashrc
.gitconfig
.vimrc

They don’t show up by default when you list files with the ls command. But don’t worry—we’ll fix that now.

View Hidden Files in the Terminal

The command you’re looking for is this:

ls -a

The -a stands for all, and it tells Linux to include hidden files in the list.

Try it in any directory. For example, go to your home directory and run:

cd ~
ls -a

You’ll see output like this:

.bashrc   .cache   .config   Documents   Downloads

Now you can see all the dot files and folders.

Listing choices and file-manager visibility

Want to Skip . and ..?

By default, ls -a also shows . (current directory) and .. (parent directory). If you want to view hidden files but skip those, use:

ls -A

That’s a capital A, and it shows all files except . and ...

View Hidden Files in a Graphical File Manager

If you’re using a desktop environment like GNOME or KDE, you can also view hidden files graphically.

  • GNOME (e.g., Ubuntu): Press Ctrl + H in the file manager.
  • KDE (e.g., Kubuntu): Press Alt + . or find the “Show Hidden Files” option in the menu.

Press the same key combo again to hide them.

Recognize and list dotfiles

  • Use ls -a to see hidden files in terminal
  • Use ls -A to exclude . and ..
  • Use keyboard shortcuts like Ctrl + H in file managers

And that's it! You now know how to reveal the hidden secrets of your Linux system.

If you're enjoying this course, make sure to like and follow for more beginner-friendly Linux tutorials.

Try it, then check the worked answer

Your task: List hidden entries without . and ...

Start in a fresh directory. The first line creates a dot-prefixed file for the exercise, and the next line lists entries with the option we want. There is no separate visibility switch to set: the leading dot in the name establishes this convention.

Bash · complete example for this question

touch .school-config
ls -A

Expected result

.school-config

Worked answer

ls -A

Choose ls -A when you want hidden names without the two special dot entries. A plain ls normally omits dot-prefixed entries. ls -a is also useful, but it includes the very entries the question asks to leave out.

Check your decision

List hidden entries without . and ...
Choose one answer. You can try again.

Answer and explanation

ls -A

Choose ls -A when you want hidden names without the two special dot entries. A plain ls normally omits dot-prefixed entries. ls -a is also useful, but it includes the very entries the question asks to leave out.

Hidden names are a listing convention, not protection

A hidden name is still an ordinary directory entry. Use a listing option that answers your question, and remember hidden entries when checking whether a directory is empty. Visibility in a list and authorization to access the entry are separate concerns.

Reaching the recap and completing the quizzes are separate milestones.

    Next lesson: Create a Dot-Prefixed File →