You are not logged in.

#1 2015-12-30 00:29:03

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Great Command for "Tracing" Files!

Hey everyone, so I'm not sure how well known this is ( I suspect that you all may know about this) but I'm always curious as to finding out what files belong to what processor or package. For example if I take a tour of the /etc/ directory, it often becomes (to my untrained eye) a melting pot of different files and directories. Then in each directory like, /etc/X11 it further gets confusing. For example, I wasn't sure if the program xrdb was installed by X11 or Openbox.  Well I came across the handy dandy utility... apt-file!

So here's an example of it's amazi-awesomeness:

root@bunsen:/etc/X11# apt-file find /usr/bin/xrdb
X11-xserver-utils: /usr/bin/xrdb

So I can see it was install by X11! (big surprise) but seriously, I can now go through directories and find out their parent packages!

The only problem is that it matches by pattern. So if you search for a file whose name just so happens to appear in other packages, you'll get some misdirects. for example:

apt_file.png

In the above I searched 'apt-file find /etc/X11/Xsession
The output (which I truncated, it returned around 25 other files), returns all files that have the term Xsession attached, like  /usr/share/doc/sysprofile/examples/etc/X11/Xsession.sample

I didn't want to see the parent package for that! But this isn't really an issue, either with things like grep, regex or just staring long enough, you can find the the file that you specified...in my case it's /etc/X11/Xsession. On the image above it's the 5th line down. And it says, well look at that, installed by X11 as well! I wouldn't have thunk it!

wink

Anyway I'm off to see what else I can find and trace back to it's primordial source code soup.


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#2 2015-12-30 00:54:06

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: Great Command for "Tracing" Files!

Nice find, thanks Horizon_Brave smile

I didn't know about this one, it appears to be the Debian equivalent of pkgfile in Arch  8)

The ArchWiki has a "Pacman Rosetta" that lists several useful package management options for a wide variety of distributions, including Debian:
https://wiki.archlinux.org/index.php/Pacman/Rosetta

Offline

#3 2015-12-30 06:58:48

Snap
Member
Registered: 2015-10-02
Posts: 465

Re: Great Command for "Tracing" Files!

That's a cool one. Thanks for sharing, Horizon_Brave.

Same for you, HoaS. Link bookmarked.

Offline

#4 2015-12-30 09:03:59

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: Great Command for "Tracing" Files!

bookmarked indeed.
very useful cross-distro table.

Offline

#5 2015-12-31 00:30:37

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: Great Command for "Tracing" Files!

yay, I contributed something useful without asking multiple questions!  big_smile


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

Board footer

Powered by FluxBB