find und was man damit machen kann

The find files


find . -type f -mtime -20 -printf "%P;%u;%g;%m\n" > /tmp/find_files
find . -type d -printf "%P;%u;%g;%m\n" > /tmp/find_dirs
while IFS=";" read -r path user group mode; do
[ -e "$path" ] || continue
chown "$user:$group" "$path"
chmod "$mode" "$path"
done < /tmp/find_files
while IFS=";" read -r path user group mode; do
[ -e "$path" ] || continue
chown "$user:$group" "$path"
chmod "$mode" "$path"
done < /tmp/find_dirs

Previous