The Different Commands between BSD Sed and GNU Sed

Replace string in the file.

GNU sed:

sed -i 's/original/new/g' test.txt

BSD sed. You have to specify a backup file, like:

sed -i .bak 's/original/new/g' test.txt

Comments

Popular posts from this blog

BdsDex: failed to load Boot0001 "UEFI BHYVE SATA DISK BHYVE-OABE-20A5-E582" from PciRoot(0x0)/Pci (0x2, 0x0)/Stat(0x0,0xFFFF,0x0) : Not Found

Install Shadowsocks-libev as Client on Debian Linux

FreeBSD安装SCIM中文输入法(csh/tcsh)