How do I get permission owner information for all directories in bulk on Linux?

Asked 2 years ago, Updated 2 years ago, 282 views

I was ordered to do the subject matter at work.

For the time being, I didn't know how to do it, so I went to / and ran ls-lR.

To be honest, file permissions are not very important, but if we were to get all directories and even the permission owner settings for the lower directories in bulk, we could only think of the above commands.

Please let me know if there is any better way.

linux

2022-09-30 22:04

3 Answers

Like this

#find/-type d-print 0 | xargs-0ls-ld


2022-09-30 22:04

Use -ls in find to

 find/-type d-ls

and so on


2022-09-30 22:04

find+stat

$find/-type d-exec stat-c'%n%A%U%G'{}+

GNU findutils

$find --version
find (GNU findutils) 4.8.0

$ find/-type d-printf '%p%M%u%g\n'


2022-09-30 22:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.