Replace a String in Multiple Files in Linux Using Grep and Sed

Categories: Uncategorized
Basic Format 1 grep -rl matchstring somedir/ | xargs sed -i 's/string1/string2/g' Note: The forward slash ‘/’ delimiter in the sed argument could also be a different delimiter (such as the pipe ‘|’ character). The pipe delimiter might be useful when searching through a lot of html files if you didn’t want to escape the forward slash, for instance. matchstring is the string you want to match, e.

Read More →

Backup VPS with Rclone and upload to Google Drive

Categories: Blog
This post is modified from Rclone – VPS Backup to Google Drive. I correct some bugs in the original code and added the function to backup Gogs database Ago I still used to store backup VPS using tools Duplicity or Rsync . However, now there was a new, more effective methods, saving more (Free), which is backed up to the Cloud with Rclone. Rclone is a tool for data synchronization similar Rsync but is focused on developing the functions connected to the cloud storage service.

Read More →

How to upgrade libpcre for CentOS 7

Categories: Software Use Uncategorized
Ok, this is the problem: if we need higher version of library in CentOS, how should we get it if it’s not in any repository? So, after a long time study, I found the only way is to compile it by myself. Actually, it’s not a big problem. But the thing is libpcre is a widely used package in CentOS. By running yum remove libpcre, you will realize that.

Read More →