Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Script to list all filesystem objects with ACLs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Script to list all filesystem objects with ACLs
Authored by: dasmart on Aug 19, '08 10:28:19AM

I had to change this:

find / -exec ls -alde {} ; 2>/dev/null > ~/acls/everything_$dt

to this.

find / -exec ls -alde {} + 2>/dev/null > ~/acls/everything_$dt

otherwise i kept getting this error:

find: -exec: no terminating ";" or "+"



[ Reply to This | # ]
Script to list all filesystem objects with ACLs
Authored by: xr4ti on Aug 19, '08 11:22:21AM
The comment is correct. The backslash got dropped (I assume it disappeared in the hint posting process). The "find" line should read:

find / -exec ls -alde {} \; 2>/dev/null > ~/acls/everything_$dt

[ Reply to This | # ]

Script to list all filesystem objects with ACLs
Authored by: kirkmc on Aug 19, '08 11:56:42AM

My bad. I forgot that there's an issue with backslashes in Geeklog. I've corrected the code in the post.

---
Read my blog: Kirkville -- http://www.mcelhearn.com
Musings, Opinion and Miscellanea, on Macs, iPods and more



[ Reply to This | # ]
Script to list all filesystem objects with ACLs
Authored by: koyeung on Aug 19, '08 01:13:59PM

it should be faster to exec with \+ (instead of \;):
"This behaviour is similar to that of xargs(1)."



[ Reply to This | # ]
Script to list all filesystem objects with ACLs
Authored by: lrivers on Aug 19, '08 04:58:30PM

I'm getting "tr: Illegal byte sequence" in the terminal at the end of the run. I get a huge text file and an essentially empty csv (and the timer document).

I copied the code for the script from the page and made sure all the slashes were right and so on...



[ Reply to This | # ]
Script to list all filesystem objects with ACLs
Authored by: xr4ti on Aug 22, '08 07:08:21PM

It is faster to use '+' (much faster, as it turns out).

I avoided '+' for two reasons: 1) I wasn't sure how much more memory the '+' approach takes on a large job like this, or even if it might overrun a buffer. (It does spawn multiple processes, so it must have some decent buffer management.) 2) It produces an output that is padded with spaces, which will make the output significantly larger for a large job like this.

I've since done some testing, and found that the '+' only takes about 4* the RAM during processing (not a big deal in today's world), and seems to avoid creating commands that are too large, so it's probably the better choice (if you don't mind a resulting file that is much bigger).

The two commands did give me slightly different results. With over 1M entries to slog through, I haven't yet found the differences. But the savings in time is probably worth the larger file, so I recommend changing the ';' to a '+'.



[ Reply to This | # ]
Script to list all filesystem objects with ACLs
Authored by: xr4ti on Aug 22, '08 07:18:06PM

It sounds like something wrong with the text inside the quotes after the "tr" commands. If you're sure you changed the ^A and ^B text to <ctrl>A and <ctrl>B, it's possible it's related to your locale settings or some default in your shell.

Try experimenting with a simpler command from Terminal, like:

ls -al | tr -s '
' '<ctrl>v<ctrl>A'

and see if you get an error.



[ Reply to This | # ]