AI Hints
Home›Linux Tutorial›ls Options
Linux · Lesson 21 of 120

Reading ls -l

Every column explained.

⏱ 2 min read▶ Video at 24:56🎓 Free
Watch this lesson in the Linux courseWatch on YouTube ↗Full Linux course

The long listing looks like a wall of text at first. But every column has one simple job. Once you can read it, you'll understand a lot about any file at a glance.

Reading ls -l
From the video: Reading ls -l
  • A wall of text?
  • Each column has one job
  • Read any file at a glance

One line, up close

Let's look at just one file, notes dot TXT, with LS dash L. We get one line, with seven pieces of information. Let's go through them, from left to right.

Terminal
ls -l notes.txt
-rw-r--r-- 1 sam sam 30 Jan  5 09:00 notes.txt

The columns

The first block of letters is the file type, and its permissions. A dash means a normal file, and a D means a directory. Then the number of links, which you can ignore for now. Then the owner, sam, and the group, also sam. Then the size, in bytes. Then the date and time it last changed. And finally, the name.

ColumnExampleMeaning
Type + permissions-rw-r--r--file, who can do what
Links1ignore for now
Owner, groupsam samwho owns it
Size30bytes
ModifiedJan 5 09:00last change
Namenotes.txtthe file

Files and folders side by side

Now the whole home folder, with folders and files mixed. Every line for a folder starts with D. Every line for a file starts with a dash. That first letter is the quickest way to tell them apart.

Terminal
ls -l
total 24
drwxr-xr-x 2 sam sam 4096 Jan  5 09:00 Documents
drwxr-xr-x 2 sam sam 4096 Jan  5 09:00 Downloads
drwxr-xr-x 2 sam sam 4096 Jan  5 09:00 Music
drwxr-xr-x 2 sam sam 4096 Jan  5 09:00 Pictures
-rw-r--r-- 1 sam sam   30 Jan  5 09:00 notes.txt
-rw-r--r-- 1 sam sam   58 Jan  5 09:00 todo.txt

Summary

The long listing shows type and permissions, links, owner and group, size, date, and name. D means directory. Next, making your own folders.

Key takeaways
  • d = directory, - = file
  • Owner, group, size
  • Date, then name
Next up: mkdir: Making Folders — creating directories