Article 5CBSB Script to find files that don't belong to stock Slackware system and installed packages

Script to find files that don't belong to stock Slackware system and installed packages

by
titopoquito
from LinuxQuestions.org on (#5CBSB)
Hi all,

I had the need (or wish :) ) to find orphaned files and such files, that I added to my system. Since I could not find that feature in one of the usual Slackware tools, I wrote a script for that myself. It's far from being perfect, but it does the job for me.

Save the script, save a copy of Slackware's MANIFEST.bz2 somewhere and change the first line after the shebang line accordingly. Additionally you can list a range of package tags (like "alien" for Eric's packages or "SBo" for the ones you installed from slackbuilds.org). Further down in the script there is a block of patterns that are excluded from the list (like stuff in /tmp oder /var/run or files in __pycache__ folders), modify it as you like.

The script tries to collect a list of all files from the MANIFEST and from all installed packages with the specified tags, including the symlinks that are created by the package's doinst.sh scripts. Then it perfoms a search of the whole system and tries to identify those files that are not in the before created list.

I get some small errors when running the script, like with one link from the vte package (I guess because the line creating a symlink contains a * wildcard). You will have to treat the generated list as a help, not as a perfect list that could be processed blindly.
Like I said, it's not perfect and takes a while to run, but for me it was helpful. Hopefully some of you find it helpful, too.

Suggestions are welcome (I suspect it could be made much for efficiently).

Cheers :hattip:
Attached Files
txt.giffind-possible-lint.txt (2.8 KB)
latest?d=yIl2AUoC8zA latest?i=XZl2a9GR4Jc:O39y5Q0LrEw:F7zBnMy latest?i=XZl2a9GR4Jc:O39y5Q0LrEw:V_sGLiP latest?d=qj6IDK7rITs latest?i=XZl2a9GR4Jc:O39y5Q0LrEw:gIN9vFwXZl2a9GR4Jc
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments