Optimize speed of deletion in find command

I would like to recommend to use + instead of \; in the find
command. As this will ensure the removal of all selected
directories in a single invocation.

Hence improve the speed of deletion.

Change-Id: I409fe11aae217afb6f790491591005c679264ed4
This commit is contained in:
AzherKhan 2014-10-27 09:42:05 -07:00
parent 3c8cf6a724
commit bb38d0e325
3 changed files with 3 additions and 3 deletions

View File

@ -11,4 +11,4 @@ APT::Acquire::Languages "none";
EOF
# And now make sure that we don't fall foul of Debian bug 641967
find $TARGET_ROOT/var/lib/apt/lists/ -type f -name '*_i18n_Translation-*' -exec sudo rm -f {} \;
find $TARGET_ROOT/var/lib/apt/lists/ -type f -name '*_i18n_Translation-*' -exec sudo rm -f {} +

View File

@ -9,7 +9,7 @@ yum remove -y grub2
# Remove all old versions of grub2 from the yum cache and then ensure the
# latest version is in the cache.
basearch=$(cat /etc/yum/vars/basearch)
find /tmp/yum/$basearch -regex ".*/grub2-[0-9].*\.rpm" -exec rm -f {} \;
find /tmp/yum/$basearch -regex ".*/grub2-[0-9].*\.rpm" -exec rm -f {} +
install-packages -d grub2
# Copy grub2 rpm out of mounted yum cache for install during finalise

View File

@ -171,7 +171,7 @@ function populate_lib () {
cp -a "$MODULE_DIR" "$TMP_MOUNT_PATH/lib/modules/$KERNEL_VERSION"
echo "Removing kernel framebuffer drivers to enforce text mode consoles..."
find $TMP_MOUNT_PATH/lib/modules/$KERNEL_VERSION/kernel/drivers/video -name '*fb.ko' -exec rm -v {} \;
find $TMP_MOUNT_PATH/lib/modules/$KERNEL_VERSION/kernel/drivers/video -name '*fb.ko' -exec rm -v {} +
if [ -d $FIRMWARE_DIR ]; then
cp -a "$FIRMWARE_DIR" "$TMP_MOUNT_PATH/lib/firmware"
fi