Monthly Archives: November 2015

bash rename files for loop

-
rw-rw---- 1 abc mail 47048 Nov 30 13:23 dovecot.index
-rw-rw---- 1 abc mail 800488 Nov 30 15:34 dovecot.index.cache
-rw-rw---- 1 abc mail 28740 Nov 30 15:34 dovecot.index.log
-rw-rw---- 1 abc mail 42928 Nov 30 13:23 dovecot.index.log.2
-rw-rw---- 1 abc mail 72 Sep 25 09:35 dovecot.mailbox.log
-rw-rw---- 1 abc mail 124846 Nov 30 15:34 dovecot-uidlist

hard way (Centos 5):
for i in dove*; do mv -v "$i" "${i%}_old" ; done

simple way:
rename -v 's/$/_old/' dovecot*

-rw-rw---- 1 abc mail 800488 Nov 30 15:34 dovecot.index.cache_old
-rw-rw---- 1 abc mail 42928 Nov 30 13:23 dovecot.index.log.2_old
-rw-rw---- 1 abc mail 28740 Nov 30 15:34 dovecot.index.log_old
-rw-rw---- 1 abc mail 47048 Nov 30 13:23 dovecot.index_old
-rw-rw---- 1 abc mail 72 Sep 25 09:35 dovecot.mailbox.log_old
-rw-rw---- 1 abc mail 124846 Nov 30 15:34 dovecot-uidlist_old

another example extension renaming with for loop:
for f in *.html; do mv $f ${f%.html}.php; done

apt-fast

apt-get install aria2
wget https://github.com/ilikenwf/apt-fast/archive/master.zip
nzip master.zip
cd apt-fast-master
cp apt-fast /usr/bin
cp apt-fast.conf /etc
cp ./man/apt-fast.8 /usr/share/man/man8
gzip /usr/share/man/man8/apt-fast.8
cp ./man/apt-fast.conf.5 /usr/share/man/man5
gzip /usr/share/man/man5/apt-fast.conf.5