Results 1 to 4 of 4

Thread: Owner of the file not being displayed properly in LINUX Terminal

  1. #1
    Join Date
    May 2019
    Beans
    1

    Owner of the file not being displayed properly in LINUX Terminal

    So here is my problem- I want the terminal to display the user name that created a particular file, so when I traverse all the way to that file and type in the command 'ls -l filename.docx' or even 'ls -la /path/to/file', it shows the output as: staff 1344 May 18 11:03 (filename).docx. So I don't understand why does it display 'staff 1344' instead of using my actual user name. How am I supposed to obtain the actual username in this case (provided I logged in from my admin account)? Any help would be really appreciated.

  2. #2
    Join Date
    Jun 2014
    Beans
    5,575

    Re: Owner of the file not being displayed properly in LINUX Terminal

    .docx is a Microsoft windows Word document extension. Are you accessing it on an ntfs filesystem? I don't use windows but the link below discusses this situation and apparently this has to be changed in your mount options (if you are accessing it on an ntfs partition). Scroll down the page a bit and there is a brief explanation.

    https://superuser.com/questions/8727...sions-when-run

  3. #3
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    4,877
    Distro
    Xubuntu 19.10 Eoan Ermine

    Re: Owner of the file not being displayed properly in LINUX Terminal

    The output of ls -l shows type (as in regularfile, directory, ...), permissions, number of hardlinks, owner, group, size (in bytes), modification time and date, name. So the line of output in your post is incomplete, but it looks like staff is the group to which the file belongs, not the user who owns it.

    BTW, 1344 bytes is pretty small for a docx file.
    Last edited by Impavidus; May 18th, 2019 at 04:34 PM.

  4. #4
    Join Date
    Dec 2014
    Beans
    1,341

    Re: Owner of the file not being displayed properly in LINUX Terminal

    The output of 'ls -l' should have seven columns (permissions, hard link count, owner, group, size, mtime and name), you're only showing us the last four (yes, 'staff' is a predefined group, gid 50; the '1344' should be the file size). If that's all the output you get you have a bigger problem than getting user names instead of 'real' names. When a user is set up he is given a user name which must be unique. The 'real' name doesn't need to be (so yes, you can have a dozen users with 'real' name 'John Smith', but their user names have to differ) and is completely voluntary and for informational purposes only. The system actually uses neither name, all users also get a number (id) which is what is used by the system internally.

    Holger

Tags for this Thread

Bookmarks

Posting Permissions

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