ABHIONLINUX
Site useful for linux administration and web hosting

2009/08/16

Changing permissions recursively

Changing permissions recursively

For changing the permissions of all the sub directories, please use the following

find . -type d -exec chmod 755 {} \;

For changing the permissions of all the sub directories, please use the following

find . -type f -exec chmod 644 {} \;

Kill processes for user

To easily kill all processes running under a user

ps -u USER | awk ‘{print $1}’ | xargs kill -9

or

pkill -u USER

replacing USER with the username.

To kill all specific processes such as php running under a user run,

ps -u USER | grep PROCESS |awk ‘{print $1}’ | xargs kill -9

replacing USER with username and PROCESS with php or any other process.