Tutoriel N° 2f2
shell command to find and exec
1- Find all png and cp them in /home/shareannonce/toto/ folder
rm -rf /home/shareannonce/toto
mkdir -p /home/shareannonce/toto;
find /mnt2/Users -type f -name "*.png" -exec cp "{}" /home/shareannonce/toto/ ;
mkdir -p /home/shareannonce/toto;
find /mnt2/Users -type f -name "*.png" -exec cp "{}" /home/shareannonce/toto/ ;
2- Effacer récursivement
find /home/ -name base.php -exec rm -f {} ;
find /home/shareannonce/ -name '._*' -exec rm -f {} ;
find /home/shareannonce/ -type f -exec du -sh {} ;
find /home/shareannonce/ -name '._*' -exec rm -f {} ;
find /home/shareannonce/ -type f -exec du -sh {} ;
source:
https://www.howtouselinux.com/post/linux-find-exec-examples-advanced-part#:~:text=Find%20exec%20causes%20find%20command,print%20files%20with%20certain%20content.