CRUDINI(1)
π CRUDINI β bestie's guide to manipulating ini files π
okay so like. hi. you're looking at the crudini(1) page from the User Commands manual, and honestly? this little tool is a whole icon and you're about to be obsessed. it does one job: it manipulates ini files. that's it. that's the girl. and it does it so well. periodt. π
β¨ NAME β¨
crudini β manipulate ini files
π¦ SYNOPSIS π¦
crudini --set [OPTION]... config_file section [param] [value]
crudini --get [OPTION]... config_file [section] [param]
crudini --del [OPTION]... config_file section [param] [list value]
crudini --merge [OPTION]... config_file [section]
πΈ DESCRIPTION πΈ
crudini β a utility for manipulating ini files. no cap, that's the whole pitch. π
okay so the big one: SECTION can be empty ("") or "DEFAULT". when that happens, you're operating on params that aren't in a section β i.e. the global parameters. and heads up bestie, if you use 'DEFAULT' together with --set, an explicit [DEFAULT] section gets added. noted. π«Ά
also very slay: you can specify multiple --set/--del/--get operations for a single config_file. like, one invocation, many vibes. π₯
π OPTIONS π
--existing[=WHAT]β for--set,--deland--merge: fail if the item is missing.WHATcan be'file','section', or'param'. if you don't specifyWHAT, it means all specified items. lowkey strict, highkey useful. π--format=FMTβ for--get, pick the outputFMT. the formats are'sh','ini','lines'. pick your fighter. β¨--ini-options=OPTβ set options for how ini files get handled. the options are:'nospace': use the formatname=value, notname = value'space': ensure thename = valueformat'sectionspace': ensure one blank line between sections'ignoreindent': ignore leading whitespace
--inplaceβ lock and write files in place. > this is not atomic, but it has fewer restrictions than the default replacement method. so likeβ¦ know what you're doing, bestie. π--listβ for--setand--del, update a list (set) of values. yes, a whole set. main character energy. π--list-sep=STRβ delimit list values with"STR"instead of" ,". an emptySTRmeans any whitespace is a delimiter. π--output=FILEβ write output toFILEinstead.'-'means stdout. iconic.--verboseβ indicate on stderr if changes were made. she's chatty and we love that. π--helpβ write this help to stdout. π--versionβ write version to stdout. β
π EXAMPLES π
okay this is the fun part. let's go. π§
# Add/Update a var
crudini --set config_file section parameter value
# Add/Update a var in the root or global area. # I.e. that's not under a [section].
crudini --set config_file "" parameter value
# Update an existing var
crudini --set --existing config_file section parameter value
# Add/Update/Delete multiple variables atomically
crudini --set config_file section parameter1 value \
--set config_file section parameter2 value \
--del config_file section parameter3
# Get multiple items from stdin
env | crudini --get - '' USER --get - '' SHELL
# Add/Append a value to a comma separated list # Note any whitespace around commas is ignored
crudini --set --list config_file section parameter a_value
# Add/Append a value to a whitespace separated list # Note multiline lists are supported (as newline is whitespace)
crudini --set --list --list-sep= config_file section parameter
a_value
# Delete a var
crudini --del config_file section parameter
# Delete a section
crudini --del config_file section
# output a value
crudini --get config_file section parameter
# output a global value not in a section
crudini --get config_file "" parameter
# output a section
crudini --get config_file section
# output a section, parseable by shell
eval "$(crudini --get --format=sh config_file section)"
# update an ini file from shell variable(s)
echo name="$name" | crudini --merge config_file section
# merge an ini file from another ini
crudini --merge config_file < another.ini
# compare two ini files using standard UNIX text processing
diff <(crudini --get --format=lines file1.ini|sort) \
<(crudini --get --format=lines file2.ini|sort)
# Rewrite ini file to use name=value format rather than name = value
crudini --ini-options=nospace --set config_file ""
# Add/Update a var, ensuring complete file in name=value format
crudini --ini-options=nospace --set config_file section parameter
value
# Rewrite ini file to ensure a single blank line between sections, # and no leading or trailing blank lines
crudini --ini-options=sectionspace --set config_file ""
# Read indented ini file, like .gitconfig
crudini --ini-options=ignoreindent --format=lines --get
~/.gitconfig
and that's the whole page, bestie!! π«Ά this one's crudini 0.9.6, dated April 2025, and it came to you straight from the CRUDINI(1) manual. go forth and manipulate those ini files, you absolute legend. mwah. πβ¨ππ¦πΈπ
π¦ where this page comes from
- debian trixie: crudini 0.9.6-1 Β· GPL-2.0-only
- epel 10: crudini 0.9.6-1.el10_1 Β· GPL-2.0-only
- epel 9: crudini 0.9.6-1.el9 Β· GPL-2.0-only
- fedora 43: crudini 0.9.6-2.fc43 Β· GPL-2.0-only
- fedora 44: crudini 0.9.6-4.fc44 Β· GPL-2.0-only
- ubuntu questing: crudini 0.9.6-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms