From b1c5c32c538e3a56d9ae24c55b83bde7e224edbc Mon Sep 17 00:00:00 2001 From: Uggla Date: Tue, 19 Jan 2016 20:08:49 +0100 Subject: [PATCH] Add instructions to manage filenames with whitespaces --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index c62dd30..d0eda11 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,9 @@ Notes: cat hosts | xargs -I{} ssh root@{} hostname ``` +- Use null character delimiter to manage filenames with whitespaces, example `locate -0 patern | xargs -0 ls -al` or `find / -print0 -type d | xargs -0 ls -al`. + To iterate on filenames containing whitespaces in a for loop, set your IFS to only '\n' using `IFS=$'\n'`. + - `pstree -p` is a helpful display of the process tree. - Use `pgrep` and `pkill` to find or signal processes by name (`-f` is helpful).