Locating the config file of a command (for example, mutt)

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
erw1
Level 3
Level 3
Posts: 145
Joined: Sun Apr 08, 2018 12:58 am

Locating the config file of a command (for example, mutt)

Post by erw1 »

Below are the steps I have taken to locate the configuration file(s) of mutt, which should have been ~/.muttrc or ~/.mutt/muttrc, but isn't. Serendipitously I found some config files by looking in ~/.muttdebug<n> but I'm not sure they take the place of .muttrc. Could someone specify a protocol to find a config file that is not where the manual says it should be, with application to the case at hand?

Code: Select all

~ $ man mutt | grep 'muttrc'
       -F muttrc
              Specify an initialization file to read instead of ~/.muttrc
       ~/.muttrc or ~/.mutt/muttrc
       curses(3), mailcap(5), maildir(5), mbox(5), mutt_dotlock(1), muttrc(5), ncurses(3),  sendmail(1),

~ $ [ -d .emacs.d ] && echo "found" || echo "missing"
found
~ $ [ -d .mutt ] && echo "found" || echo "missing"
missing
~ $ [ -f .emacs ] && echo "found" || echo "missing"
found
~ $ [ -f .muttrc ] && echo "found" || echo "missing"
missing
~ $ ls -l /usr/bin/mutt
-rwxr-xr-x 1 root root 1065312 Jan 21 11:10 /usr/bin/mutt
~ $ strings /usr/bin/mutt | grep -E 'config|muttrc' 
configure_options
muttrc-1.9.4
%s/.config
~/.muttrc
config_charset
Reading configuration file '%s'.
enter a muttrc command
  -F <file>	specify an alternate muttrc file
  -Q <variable>	query a configuration variable
Local configuration error.
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
~ $ find . -maxdepth 1 -name '*mutt*'
./.muttdebug2
./.muttdebug4
./.muttdebug0
./.muttdebug1
./.muttdebug3
~ $ cat .muttdebug0
[2021-04-09 23:11:41] Mutt/1.9.4 (2018-02-28) debugging at level 2
[2021-04-09 23:11:41] Reading configuration file '/etc/Muttrc'.
[2021-04-09 23:11:41] Reading configuration file '/usr/lib/mutt/source-muttrc.d|'.
[2021-04-09 23:11:41] Reading configuration file '/etc/Muttrc.d/charset.rc'.
[2021-04-09 23:11:41] Reading configuration file '/etc/Muttrc.d/colors.rc'.
[2021-04-09 23:11:41] Reading configuration file '/etc/Muttrc.d/compressed-folders.rc'.
[2021-04-09 23:11:41] Reading configuration file '/etc/Muttrc.d/gpg.rc'.
[2021-04-09 23:11:41] Reading configuration file '/etc/Muttrc.d/smime.rc'.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
x64/LM 23+Xfce
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: Locating the config file of a command (for example, mutt)

Post by Moonstone Man »

erw1 wrote: Sat Apr 10, 2021 4:54 pm Could someone specify a protocol to find a config file that is not where the manual says it should be, with application to the case at hand?
You might not like this answer, but it is how I do it, and it works every time. If I don't get the exact answer, I do get a lot of clues.

I use search engine and read the results with an eye on spotting clues.
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Locating the config file of a command (for example, mutt)

Post by Flemur »

erw1 wrote: Sat Apr 10, 2021 4:54 pm B$ strings /usr/bin/mutt | grep -E 'config|muttrc'
I congratulate you on your creativity, but try this/these:

Code: Select all

find $HOME -iname "*mut*" 
find $HOME -iname "*rc"
find $HOME -iname "*conf*"  
You could also stick ls -l in front of them like this, to check the dates:

Code: Select all

ls -l `find $HOME -iname "*rc"`
` = back-tick, not single quote.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Locked

Return to “Software & Applications”