Reputation: 24316
I know this is technically a 3 part question, but it is all in the same vein. I need a way to generate a report, most likely text based, that will display all of the file permissions on all directories and files within a tree. The tree has a depth of X, I say X because it is possible that this tree will grow. Regardless I have a start for a *nix implementation, but it is definitely lacking.
*nix
ll */ */ */ * > perms.txt
This is of course pretty terrible based on the number of times I would need to repeat this, it does however generate the results that I desire. I imagine Solaris will look much the same, Windows I am not sure what to expect. Any help is greatly appreciated.
Upvotes: 2
Views: 8053
Reputation: 9085
On Windows use SetACL to get a full listing like this:
SetACL.exe -on "path" -ot file -actn list -lst "f:tab;w:d,o" -rec cont_obj
That creates a permission listing in tabular (= human readable) format including owner and DACL, recursing over all sub-containers and sub-objects.
Upvotes: 3
Reputation: 340171
For Windows, there's CACLS, but it doesn't recurse automatically to list ACLs. Here's a VBScript that will do that part for you: http://www.codeproject.com/KB/vbscript/VBScript_ACL_Crawl.aspx
On Linux it's probably simplest (and most portable) to use ls -lR
as ire_and_curses says.
Upvotes: 1
Reputation: 70142
Is recursive ls
sufficient?
ls -lR
Another good option is tree, which has nice output.
tree -p
Upvotes: 8