From 891c4d54411576f62d045f195f842882adaa13c0 Mon Sep 17 00:00:00 2001 From: trimstray Date: Thu, 4 Apr 2019 09:50:36 +0200 Subject: [PATCH] added new one-liner to 'find' commmand - signed-off-by: trimstray --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index eb0b720..8479dce 100644 --- a/README.md +++ b/README.md @@ -1445,6 +1445,12 @@ find . -type f -exec stat --format '%Y :%y %n' "{}" \; | sort -nr | cut -d: -f2- find . -not -path '*/\.git*' -type f -print0 | xargs -0 sed -i 's/foo/bar/g' ``` +###### Recursively find/replace of a string in directories and file names + +```bash +find . -depth -name '*test*' -execdir bash -c 'mv -v "$1" "${1//foo/bar}"' _ {} \; +``` + ###### Recursively find suid executables ```bash