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. # For Directories find ./ -type d -exec chmod 755 {} + # For Files find ./...

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    

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. cat /dev/null > /location/of/file.txt By adding this to the crontab it will overwrite the file at whatever interval...

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. 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. <Files *.php> deny from all...