mirror of
https://github.com/xmengnet/the-art-of-command-line.git
synced 2024-12-25 01:16:32 +08:00
Add instructions to manage filenames with whitespaces
This commit is contained in:
parent
b71341d816
commit
b1c5c32c53
1 changed files with 3 additions and 0 deletions
|
@ -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).
|
||||
|
|
Loading…
Reference in a new issue