What does `ls` do?

QuestionsQuestions8 SkillsProDec, 20 2025
0151

That's a great question!

The ls command stands for "list". Its primary job is to show you the names of files and directories (folders) inside a specific location.

Here is a simple breakdown:

  1. If you type just ls: It lists the contents of your current folder (the one you are currently "standing" in).
  2. If you type ls [folder_path]: It lists the contents of that specific folder. For example, ls ~ lists what is in your Home directory.

Why is it useful?

Because the Linux terminal is text-based, you can't see your files like you do in a window on Windows or macOS. You use ls to "look around" and see what files are available for you to work with.

Common Tip:
If the directory is empty, ls will return nothing and just show you a new prompt. This is normal!

Would you like to try seeing more details about your files? You can try:

ls -l

(The -l stands for "long" and shows things like file size and the date they were created.)

0 Comments

no data
Be the first to share your comment!