Skip to main content

Config File Discovery

locate is the fastest way to find configuration files when you aren't sure where they are stored.

Finding Main Configs

# Find any nginx.conf
locate nginx.conf

# Find all php.ini files
locate php.ini

Narrowing by Directory

Combine with grep to find configs in specific locations:

# Find .conf files in /etc
locate ".conf" | grep "^/etc/"

# Find .yaml files in your home directory
locate ".yaml" | grep "^$HOME"

Finding Recently Created Configs

Since locate is based on a database, use sudo updatedb first to find files you just created.

sudo updatedb
locate my-new-config.json

Listing All Configs for a Service

# Find everything related to mysql configuration
locate -i mysql | grep "\.conf\|\.cnf\|\.ini"