Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-20-2023, 11:27 PM
|
#1
|
Member
Registered: Feb 2023
Posts: 630
Rep:
|
How to find the files and directories that related to an executable file?
Hello,
With "whereis" command, I can find the location of the binary, but how can I find the files and directories that related to that file? For example:
Code:
$ whereis firefox
firefox: /usr/bin/firefox
But, where are the files and directories that related to the Firefox?
Thank you.
|
|
|
05-20-2023, 11:35 PM
|
#2
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,265
|
Quote:
Originally Posted by Jason.nix
Where are the files and directories that related to the Firefox?
|
I'd look in /var/lib/pkgtools/packages/mozilla-firefox-113.0.1-x86_64-1 . I use Slackware. Your distribution may have this information elsewhere.
Quote:
Originally Posted by Jason.nix
Thank you.
|
You're welcome.
|
|
|
05-21-2023, 03:53 AM
|
#3
|
Member
Registered: Oct 2021
Posts: 94
Rep:
|
Your package manager can help you.
For example:
Code:
$ apt content firefox
for other package managers just read the man page.
The configuration files with your personal preferences should be in your home folder.
For example: ~/.thunderbird or ~./.mozilla/firefox
The configuration files for systemwide preferences in /etc/. For example /etc/firefox
I think that's it... but not really sure
Hope it helps anyway!
|
|
|
05-21-2023, 04:19 AM
|
#4
|
LQ Guru
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: One main distro, & some smaller ones casually.
Posts: 5,881
Rep: 
|
Possibly ldd at the command line.
Code:
ldd /bin/grep
linux-vdso.so.1 (0x00007fff1dd83000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fbbf50cc000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fbbf50c6000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbbf4ef1000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fbbf4ecf000)
/lib64/ld-linux-x86-64.so.2 (0x00007fbbf5197000)
Code:
ldd /usr/bin/firefox-esr
linux-vdso.so.1 (0x00007ffc967f7000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5527fb1000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5527fab000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f5527dde000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5527dc4000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5527bef000)
/lib64/ld-linux-x86-64.so.2 (0x00007f552808c000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5527aab000)
Last edited by fatmac; 05-21-2023 at 04:22 AM.
|
|
1 members found this post helpful.
|
05-21-2023, 08:55 AM
|
#5
|
Senior Member
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,930
|
Files come from packages.
On Debian-based systems, you can identify the package owning a file with " dpkg-query --search FILENAME" and then the other files provided by that package with " dpkg-query --listfiles PACKAGENAME"
For other systems, you might find the equivalent commands at: https://wiki.archlinux.org/title/Pacman/Rosetta
The ldd command shows you shared objects an executable uses - these will not always be in the same package, but may be in a dependent package.
Last edited by boughtonp; 05-21-2023 at 08:59 AM.
|
|
1 members found this post helpful.
|
05-21-2023, 09:56 AM
|
#6
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,310
|
more or less
1. you can find the package and you will see what files belong to that package (and most probably used by that app).2
2. ldd will show you the libraries used by the app (which are required to run it). But this list can be incomplete and changing (depending on the page you use).
3. lsof may show you the [currently] opened files, but this may also change over time
4. apps may have personal files somewhere inside your home
5. there can be a cache too.
|
|
|
06-12-2023, 08:59 AM
|
#7
|
Member
Registered: Feb 2023
Posts: 630
Original Poster
Rep:
|
Quote:
Originally Posted by Racho
Your package manager can help you.
For example:
Code:
$ apt content firefox
for other package managers just read the man page.
The configuration files with your personal preferences should be in your home folder.
For example: ~/.thunderbird or ~./.mozilla/firefox
The configuration files for systemwide preferences in /etc/. For example /etc/firefox
I think that's it... but not really sure
Hope it helps anyway!
|
Hello,
The command show me:
Code:
E: Invalid operation content
|
|
|
06-12-2023, 08:11 PM
|
#8
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,929
|
See man locate.
|
|
|
All times are GMT -5. The time now is 03:43 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|