On Tue, Nov 17, 2020 at 10:22:23AM +0800, Wu Fengguang wrote:
- local downloaded_pkgs=$(find /var/ -type f -name "*.pkg.tar.xz")
+cleanup_downloaded_pkgs() +{
- find /var/ -type f -name "*.pkg.tar.xz" -exec rm -f -- '{}' ;
+}
btw what's the example find output?
% pacman -Sw wget resolving dependencies...
Packages (1) wget-1.20.3-3
Total Download Size: 0.63 MiB
:: Proceed with download? [Y/n] y warning: no /var/cache/pacman/pkg/ cache exists, creating... :: Retrieving packages... wget-1.20.3-3-aa... 642.3 KiB 4.75 MiB/s 00:00 [######################] 100% (1/1) checking keys in keyring [######################] 100% (1/1) checking package integrity [######################] 100%
% find /var/ -type f -name "*.pkg.tar.xz" /var/cache/pacman/pkg/wget-1.20.3-3-aarch64.pkg.tar.xz
Can we limit the find depth and/or let the base dir more exact?
/var => /var/cache/pacman/pkg/
change find dir to default cache dir
Thanks, Wang Yong