views:

28

answers:

2

Hi all, 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.

+1  A: 

Is recursive ls sufficient?

ls -lR

Another good option is tree, which has nice output.

tree -p
ire_and_curses
Thank you that is quite sufficient on *nix and most likely Solaris. Any suggestion for Windows?
Woot4Moo
Sorry, I don't know anything useful about Windows.
ire_and_curses
@ire_and_curses: You only know useless things about Windows? :-)
Vinko Vrsalovic
You will want to use `ls -lAR` rather than `ls -lR` so that filenames starting with a dot are not hidden (. and .. stay hidden).
jilles
@Vinko Vrsalovic - Or perhaps that I don't know anything that Windows is useful for? ;) Truth be told, I know almost nothing about Windows, useful or otherwise...
ire_and_curses
+1  A: 

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.

Vinko Vrsalovic
I will validate this as the evening progresses, thanks
Woot4Moo

related questions