I need a command to check all folder and files owner/ group permissions on linux server.
I have several websites and crons running the server. The idea is to get all files / folder in any website folder or crons having a owner apache. Which will list out the files and folder names whose owner is “apache” throughout the server
ls -R -l
However, I’d strongly urge you to go through sub-directories one at a time and not hit your server root with this command. You’ll be there a while and the output might be more than you can easily sort through at a go.
You can use find:
find /var/www/ -ls -user apache
-ls if for fancy output
also, there is
find /var/www -ls -not -user apache
to find all files that not belong to apache 🙂