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
- Do not expose secrets accidentally when copying or publishing a directory.
- Use `ls -ld .config` when you want information about the directory itself.
- Hidden does not mean protected: permissions still control access.
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
List the contents of a directory, with options for hidden files, long format, sorting and more.
findLocate files anywhere in a directory tree by name, type, size, date — and act on them.
catPrint file contents, number lines, and join multiple files together.
Concepts involved: File permissions
More how-to guides
See how much space is left, and find out what is using it.
Extract a .tar.gz archiveUnpack tar.gz, tar.bz2, tar.xz and zip archives from the command line.
Free a port that is already in useFind which process holds a port and stop it cleanly.
Find and replace text in filesReplace text in one file or across a whole project, safely.