← 返回命令列表

Linux command

uci 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Get

uci get [network.lan.ipaddr]

Show

uci show [network]

Set

uci set [config].[section].[option]=[value]

Add

uci add [config] [section]

Delete

uci delete [config].[section].[option]

Commit

uci commit [config]

Revert

uci revert [config]

Add a value

uci add_list [network.lan.dns]=[8.8.8.8]

Show pending changes

uci changes

说明

uci (Unified Configuration Interface) manages OpenWrt configuration files. It provides a standardized way to read and modify the UCI configuration format used throughout OpenWrt. Configuration files are stored in /etc/config/ and are organized into files, sections, and options. Changes are staged in a temporary location and must be committed to take effect. The revert command discards uncommitted changes.

FAQ

What is the uci command used for?

uci (Unified Configuration Interface) manages OpenWrt configuration files. It provides a standardized way to read and modify the UCI configuration format used throughout OpenWrt. Configuration files are stored in /etc/config/ and are organized into files, sections, and options. Changes are staged in a temporary location and must be committed to take effect. The revert command discards uncommitted changes.

How do I run a basic uci example?

Run `uci get [network.lan.ipaddr]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more uci examples?

This page includes 9 examples for uci, plus related commands for nearby Linux tasks.