1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:37:35 +00:00

Userland: Implement find -name clause

Closes https://github.com/SerenityOS/serenity/issues/4191
This commit is contained in:
Sergey Bugaev 2020-11-28 14:21:31 +03:00 committed by Andreas Kling
parent 1abda05d38
commit 952c0dc2a0
2 changed files with 30 additions and 0 deletions

View file

@ -35,6 +35,10 @@ specified commands, a `-print` command is implicitly appended.
* `-size number[c]`: Checks if the file has the given size in 512-byte blocks,
rounded up. If the size is followed by the `c` character, checks if the file
has the given size in bytes.
* `-name pattern`: Checks if the file name matches the given global-style
pattern (case sensitive).
* `-iname pattern`: Checks if the file name matches the given global-style
pattern (case insensitive).
* `-print`: Outputs the file path, followed by a newline. Always evaluates to
true.
* `-print0`: Outputs the file path, followed by a zero byte. Always evaluates to
@ -62,6 +66,8 @@ $ find -type d
$ find /tmp "(" -type s -o -user anon ")" -exec rm "{}" ";"
# Concatenate files with weird characters in their names:
$ find -type f -print0 | xargs -0 cat
# Find files with the word "config" in their name:
$ find -name \*config\*
```
## See also