1

I am trying to install a piece of software on a clean AWS instance. It requires changing permissions on a bunch of files.

The first batch goes ok after

sudo chmod 644 config.local.php
sudo chmod -R 755 design images var

But when I try to run

sudo find design -type f -print0 | xargs -0 chmod 644 

I get

chmod: changing permissions of 'design/.htaccess': Operation not permitted

When I run ls -l /usr/bin/sudo

I get root permissions of -rwsr-xr-x

Any ideas what might be wrong?

1 Answer 1

1

Your command is not working because of the |, xargs is running as your regular user since it is working in another process than the one find is running.

find let you execute commands on files found, your command becomes:

`sudo find design -type f -exec chmod 644 {} \;`

P.S: Don't forget the space before \;.

1
  • Spectacular - that worked! Thanks so much pim!
    – QbaQBar
    Jan 19, 2019 at 11:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .