So working with the ALU chassis, its totally the most fun time of my life (scp locally doesn’t support wildcards or directories, thank god I could initiate it remotely).

I scp’ed over a bunch of files, cores, diags, and backups all with an awesome naming convention like so:

9-2_backup-alu2.0_2001-10-18_16-48-03-gmt.tgz 9-2_backup-alu2.0_2001-10-18_17-48-03-gmt.tgz 9-2_backup-alu-core1.0_2001-10-09_14-21-14-gmt.tgz 9-2_backup-alu-core1.0_2001-10-09_14-23-09-gmt.tgz 9-2_backup-alu-diag1.0_2001-10-09_14-22-05-gmt.tgz

Where the basic number after “alu” is a backup, the core is a core, and the diag is a diag. Now I could have done something where I found all of what I actually want (the cores) and just moved them to a directory and then rm’ed everything else. Or, how I did it, was use find to delete the stuff I dont want.

find . -type f -iname “diag” -exec rm -rf ‘{}’ . \; # takes care of the diag files find . -regextype sed -regex “.*/.backup-alu...” -exec rm -rf ‘{}’ . \; # takes care of just the backups :)

Thanks for the help: http://stackoverflow.com/questions/6844785/how-to-use-regex-with-find-command

Mario Loria is a builder of diverse infrastructure with modern workloads on both bare-metal and cloud platforms. He's traversed roles in system administration, network engineering, and DevOps. You can learn more about him here.