Batch renaming files in command line and Xargs

后端 未结 9 723
余生分开走
余生分开走 2020-12-12 16:32

So, I have the following structure:

.
..
a.png
b.png 
c.png

I ran a command to resize them

ls | xargs -I xx convert xx -res         


        
9条回答
  •  伪装坚强ぢ
    2020-12-12 17:06

    My attempt from: https://www.tecmint.com/linux-image-conversion-tools/

    ls -1 *.png | xargs -n 1 bash -c 'convert "$0" "${0%.png}.jpg"'
    

    Using parallel

    parallel convert '{}' '{.}.jpg' ::: *.png
    

提交回复
热议问题