Daily Archives: 18.03.2013

Recursively replace a string in files

This will lookup recursively all files (type f) below /your/path and replace the string your_old_string by your_new_string. find /your/path/ -type f | xargs /usr/bin/perl -w -i -p -e "s/your_old_string/your_new_string/g" You might want to exclude certain file types or choose by name: find /your/path/ -type f -name "*.xml" | xargs /usr/bin/perl -w -i -p -e "s/your_old_string/your_new_string/g" find /your/path/ -type f -name "my*file*" | xargs /usr/bin/perl […]

Some useful APT options

apt by default reads files in /etc/apt/apt.conf.d/, so you can create a file for each line if you like to or create a new file in there and put them all in: Acquire::Check-Valid-Until "false"; #problems with not up2date mirrors, release file expired? APT::Get::AllowUnauthenticated "true"; #allow installation of unauthenticated files GPG::Check false; #disable all GPG checks […]