Tag Archives: sed

Bash: Simple command to mass replace content in directory

Imagine that we need to mass change the content in certain directory. A combination of find and sed can save the day. It is very to do it in perl as well. find /your/dir -type f | xargs sed -i ‘s/old/new/g’

mass files with illlegal names in linux

Windows are notorious for having files that are named with illegal characters like ?, & spacing…etc. To mass rename them, remember to use quotations in the mv command. eg for i in *; do mv “$i” newfile_”$i”; done; It took me along time to figure out that the error lies in the mv command and … Continue reading