Change Permissions or Ownership of Files or Directories Recursively

So I am always looking for the way to change all files or directories in a directory to a certain set of permissions.  Here are the following shell commands that you can use to accomplish it. chmod files or directories recursively Shell # For Directories find ./ -type...

Checking Active Processes

So this is a way to get a list of processes running for a specified user pstree -apu | grep username or ps aux | grep username 12345 pstree -apu | grep username or ps aux | grep username...

Delete a files contents through bash

So I was looking for a way to automatically overwrite a log file utilizing the command prompt and a cron job.  So this is how it can be accomplished. overwrite a file PHP cat /dev/null > /location/of/file.txt 1 cat /dev/null > /location/of/file.txt By adding...

Delete files older than 15 days in BASH

So every now and then I find myself wanting to delete all files older than a certain number of days.  Here is the linux command to do so. Delete all files older than 15 days find ./* -mtime +15 -type f -delete 1 find ./* -mtime +15 -type f -delete...

Disable PHP File Execution via .htaccess

Here is the code that you can put in your .htaccess file within a folder to disable php file execution.  It is very useful in the WordPress's wp-content/uploads directory for making sure files that get uploaded are not executable. Stop PHP File Execution <Files...