Two simple one linear scripts that display Arch Linux disowned dirs or files
Show dirs that don't belong to any package:
alias pacman-disowned-dirs="comm -23 <(sudo find / \( -path '/dev' -o -path '/sys' -o -path '/run' -o -path '/tmp' -o -path '/mnt' -o -path '/srv' -o -path '/proc' -o -path '/boot' -o -path '/home' -o -path '/root' -o -path '/media' -o -path '/var/lib/pacman' -o -path '/var/cache/pacman' \) -prune -o -type d -print | sed 's/\([^/]\)$/\1\//' | sort -u) <(pacman -Qlq | sort -u)"
Show files that don't belong to any package:
alias pacman-disowned-files="comm -23 <(sudo find / \( -path '/dev' -o -path '/sys' -o -path '/run' -o -path '/tmp' -o -path '/mnt' -o -path '/srv' -o -path '/proc' -o -path '/boot' -o -path '/home' -o -path '/root' -o -path '/media' -o -path '/var/lib/pacman' -o -path '/var/cache/pacman' \) -prune -o -type f -print | sort -u) <(pacman -Qlq | sort -u)"
Even though the command finds in the whole filesystem, the speed is reasonable. I have also added this to the relative seciton in the Arch Linux Wiki.
Credits to the following links:
Written by Techlive Zheng
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Arch linux
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#