List all accessed configuration files while executing a program in linux terminal (improved version)

strace 2>&1 <any_executable> |egrep -o "\".*\.conf\""
Last listed files presumably have higher precedency then files listed first, i.e. configuration files in the personal .config directory will be listed last and their config parameters will be more authoritative then default config parameters defined in /etc directory which are usually listed above them. If you replace ".conf" with ".ini" in the command, initial files will be listed instead of config files. If you do not like to list multiple access to the same config file, pipe to "uniq" or "uniq -c" to prefix lines by the number of occurrences
Sample Output
$ # (grep -v fonts = suppressing listing immense number of font configs)

$ strace 2>&1 geany |egrep -o "\".*\.conf\"" | grep -v fonts 

"/home/knoppix5/.config/geany/geany.conf"
"/home/knoppix5/.config/geany/geany.conf"
"/home/knoppix5/.config/geany/geany.conf"
"/etc/nsswitch.conf"
"/usr/share/geany/filetype_extensions.conf"
"/home/knoppix5/.config/geany/filetype_extensions.conf"
"/home/knoppix5/.config/geany/snippets.conf"
"/usr/share/geany/snippets.conf"
"/home/knoppix5/.config/geany/snippets.conf"
"/home/knoppix5/.config/geany/plugins/filebrowser/filebrowser.conf"
"/home/knoppix5/.config/geany/plugins/saveactions/saveactions.conf"
"/home/knoppix5/.config/geany/keybindings.conf"
"/home/knoppix5/.config/geany/keybindings.conf"
"/usr/share/geany/colorschemes/github.conf"
"/home/knoppix5/.config/geany/colorschemes/github.conf"
"/usr/share/geany/colorschemes/github.conf"
"/home/knoppix5/.config/geany/colorschemes/github.conf"
"/home/knoppix5/.config/geany/geany.conf"
"/home/knoppix5/.config/geany/geany.conf"
"/home/knoppix5/.config/geany/plugins/filebrowser/filebrowser.conf"
"/home/knoppix5/.config/geany/plugins/filebrowser/filebrowser.conf"

3
By: knoppix5
2020-07-31 10:57:29

What Others Think

Good to know about it. I know you have put a lot of effort into making this article this much informational. CBD facts Thanks a lot for your efforts. I never find such an article like this. I hope you will share more such works.
zaiyamariya · 6 weeks ago
Linux terminal is a way of communicating with the most adaptable part of the operating system. Uncontested Divorce Mississauga
jonathantrott · 5 weeks and 3 days ago
I think that keeping yourself in shape is very important. So, I have a website, where you can find a lot of information about that. For example, cbd oil dosage for anxiety
MarkMiller · 3 weeks and 6 days ago
It was specially made and understood. Not at all like extra web journals, I have inspected which are truly not outrageously unprecedented. I in like way discovered your Mumbai Escorts posts particularly fascinating sureness coming about to analyze. I expected to go show it to my mate and he relished its experience also!
poojasharma69 · 2 weeks and 3 days ago
Note that many programs spawn child processes, and by default strace does not follow those when you are tracing the parent. To cover that, you need to use '-f' to follow child processes also.
dmmst19 · 2 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: