Я забыл запустить update-initramfs -u после исправления подкачки в .../resume и и /etc/fstab
rsync
может сделать то, что вы хотите, быстро и легко:
rsync --dry-run --verbose --recursive --existing --ignore-existing --delete-after A/ B/
Из справки:
--existing skip creating new files on receiver
--ignore-existing skip updating files that already exist on receiver
--delete delete extraneous files from destination dirs
Удалите опцию пробного запуска
после того, как вы будете удовлетворены с предложенными результатами, чтобы фактически выполнить удаления.
В справочной странице есть более подробное описание параметров и даже упоминается ваш вариант использования:
--existing, --ignore-non-existing
This tells rsync to skip creating files (including directories)
that do not exist yet on the destination. If this option is
combined with the --ignore-existing option, no files will be
updated (which can be useful if all you want to do is to delete
extraneous files).
--ignore-existing
This tells rsync to skip updating files that already exist on
the destination (this does not ignore existing directores, or
nothing would get done). See also --existing.
Для каталогов одного уровня
diff -u <(ls A) <(ls B) | sed -n '4,$s/^+//p' | xargs -I{} ls -l B/{}
ls -l
следует изменить на rm -v
после тестирования, если он делает то, что вы хотите.
rsync
лучше, конечно. Но просто другой вариант.