Skip to content

Instantly share code, notes, and snippets.

@vmayoral
Created October 8, 2013 15:07
Show Gist options
  • Save vmayoral/6886204 to your computer and use it in GitHub Desktop.
Save vmayoral/6886204 to your computer and use it in GitHub Desktop.
Script for removing Gmail blocked files
#!/bin/bash
# Remove blocked files by gmail from a file structure.
# Gmail blocked files:
#.ade, .adp, .bat, .chm, .cmd, .com, .cpl, .exe, .hta, .ins, .isp, .jse, .lib, .mde, .msc, .msp, .mst, .pif, .scr, .sct, .shb, .sys, .vb, .vbe, .vbs, .vxd, .wsc, .wsf, .wsh
du -a|grep "\.ade$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.adp$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.bat$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.chm$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.cmd$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.com$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.cpl$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.exe$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.hta$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.ins$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.isp$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.jse$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.lib$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.mde$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.msc$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.msp$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.mst$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.pif$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.scr$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.sct$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.shb$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.sys$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.vb$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.vbe$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.vbs$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.vxd$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.wsc$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.wsf$"|awk '{print $2}'| sed 's/^/rm /g'
du -a|grep "\.wsh$"|awk '{print $2}'| sed 's/^/rm /g'
# to use it:
# ./gmail-blocked.sh | bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment