Changing file permissions recursively

Every now and then you’ve got a massive directory tree whose reading permissions need to be changed. For example, all files readable to all users, all directories accessible to all users, all executables executable by all users.

This is easy enough to do with find and chmod commands. Assuming that the root of the directory tree is somedir:

Set all directories to rwxr-xr-x (a.k.a. 755)
find somedir -type d -print -exec chmod 755 {} \;

Make all files readable
find somedir -type f -print -exec chmod go+r {} \;

Change all 744 files, executable by the owner, to 755, executable by all:
find somedir -type f -perm 744 -print -exec chmod 755 {} \;

Filtering emails to subdirectories in GMail

I’ve used message filters in Thunderbird a long time and couldn’t really manage without them. I’ve also created filters for GMail mailboxes. But it would be nice to be able to add filtering in GMail itself, so that emails are always sorted regardless of the client I use to read them.

Here’s how:

  1. Create a subdirectory in Thunderbird or other emall client. GMail web interface doesn’t allow you to create a “real” subdirectory – creating a GMail label is not sufficient to make this work.
  2. Create a filter in Gmail web interface: click the down arrow in the search field, add search criteria, choose Create filter with this search.
  3. In the filter options, tick “Skip Inbox” and “Apply the label”, and choose the subdirectory created in step 1.
  4. If you want to filter all emails that already exists in Inbox, tick “Also apply filter to matching conversations.” as well.
%d bloggers like this: