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.txtWhat the output means
- The single dot is a special name for this folder, and
..for the folder above it (you used..withcd). Every folder has both, andls -alists them first. .bashrcis a hidden file: settings the shell reads when it starts. Plainlsdidn't show it.- The rest is the same list you've seen from plain
ls.
Common mistakes
- Leaving out the space:
ls-ais an unknown command. - Leaving out the dash:
ls alooks for a file or folder calleda. - Using a capital letter:
ls -Ais a different flag (it hides.and..).
Tap Run to see everything in your home folder.
Try it:
ls -alearner@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