CLI Tips

The following short scripts are part of CLI magic in my daily work:

Batch rename the file extension Want mv .f90 .f? Here is one:

 for x in *.f90 ; do mv $x ${x%.*}.f ; done

dos2unix

perl -pi -e 's/\r\n/\n/;' *.f90