---
name: "setconf"
section: "1"
platform: "linux"
package: "setconf"
version: "0.7.7-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/setconf"
---

# setconf(1)

change settings in configuration textfiles

## NAME

setconf - change settings in configuration textfiles

## SYNOPSIS

**setconf** filename key value \[end string for a multiline value\]

## DESCRIPTION

If there's a textfile with fields like these:

**CC=gcc**

**lights := on**

**compileToday: true**

**anumber = 42**

**cabal ==1.2.3**

Setconf can change the values to something else. The value related to the first key found will be changed to the given value.

For example, **CC**  is a key and **gcc**  is a value.

## EXAMPLES

**setconf**\
   Exits with error code 1

**setconf Makefile.defaults NETSURF\_USE\_HARU\_PDF NO**\
   In Makefile.defaults, set NETSURF\_USE\_HARU\_PDF to NO

**setconf Makefile CC gcc**\
   Sets CC=gcc in Makefile

**setconf PKGBUILD sha256sums "('123abc' 'abc123')" ')'**\
   In the PKGBUILD file, set the value for the sha256sums keys to\
   ('123abc' 'abc123') regardless of how many lines the previous value\
   spans, since the end string ')' is given.

**setconf app.py NUMS "\[1, 2, 3\]" '\]'**\
   Multiline replacement, replacing the text from the value belonging\
   to the key NUMS to the endstring \] with the value \[1, 2, 3\],\
   regardless of how many lines the previous value spans.

**setconf my.conf x=1**\
   Sets x to 1 in my.conf, even if my.conf uses a different assignment,\
   like x := 42, x : 42, x == 42, x :: 42 or x =\> 42.

**setconf -a server.ini 'Z =\> 99'**\
   Adds Z =\> 99 to server.ini

**setconf --add rolling.conf N 1000**\
   Adds N=1000. Creates the file if needed.

**setconf test.file y-=0.1**\
   Decreases y with 0.1.

**setconf values.conf x+=2**\
   Increases x with 2.

**setconf -d linux/printk.h CONSOLE\_LOGLEVEL\_DEFAULT=4**\
   Changes #define CONSOLE\_LOGLEVEL\_DEFAULT to 4

**setconf -u kernel\_config CONFIG\_ULTRIX\_PARTITION=y**\
   Uncomment and set CONFIG\_ULTRIX\_PARTITION=y, even if the original\
   value is suffixed by "is not set". Intended for use with Linux kernel\
   configuration.

## OPTIONS

- **-v or--version**

  displays the current version number

- **-h or --help**

  displays brief usage information

- **-t or --test**

  performs internal self testing

- **-a or --add**

  adds an option, if not already present. Must be followed by a filename and a key/value pair.

- **-d or --define**

  changes a single-line #define value

- **-u or --uncomment**

  uncomments a key before changing the value

## WHY

Aims to solve a tiny problem properly instead of a thousand problems halfway, in true UNIX-spirit

Creates a line that is very easy to read, as opposed to using sed for the same task

It should be clear from the syntax what is being done

Only one small executable, not a big package

## SEE ALSO

[**sed**(1)](/sed/1.md) [**make**(1)](/make/1.md)

## BUGS

Only unknown bugs so far. Bugs can be reported at https://github.com/xyproto/setconf/issues.

## VERSION

0\.7.7

## AUTHOR

**setconf** was written by Alexander F. Rødseth \<xyproto@archlinux.org\> + contributors
