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 ./...
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...
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
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...