---
name: "crudini"
section: "1"
platform: "linux"
package: "crudini"
version: "0.9.6-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/crudini"
---

# crudini(1)

manipulate ini files

## 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

SECTION can be empty ("") or "DEFAULT" in which case, params not in a section, i.e. global parameters are operated on. If 'DEFAULT' is used with **--set**, an explicit \[DEFAULT\] section is added.

Multiple **--set**\|--del\|--get operations for a config\_file can be specified.

## OPTIONS

- **--existing**\[=*WHAT*\]

  For **--set**, **--del** and **--merge**, fail if item is missing, where WHAT is 'file', 'section', or 'param', or if WHAT not specified; all specified items.

- **--format**=*FMT*

  For **--get**, select the output FMT. Formats are 'sh','ini','lines'

- **--ini-options**=*OPT*

  Set options for handling ini files.  Options are: 'nospace': use format name=value not name = value 'space': ensure name = value format 'sectionspace': ensure one blank line between sections 'ignoreindent': ignore leading whitespace

- **--inplace**

  Lock and write files in place. This is not atomic but has less restrictions than the default replacement method.

- **--list**

  For **--set** and **--del**, update a list (set) of values

- **--list-sep**=*STR*

  Delimit list values with "STR" instead of " ,". An empty STR means any whitespace is a delimiter.

- **--output**=*FILE*

  Write output to FILE instead. '-' means stdout

- **--verbose**

  Indicate on stderr if changes were made

- **--help**

  Write this help to stdout

- **--version**

  Write version to stdout

## EXAMPLES

\# 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
