-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
linuxOperating skills and system analysisOperating skills and system analysis
Description
Basic
Replace
sed -i 's/before/after/' fileExecute multiple commands in the same line
sed -i -e '' -e '' fileValue
sed -i 's/'$value'/after/' file Save
sed -i 's/abc\(def\)/ghi/' file # ghidef
sed -i 's/abc\(def\)/\1/' file # defdef
sed -i 's/abc.*/[&]/' file # [abc.*] Delete
sed -i '1,$d' file # remove 1-end line
sed -i 's/abc//' file # delete all abcNote
- Special matching characters need to be escaped
Question
- Cannot execute when the variable contains special characters
Refrence
Metadata
Metadata
Assignees
Labels
linuxOperating skills and system analysisOperating skills and system analysis