How to Show Hidden Files in Linux

Use ls to show hidden files and directories, including .env and .git.

Linux treats names beginning with a dot as hidden for normal directory listings. They are still ordinary filesystem entries, and `ls -a` reveals them.

Step by step

1 Show hidden names

$ ls -a

Includes hidden entries such as .env, .git and .config.

2 Show details too

$ ls -la

Combines hidden entries with long-format permissions, owner, size and timestamps.

3 Include hidden entries but not . and ..

$ ls -A

Useful when you want dotfiles without the current and parent directory entries.

4 Inspect one hidden file

$ ls -l .env

You can address a hidden file directly even though it does not appear in a normal `ls` listing.

Tips worth knowing

Frequently asked questions

Why does ls not show .env?

Names beginning with `.` are omitted by default. Use `ls -a` or `ls -la`.

What is the difference between ls -a and ls -A?

`-a` includes `.` and `..`; `-A` includes hidden entries but omits those two special directories.

The commands behind it

ls

List the contents of a directory, with options for hidden files, long format, sorting and more.

find

Locate files anywhere in a directory tree by name, type, size, date — and act on them.

cat

Print file contents, number lines, and join multiple files together.

Concepts involved: File permissions

More how-to guides

Check disk space in Linux

See how much space is left, and find out what is using it.

Extract a .tar.gz archive

Unpack tar.gz, tar.bz2, tar.xz and zip archives from the command line.

Free a port that is already in use

Find which process holds a port and stop it cleanly.

Find and replace text in files

Replace text in one file or across a whole project, safely.