readonly
readonly is a Linux command in the Shell & Scripting category, rated advanced difficulty. Marks shell variables as read-only (unchangeable). The syntax is readonly name[=value]. It returns read-only variable. A close relative is echo, which displays a line of text. Used in scripts for output. A close relative is printf, which formats and prints data (like C printf). More control than echo. A close relative is export, which sets or exports environment variables for child processes. More about this category: Linux shell and scripting commands — bash, echo, export, alias, and more. Work with the shell environment and scripts. Related Shell & Scripting commands: echo, printf, export, source, alias, unalias, history, xargs. This page is part of the free Linux Reference documentation covering 304+ commands, each with syntax, options, practical examples, and a difficulty rating. Find readonly and the other essentials on the Linux cheat sheet, or return to the Linux Reference homepage.