Discussion:
find manipulating files with spaces
(too old to reply)
Dave
2007-11-20 01:59:12 UTC
Permalink
Hello,
I've got a rhel box that has a bunch of files restored from a tar
archive created on another type of Unix machine. The permissions are
completely wrong. I need to change them, owner, and group of both files and
directories. I usually do this with a combination of find and xargs as in:

find . -type f |xargs chmod 755

this usually works, this time i keep getting files not found error msgs. I
check for them with ls and they are there, the problem is the files either
have spaces in their names or colons or some other special character. How
would i get around this?
Thanks.
Dave.
HASM
2007-11-21 05:26:03 UTC
Permalink
Post by Dave
find . -type f |xargs chmod 755
this usually works, this time i keep getting files not found error msgs. I
check for them with ls and they are there, the problem is the files either
have spaces in their names or colons or some other special character. How
would i get around this?
find . -type f -print0 | xargs -0 chmod 755

Loading...