####################### # Useful Scripts ####################### #Thumbnailing all the JPEGs in the current directory for img in `ls *.jpg` do convert -sample 25%x25% $img thumb-$img done #Oder for file in * do if echo "$file" | grep -q ".JPG" #check if ".JPG" string exists in file string then exportFile=low/low_$file echo converting $file to $exportFile convert -size 1240x768 $file -resize 1240x768 $exportFile else echo $file is not convertible fi done #execute command dos2unix on each file under directory tmp with pattern core. find /tmp -name core -type f -print | xargs dos2unix #vim commands ## insert a list of ascending numbers :0put = range(11,15) :call append(0,range(11,15)) :for i in range(1,10) | put ='192.168.0.'.i | endfor