What does "d" mean in ls -l output?

QuestionsQuestions8 SkillsProDec, 16 2025
0114

Ah, you're honing in on a very specific and important detail in the ls -l output!

The d you see in the very first position of the permissions string (like in drwxr-xr-x) indicates that the item is a directory.

As we discussed earlier, the first character of the 10-character permissions field tells you the type of file.

  • If it's a d, it's a directory.
  • If it's a -, it's a regular file.
  • If it's an l, it's a symbolic link.

So, when you see something like:

drwxr-xr-x 2 labex labex 4096 May 09 10:00 my_folder
-rw-r--r-- 1 labex labex 1234 May 10 14:30 my_document.txt

The d at the beginning of drwxr-xr-x clearly marks my_folder as a directory, while the - at the beginning of -rw-r--r-- marks my_document.txt as a regular file.

This distinction is crucial because permissions (read, write, execute) behave slightly differently for directories compared to regular files.

Great question for really digging into the details! Is there anything else about that first character or the permissions you'd like to clarify?

0 Comments

no data
Be the first to share your comment!