What is long-format in Linux?

11,492

Solution 1

As you already may know, ls shows you the directories and files in your current folder.

ls -l (or shortly ll) prints you the long format as follows:

drwxr-xr-xr root root 1093 Oct 7 09:26 file

these stand for:

  • permissions(r-read,x-execute,w-write) if any of these fields is disabled, you don't have the permission to do it.
  • root root stands for the owner of the file and the group owner (you will find out about root as you carry on learning about linux).
  • Next is the file size, after which the date the file was created, the time when it was last modified and the files name.

For more explanation visit this link: http://go2linux.garron.me/command-ls-file-permissions

Solution 2

The phrase "long format" simply means a format that is longer than some other format. There is no general Linux or UNIX concept of "long format". In this case, it refers to the output format produced by the ls command with the -l option, and only to that.

The "long format" used by ls is documented in the ls document (man ls or info ls), and can be seen by comparing the output of ls -l to the output of ls.

Other commands may have their own long formats, either based on the ls long format or not.

Share:
11,492

Related videos on Youtube

Arun Mohan
Author by

Arun Mohan

Updated on June 30, 2022

Comments

  • Arun Mohan
    Arun Mohan almost 2 years

    What exactly is the long format in Linux?. I am a newbie into programming and Linux. So I was taking a tutorial in terminal operations. This command ls -l is said to list the files in the working directory in long format. Can somebody explain or give resources explaining about the long format and its use?

    • Elliott Frisch
      Elliott Frisch over 9 years
      Have you compared ls -l with ls?
    • xlecoustillier
      xlecoustillier over 9 years
      Why don't you try ls with and without -l and check the difference ?
    • Kal
      Kal almost 4 years
      Better answers to this question can be found here: unix.stackexchange.com/questions/103114/…
  • Kal
    Kal almost 4 years
    This isn't a great answer. You can't say 'if any of these fields is disabled, you don't have the permission to do it' if you don't know who the user is. Secondly, the timestamp shows you the modification date and time, not the creation date and modification time. (It would be quite absurd for a timestamp to mix these two things together!)
  • Keith Thompson
    Keith Thompson almost 3 years
    I'm curious about the reason for the downvote (after all these years).
  • lessthanideal
    lessthanideal almost 3 years
    Link is broken, and info is incomplete (permissions are not just r,w or x which is what I was looking this up for) - the link @Kal gives in their comment on the question gives better information.
  • lessthanideal
    lessthanideal almost 3 years
    I wasn't the downvoter, but as it happens I just came to this question a few hours after your comment and this is the only answer that properly addresses the question, so have a +1 from me