To change path.info.n.done to path.info.n:
for file in *done ; do name=`echo $file | sed -e 's/.done//'`; cp $file $name; done
To put the pid back on for path.info files in *tempcopy* directories and save in pi.save:
for file in *tempcopy*; do name=`echo $file | sed -e 's/
\..*//'`;
cp $file/path.info pi.save/path.info.$name ; done
To split an extractedmin file for N atoms into separate files min_ with numerical values starting from 1 in a field of 5:
split –numeric=1 -l N -a 5 extractedmin min_
To rename the files without leading 0 padding in bash (note double quotes):
for fname in min_* ; do
echo $fname
newfile="$(echo $fname | sed -e 's/_0*/_/')"
echo $newfile
mv $fname $newfile
done