Ubuntu – How to find all the files related to a software

filesfind

I'm not sure if it is possible, but if it is, how can I find all the files related to a software? For example, is there any way to find all files that gedit needs and uses to work?

Does such command/techniques gather files like /usr/share/gtksourceview-3.0/styles/oblivion.xml which is not dedicated only to a certain software or owned by a different one?

Best Answer

To list files belonging to a package, run

$ dpkg -L packagename

Note: does not include configuration files, usually.

To find the package a file belongs to, run

$ dpkg -S /path/to/file