Categories
Linux Tutorials

How to find the owner and group of a directory in Ubuntu

There are two ways to find the owner and group of a directory in Ubuntu:

First way:

ls -l /path/to/file

The 3rd field outputted is the user and and the fourth is the group

drwxr-xr-x 2 user group 4096 Feb  7 01:17 foldername

Second way:

stat -c "%U %G" /path/to/file

This will return

user group

By Jonathan Whiting

I enjoy sharing what I am learning and hopefully it's of interest and help to you. I live in Canada with my wife. Follow me on Twitter.

Leave a Reply

Your email address will not be published.