Home » Questions » Computers [ Ask a new question ]

how to recursively add read privilege to all the files under a certain diretory

how to recursively add read privilege to all the files under a certain diretory

"I'm under linux . by default, other user can't read anything under my home directory .
let's see my home directory is /home/superman , and I tried to use"

Asked by: Guest | Views: 338
Total answers/comments: 1
bert [Entry]

"Use the -R switch to modify permissions recursively:

chmod +r /home/superman -R

but of course this is of no use if they can't go into deeper directories, so you may want to also give execute access to directories for the other users. This may not be necessary depending on your current umask value though:

find /home/superman -type d -exec chmod +x {} \;

If you'd only like them to be able to read stuff in your home directory, and no further:

find /home/superman -maxdepth 1 -type f -exec chmod +r {} \;"