Simpanoz
Simpanoz

Reputation: 2859

How to get list of all dir/files belong to a user

1 - How can I get list of all files and directories with permission details, which belong to a particlular user.

2- How can I get all details of a file or directory like it's owner, group, permissions etc.

Upvotes: 5

Views: 22530

Answers (4)

Louis Papaloizou
Louis Papaloizou

Reputation: 282

find /path/to/dir/ -user <user> -name "*.dat"

Also works with -group option for finding files which belong to a group

Upvotes: 0

Thor
Thor

Reputation: 47089

Use find -ls:

find /some/path -user username -ls

Upvotes: 14

prosfilaes
prosfilaes

Reputation: 1308

To find all files that belong to a particular user, use find / -user username. Then you can use ls -al on the individual files.

Upvotes: 0

Ross McLellan
Ross McLellan

Reputation: 1881

To list all files including their permissions you can use ls -al or to do so recursively ls -alr You can then filter those results with grep to get particular ones (such as ones owned by a username)

ls -alR | grep ' username '

Upvotes: 5

Related Questions