bash - Batch Renaming in Shell -
i have full list of files like,
1066_hasoffers.apk.apk.txt 161_genesys.apk.apk.txt 231_attendance.apk.apk.txt 2956_bookingbug.apk.apk.txt 3394_sumall.apk.apk.txt 4306_vocus.apk.apk.txt ..... and one-liner rename them (say).
1066_hasoffers.txt 161_genesys.txt 231_attendance.txt 2956_bookingbug.txt 3394_sumall.txt 4306_vocus.txt .... how can done ?
rename command can used:
rename 's/apk.apk.//' *.txt which remove apk.apk file names.
or can use loop in bash:
for in *.txt; new=${i%apk.apk.txt}txt mv "${i}" "${new}" done
Comments
Post a Comment