The command won't output anything at all if it worked unless you add the V option to make it produce output verbosley. I recomend you read the chmod
manual available here or by running man chmod
as you should make sure you know what each command is doing.
To make it work recursivly, you just need to pass the -R
recursive flag - e.g. so this command will make everything in /opt/lampp/htdocs
have the permission -rwxr-xr-x
(file folder owner can read. write and execute, the group and everyone else can read and execute :
sudo chmod -R 755 /opt/lampp/htdocs
Please note that this I think will apply to both files and directories, and if directories do not have a executable permission they won't work (see here). So if you don't want files to be excutable, you will need to use something like this (probably as root):
find /path/to/base/dir -type d -exec chmod 755 {} +
find /path/to/base/dir -type f -exec chmod 644 {} +
If you want to know what this does, you can read the relevant parts of the find manual (man find
). Basically if find all the files/folders in the specified path and changes the permissions of them.
If you want to become the owner (and group) of the files (may not recommendable for server and system configuration files) so you can change (write to) them, consult this question. This is also possible by being in a group that has write access to the files, or by making all 'other' users have write access to them
/opt/lampp/htdocs
todrwxr-xr-x
, is that what you wanted?/opt/lampp/htdocs
.ls -l
or thetree
command.