Applyed a command to the wrong directory... How bad it is?

So, I’m completely new to Linux and VPS in general but so far I’m quite pleased with the experience, the thing is that I’m not the most avid linux user -duh!- so with that in mind I’m prone to making mistakes…

My problem is that I was following this guide and this one and for whatever reason my session timed out and had to reconnect… and I continued with the guide and did not check the directory I was in once I logged back… home… and applied this command at that location “sudo chown www-data:www-data * -R” … so my question is… How bad it is? Do I screwed the VM? Is there a way to undo that command? Back to square one and learn from my mistakes ? :P

I used a secondary user with sudo privileges as per the initial configuration setup guide.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


I ran the command using a secondary account account at the default location (/home/AdminAcc). This user has sudo privileges.

Would this command “chown -Rf AdminAcc /AdminAcc” do the same as the one you posted but for my user?


Assuming you had logged in as root you would have run this command in /root. While there are some places in the filesystem where running this command could have major issues luckily everything under /root is owned by the root user so a single command can put things back how they were.

chown -Rf root /root