Find the answer to your Linux question:
Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By Irithori
Can someone please explain the output for this command? I know it has to do with permissions and inode details but its just a bit confusing to understand. Thanks...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2013
    Posts
    3

    ls -il


    Can someone please explain the output for this command? I know it has to do with permissions and inode details but its just a bit confusing to understand. Thanks

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,377
    -i shows the inode number of a file
    -l shows permissions, user and group, size and timestamp of a file.
    Maybe start reading about permissions here: https://en.wikipedia.org/wiki/Modes_%28Unix%29
    Lakshmipathi likes this.
    You must always face the curtain with a bow.

  3. #3
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,206
    The inode number is just a kind of numeric address for the file. The parent directory maps the filename to an inode number, and the inode - a small structure on the disk - contains all the other details that ls -l shows you. It also contains direct or indirect pointers to the blocks that contain the content of the file.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,508
    The man page for ls is also helpful. As Hazel and Irithori said, the -i gives you the inode, and the -l part gives the "long" listing, including user/group ownership, permissions, etc. In Unix/Linux systems, the file system inode is a critical component. It is the actual data structure that defines the file such as location, number of links to the file, size, etc. The directory entry is really just a pointer to the inode. This means that you can have a number of links to a file, and if someone deletes it, it doesn't get actually deleted until all the links are removed. These links can be transitory (such as when an application opens the file), or more permanent, such as a hard link to a file name in another directory. This is why you can do stuff in Linux/Unix that you cannot in Windows, such as update shared libraries and other stuff that are still in use (the new version has a different inode), without rebooting the system! I have to pretty much reboot my windows systems daily, especially when our IT people need to update components. With Linux, I can go a year+ without rebooting, yet update software daily!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,206
    Quote Originally Posted by Rubberman View Post
    This is why you can do stuff in Linux/Unix that you cannot in Windows, such as update shared libraries and other stuff that are still in use (the new version has a different inode), without rebooting the system! I have to pretty much reboot my windows systems daily, especially when our IT people need to update components. With Linux, I can go a year+ without rebooting, yet update software daily!

    I've always wondered how that was done. Let me see if I understand you: when a program opens one of its libraries, it makes a hard link to the inode. Along comes an update, creates a new file containing the new version, and deletes the old name. But the actual library and its inode aren't deleted as long as a single link made by a program remains active.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,508
    Perfectly put Hazel! BTW are you interested in a software development position? I think my company's British division has some openings! Seriously! We don't age-discriminate - I am 65 (hired a bit less than 18 months ago), and feel like I am appreciated for my experience as well as capability. Wisdom from experience - who needs that? Out division members' ages range from their early 20's to late 60's. It keeps things "interesting"...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •