LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

lua

programming language interpreter

TLDR

Start interactive interpreter
$ lua
copy
Run script
$ lua [script.lua]
copy
Execute code
$ lua -e "[print('Hello')]"
copy
Run with arguments
$ lua [script.lua] [arg1] [arg2]
copy
Show version
$ lua -v
copy
Interactive after script
$ lua -i [script.lua]
copy

SYNOPSIS

lua [options] [script] [args]

DESCRIPTION

lua is the interpreter for the Lua programming language. Lua is a lightweight, high-performance, embeddable scripting language designed for extending applications. It features automatic memory management, first-class functions, and a simple but powerful data structuring mechanism (tables).The interpreter runs Lua scripts and provides an interactive REPL for testing code. Lua is widely used for game scripting (World of Warcraft, Roblox), embedded systems, configuration (Neovim, Nginx via OpenResty), and as an extension language in applications like Redis and Wireshark.

PARAMETERS

SCRIPT

Lua script file.
ARGS
Script arguments.
-e CODE
Execute string.
-i
Interactive mode after script.
-l MODULE
Require module.
-v
Show version information.
-W
Turn warnings on.
--help
Display help information.

CAVEATS

Multiple versions exist (5.1-5.4). Some incompatibilities between versions. Embedding varies.

HISTORY

Lua was created in 1993 at PUC-Rio in Brazil, designed as a lightweight embeddable scripting language.

SEE ALSO

luajit(1), luac(1)

Copied to clipboard
Kai