7

I checked the files

greedy@algorithms:~$ ls -l shared.md locknoblank.sh 
-rw-r--r-- 1 1000   1000 236 Nov 29 19:59 shared.md
-rwxr-xr-x 1 greedy 1000  58 Nov 29 14:38 locknoblank.sh

What does 1000 mean?

wjandrea
  • 14,236
  • 4
  • 48
  • 98
recursivleyGreedy
  • 117
  • 2
  • 2
  • 6
  • 2
    In Desktop Ubuntu, 1000 is usually the first user/group id that is created when installing. Maybe you removed that user, so that the system cannot get the name. But the files still have this ID. What is the output of id -u Or this is some custom/server installation ... – pLumo Nov 29 '18 at 15:06
  • Funny, I would expect this to be documented, but neither man ls or info coreutils 'ls invocation' mention it. – wjandrea Nov 29 '18 at 20:05

1 Answers1

7

The ls command tries to print the user name and group name when doing the long listing. However, the user and group are stored as the UID and GID in the file's metadata. If the UID cannot be looked up or the GID cannot be looked up, the ls -l command will just print out the UID and/or GID. That is what you are seeing. The file, "shared.md" is owned by UID 1000 and GID 1000, but there is no user on the system that has UID 1000, and no group on the system that has GID 1000. That is why ls -l prints out 1000 for the user and group.

For the file, "locknoblank.sh" the owner is greedy, but the group is GID 1000, for the same reason as above.

wjandrea
  • 14,236
  • 4
  • 48
  • 98
Lewis M
  • 755