Friday, October 14, 2016

Focus on Data Science

This blog will reflect a few of the topics that I am interested in that I would like to learn.  The best way of learning something is through teaching it so I am excited to begin this journey.

Find and copy

A quick way to find and list all the presentations and copy them to another directory.

find /home/user/ -type f -name "*.pptx" -exec cp -s --parents \{\} /home/user2/Presentations/ ';'

Thursday, May 19, 2016

Splitting PDB by delimiter

csplit  --prefix=chain --suffix="%1d".pdb 3FDL_Repair.pdb "/^TER/+1" "{*}"

Monday, March 7, 2016

Renaming Files

#!/bin/bash
for file in foo[0-9]*.png; do
  # strip the prefix ("foo") off the file name
  postfile=${file#foo}
  # strip the postfix (".png") off the file name
  number=${postfile%.png}
  # subtract 1 from the resulting number
  i=$((number-1))
  # copy to a new name in a new folder
  cp ${file} ../newframes/$(printf foo%08d.png $i)
done
http://stackoverflow.com/questions/55754/how-to-zero-pad-numbers-in-file-names-wit-a-bash-script