mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-23 21:27:00 +00:00
find / -name [FILE] 2>&1 | grep -v 'Permission denied'
Signed-off-by: deinonychus <deinonychus@users.noreply.github.com>
This commit is contained in:
parent
de6733d5a9
commit
8bf41a1135
10
README.md
10
README.md
@ -1034,6 +1034,16 @@ find . -type f -empty -delete
|
||||
find . -type f | wc -l
|
||||
```
|
||||
|
||||
##### List all files with name [FILE] under /
|
||||
```bash
|
||||
find / -name [FILE] 2>&1 | grep -v 'Permission denied'
|
||||
|
||||
# 2>&1 redirects STDERR outputs to STDOUT which is piped
|
||||
# to the grep inverse filter (-v) filter command.
|
||||
# Thus, any errors are surpressed, mainly due to access attempts
|
||||
# on priviliged directories.
|
||||
```
|
||||
|
||||
## Condition and loop
|
||||
[[back to top](#handy-bash-one-liners)]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user