Jump to content

Photo file operations

From Costa's Wiki
Revision as of 20:13, 11 February 2023 by 172.17.0.1 (talk) (Created page with "=== Change date and time of file by it's name === ls IMG* |while read -r rdate; do d=`echo $rdate | awk -F "_" '{print $2$3}' | sed 's/.jpg//g' | sed -E 's/(....)(..)(..)(.....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Change date and time of file by it's name

ls IMG* |while read -r rdate; do d=`echo $rdate | awk -F "_" '{print $2$3}' | sed 's/.jpg//g' | sed -E 's/(....)(..)(..)(..)(..)(..)/\1\/\2\/\3 \4:\5:\6/'`; touch -d"$d" $rdate ; done