2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-15 06:12:59 +00:00
cheat.sheets/sheets/sed
Igor Chubin 0adbf03348 Fix comment length in all first-level cheat sheets
*  sheets/MegaCli
*  sheets/az
*  sheets/azure
*  sheets/blktrace
*  sheets/emacs
*  sheets/exim
*  sheets/go
*  sheets/ipython
*  sheets/jq
*  sheets/nmap
*  sheets/perl
*  sheets/psql
*  sheets/redis
*  sheets/sed
*  sheets/smartctl
*  sheets/solidity
*  sheets/yq_v4
2020-11-22 13:10:48 +01:00

18 lines
681 B
Plaintext

# sed
# A stream editor. Used to perform basic text transformations
# Preview a file edit, via substitution.
sudo sed 's/Name=Xfce Session/Name=Xfce_Session/' FILE
# Replace the same string more than once per line (g flag)
sudo sed 's/Name=Xfce Session/Name=Xfce_Session/g' FILE
# Edit a file (adding -i flag), in-place; changes are made to the file(s).
sudo sed -i 's/Name=Xfce Session/Name=Xfce_Session/' FILE
# It can become necessary to escape special characters in your string.
sed -i 's/\/path\/to\/somewhere\//\/path\/to\/anotherplace\//' FILE
# Change your sed delimiter to a pipe to avoid escaping slashes.
sed -i 's|/path/to/somewhere/|/path/to/anotherplace/|' FILE