Table of Contents
This article will help you understand the long format of ls command. You may already know the ls command in Linux is used to display content in a directory.
Understanding long format will help you in some work situations. For example, you need to check the permissions of the files contained in a directory, or you want to check the timestamps of files in the directory.
“-l” option of ls command
If you remember in the previous article, the ls command when using the -l option (ie long format) will display the list result in the form of long format.
Now, see the example below. I use the ls command to display the content in the writebash.com directory.

I use ls with 2 ways, ls command does not have any options and ls command with -l option. You see the results displayed in different terminal windows very clearly.
Understand long format of ls command
Now we will explore each column of information in the long format of the ls command. What does that column mean?
drwxr-xr-x : show file or directory permissions.
- First character: the first character in this column indicates the type of file. This character is in 1 of 3 values.
-: the first character is-then the type is the file.d: value isdthen the type is the directory.l: value islthen the type is the link. You can read more about links in Linux.
- The next 3 characters
rwx: show file owner permissions.r: shows file read permission.w: write permission of file.x: show execute permission of file.
- Next 3 characters
r-x: show file group permissions. - The last 3 characters
r-x: displays the permission of the user other for the file.
So now that you look at the image above, you can understand that hello_world is a file and the pathname is a directory.
2 : file’s number of hard links.
trungdung : this is username of the file’s owner. In this case, my username is trungdung.
trungdung : the name of the group which owns the file. My username and group has the same name.
4096 : this display size of the file in bytes.
Jan 19 11:44 : show data and time of the files last modification.
pathname : name of the file or name of the directory.
Conclusion
For this article, you can understand what information columns mean when displaying the long format of the ls command. Believe me, it’s quite useful in some work requirements.
(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).