Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anyone please tell how can I change files/directories owned by me only.

below is the command that list out files/directories owned by me

 find . -user <username>
share|improve this question
up vote 1 down vote accepted

If your find already supports -exec {} +:

find . -user "$username" -exec chmod ... {} +

If it at least supports -print0 and your xargs supports -0:

find . -user "$username" -print0 | xargs -0 chmod ...

Or if there are no newlines in the file paths:

find . -user "$username" | xargs -d '\n' chmod ...
share|improve this answer
-exec ... {} + is standard and POSIX, the other ones are not. -0 is GNU and supported by a few others (like most recent BSDs, not AIX), -d is GNU only. All find implementations support -exec ... {} ';' – Stéphane Chazelas Feb 12 '14 at 16:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.