LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 05-20-2023, 11:27 PM   #1
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Rep: Reputation: 10
Post 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.
 
Old 05-20-2023, 11:35 PM   #2
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,973

Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by Jason.nix View Post
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 View Post
Thank you.
You're welcome.
 
Old 05-21-2023, 03:53 AM   #3
Racho
Member
 
Registered: Oct 2021
Posts: 59

Rep: Reputation: Disabled
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!
 
Old 05-21-2023, 04:19 AM   #4
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,509

Rep: Reputation: Disabled
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.
Old 05-21-2023, 08:55 AM   #5
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,619

Rep: Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555

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.
Old 05-21-2023, 09:56 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,996

Rep: Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338
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.
 
Old 06-12-2023, 08:59 AM   #7
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by Racho View Post
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
 
Old 06-12-2023, 08:11 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,366
Blog Entries: 28

Rep: Reputation: 6161Reputation: 6161Reputation: 6161Reputation: 6161Reputation: 6161Reputation: 6161Reputation: 6161Reputation: 6161Reputation: 6161Reputation: 6161Reputation: 6161
See man locate.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Find files and directories on Linux with the find command LXer Syndicated Linux News 0 09-10-2021 04:30 AM
Find the directories which is older than x days delete and zip those directories ramesh pagadala Linux - Newbie 2 08-29-2013 08:17 AM
[SOLVED] curious: bash: not found (although its there and executable) - maybe 64bit related? Handtuch Linux - Software 7 05-03-2012 10:29 AM
Mount NTFS so that files are not executable buts directories are nasty_daemon Slackware 6 09-20-2005 01:51 AM
Running a Java executable class from another executable class LUB997 Programming 22 07-24-2005 04:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 05:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration