Batch process *.ext files
Template
$ find /path/ -name *.ext -exec sh -c 'command "$1"' _ {} \;Example
print file names without extension$ find /path/ -name *.ext -exec sh -c 'echo "${1%.*}"' _ {} \;
print base name (dirname), directory (dirname)
$ find /path/ -name *.ext -exec sh -c 'echo $(basename "$1")' _ {} \;
Batch convert *.ext to *.ext_bak
Template
$ find /path/ -name *.ext -exec sh -c 'convert "$1" "${1%.*}".ext_bak' _ {} \;Example
convert egg to bam file$ find /path/ -name *.egg -exec sh -c 'egg2bam "$1" -o "${1%.*}".bam' _ {} \;
No comments:
Post a Comment