1/6

Moving around · Flags and hidden files

Flags and hidden files

Files whose names start with a dot, like .bashrc, are hidden: plain ls skips them. They're usually settings files you don't need to see every day.

To change how a command behaves, add a flag (also called an option): a dash and a letter, after the command and before any folder name. The flag -a (for all) makes ls show hidden files too.

How to type it: ls -a for the folder you're in, or ls -a folder for another one.

Worked example

learner@shellstreak:~$ ls -a
.
..
.bashrc
Documents
Downloads
notes.txt
projects
todo.txt

What the output means

  • The single dot is a special name for this folder, and .. for the folder above it (you used .. with cd). Every folder has both, and ls -a lists them first.
  • .bashrc is a hidden file: settings the shell reads when it starts. Plain ls didn't show it.
  • The rest is the same list you've seen from plain ls.

Common mistakes

  • Leaving out the space: ls-a is an unknown command.
  • Leaving out the dash: ls a looks for a file or folder called a.
  • Using a capital letter: ls -A is a different flag (it hides . and ..).

Tap Run to see everything in your home folder.

Try it:ls -a
learner@shellstreak: ~
Starting your practice shell…

You can also type in the terminal yourself. Try anything: you can't break it.

Go deeper: Basic terminal commands for beginners