Tag Archives: bash

Maintaining Bash History across all the terminals

HISTCONTROL=ignoredups:erasedups
HISTFILE=~/.bash_history
HISTFILESIZE=5000
HISTSIZE=5000
shopt -s histappend

Append all above lines to ~/.bashrc and then
$ source ~/.bashrc

Advertisements

mass renaming songs.pk files

I don’t like the prefix songs.pk mp3 files have. But you download multiple files and using `mv` for each file is PITA. So I always prefer the following method. But I keep forgetting the syntax and have to refer
tldp abs. So today putting it as a blog post.

for i in *.mp3; do mv -i "${i}" "${i##\[*\-\ }" ; done

enjoy!!!