diff --git a/wiki/linux/shell.md b/wiki/linux/shell.md index 01fd8ae..dbdfb35 100644 --- a/wiki/linux/shell.md +++ b/wiki/linux/shell.md @@ -210,6 +210,17 @@ cd ../"$(ls -F .. | grep '/' | grep -B1 -xF "${PWD##*/}/" | head -n 1)" cd ../"$(ls -F .. | grep '/' | grep -A1 -xF "${PWD##*/}/" | tail -n 1)" ``` +### Replacing All Occurences in a Directory + +To all occurences of a given string for all files recursively in a given directory run the +following command, where `` is the directory to replace in. +`` is the string to replace and `` is the string it should replaced with; both +of these may be escaped if special signs are contained in them. + +```sh +find -type f -exec sed -i "s///g" {} \; +``` + ## Error solving This section addresses various problems that can occur and are related to the shell.