3

What does the # character preceding the owner name mean?

For example:

me@server /dir/sub/sub-sub $ ll v* x*
-rwxrwxr-x   1 #owner   group          1176 Jun 25  2009 vfc.sh
-rw-r-----   1 #owner   group             6 Jun 22  2011 xx
-rwxrwxrwx   1 #owner   group           107 May 25  2010 xx.sh
-rw-r-----   1 #owner   group         10139 Jan  7  2013 xxx
6
  • 2
    The username starts with #
    – heemayl
    Jul 1 '16 at 18:26
  • 7
    Possibly someone thought they could comment out a user in /etc/passwd by putting a # in front of the username, but this just causes the username to change; any files owned by that user will now show as #username instead. Jul 1 '16 at 18:33
  • @jimmij: Or better yet, just show the output of ls -l. Jul 1 '16 at 18:38
  • 1
    Try getpw '#owner', and compare to getpw $USER Jul 1 '16 at 18:41
  • @KeithThompson Or, in this case, just stat xx (or another of the files).
    – user
    Jul 1 '16 at 21:04
3

It looks like that's actually the username. Try checking the passwd file, and you might find that somebody tried to comment out a line:

grep owner /etc/passwd

If you find that there is a line starting with #, then if there is another line which doesn't have it, you may want to remove the line with the #. Otherwise, you may just want to remove the #. That is, assuming that you don't actually want a user named #owner.

In most scripts, a # at the start of a line is considered to be a comment. That's not the case in /etc/passwd, and so, it is most likely to think that somebody meant to make a line a comment, which, if that worked, would act the same as removing it.

3
  • or grep ^#owner /etc/passwd or getent passwd \#owner
    – Jeff Schaller
    Jul 1 '16 at 19:26
  • Yes, that would be great to be specific. I was hoping, though, that he would see both the "commented" line, and the actual line. I think odds are good that somebody did that before making a copy, but just a guess.
    – DKing
    Jul 1 '16 at 20:41
  • What Unix variant doesn't support # to comment out lines in /etc/passwd? AFAIR at least Linux, FreeBSD, OpenBSD, OSF/1 and SunOS do. Jul 2 '16 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.