2

This is in a continuation of question here

I run this command as root user

chown someuser:someuser /mnt/my-address

and then

# ls -l /mnt/my-address

response is

total 16
drwx------ 2 root root 16384 Aug 16 11:04 lost+found

but when i do

stat /mnt/my-address

and response is

File: `/mnt/my-address'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: ca51h/51793d    Inode: 2           Links: 3
Access: (0755/drwxr-xr-x)  Uid: (  106/ someuser)   Gid: (  112/ someuser)
Access: 2012-08-16 13:59:53.261099055 +0000
Modify: 2012-08-16 11:04:45.000000000 +0000
Change: 2012-08-16 13:59:44.013099226 +0000
 Birth: -

Why I am getting difference user and group with different commands?

1 Answers1

4

ls -l /mnt/my-address is showing you the files/directories inside my-address. These are only affected if you use the chown -R command to change ownership (R)ecursively. All you did was change the ownership of /mnt/my-address, not any of its contents.

stat /mnt/my-address gives you information on the actual directory/mountpoint /mnt/my-address though, whose ownership you did change. That's why the two are different.

ish
  • 139,926