on an rpm based system like Redhat or Centos or Rocky,
easy way... somewhat...
- use
rpm -qato list all installed rpms, - then for each rpm of what is currently installed do a
rpm -qlon each- for example
rpm -ql chronywill report/etc/chrony.confamong some ~40 other files making up that rpm - capture all the
*.conffiles from doing anrpm -qlon each rpm reported fromrpm -qaand save into a single text file named {for example}valid_confs.txt.
- for example
- run a
findon your local directories that you would consider a place for any installed/removed software for which could possibly contain a.conffile- for any
.conffiles resulting from runningfind, do a simplecat <found .conf file> valid_confs.txtand if it is not found then you found an orphaned .conf file... more specifically a .conf file that does not directly match to installed software asrpmhas it recorded for where it should be locatedlocated; if the paths mismatch but it's of an installed rpm then that will be useful as well.
- for any