12 lines
229 B
Plaintext
12 lines
229 B
Plaintext
|
#!/bin/bash
|
||
|
set -e
|
||
|
path="$1"
|
||
|
shift 1
|
||
|
while [[ $path != / ]];
|
||
|
do
|
||
|
find "$path" -maxdepth 1 -mindepth 1 "$@"
|
||
|
# Note: if you want to ignore symlinks, use "$(realpath -s "$path"/..)"
|
||
|
path="$(readlink -f "$path"/..)"
|
||
|
done
|
||
|
|