Can `ls` show hidden files?

QuestionsQuestions8 SkillsProDec, 21 2025
0126

Yes, it can! By default, the ls command hides files that start with a dot (e.g., .bashrc). These are known as hidden files or "dotfiles."

To see them, you need to add the -a (which stands for "all") option:

ls -a

Try it now:

  1. Go to your home directory: cd ~
  2. Run ls (you will likely see lists like project, Code, etc.)
  3. Now run ls -a

You will see many more items, including . (the current directory), .. (the parent directory), and various configuration files like .zshrc or .bash_history.

Bonus Tip: You can combine options! For example, ls -la shows all files (including hidden ones) in a long format with details like file size and permissions.

0 Comments

no data
Be the first to share your comment!