What is all the information presented when I write "ls -l"?


Here we’re told that ls -l shows us the file system that we’re working with. In the first exercise, we’re also shown the filesystem containing much less information than this command shows. What is this extra information that we are seeing?


The extra information that we’re seeing here is information fundamental to any file in a system. In order from left to right, these are

  1. File privileges: If we can read (r) from or write (w) to the file. And finally if the file can be executed (x), for example as programs can.
  2. File ownership: Who the file belongs to in the system.
  3. File group: Which group within the system the file belongs to.
  4. The size of the file in bytes.
  5. The date the file was last modified.
  6. File name.

I searched for ‘file permissions’ and came across this site: https://www.guru99.com/file-permissions.html
Read( r) Write( w) Execute( x)

  • Read: This permission give you the authority to open and read a file. Read permission on a directory gives you the ability to lists its content.
  • Write: The write permission gives you the authority to modify the contents of a file. The write permission on a directory gives you the authority to add, remove and rename files stored in the directory. Consider a scenario where you have to write permission on file but do not have write permission on the directory where the file is stored. You will be able to modify the file contents. But you will not be able to rename, move or remove the file from the directory.
  • Execute: In Windows, an executable program usually has an extension “.exe” and which you can easily run. In Unix/Linux, you cannot run a program unless the execute permission is set. If the execute permission is not set, you might still be able to see/modify the program code(provided read & write permissions are set), but not run it.