0x00
This article belongs to the essay, only for the author's study record.
0x01 Bulk Modified image size:
[Email protected]:~/$ Find/-name ' *.jpg '-exec convert-resize 220x520! {} {} \;
Note: In the above command,
The Find path-name files that match the. jpg suffix
-exec to the find result, the Convert command is followed by the convert parameter, and if convert is not installed, sudo apt-get install convert is installed.
-resize width x Height, note x is an uppercase letter X,! Indicates that the original scale of the picture is not persisted, and the cast to the set dimension {} represents the find result, which acts as the convert parameter, which represents the meta-path and destination path.
Another thing to note is that the end needs to be added \; This command only succeeds, the author failed for a long time, and later found out that this is the reason. In this bamboo-blog article, it is mentioned that the order after the-exec is to end, and to consider the different systems; there may be different meanings, so add backslashes, which is a little vague, but it's good to remember as a rule.
0x02 File Batch rename:
[Email protected]:~/$ k=100; For i in ' ls '; Do mv-f $i ' echo $ (k) ". jpg"; k=k+1; Done
Reference documents
Http://hi.baidu.com/dinohu/item/1b2463314f549aba134b14d4
Http://www.cnblogs.com/peida/archive/2012/11/14/2769248.html