LinuxCommandLibrary

lsipc

List inter-process communication facilities

TLDR

Show information about all active IPC facilities

$ lsipc
copy

Show information about active shared [m]emory segments, message [q]ueues or [s]empahore sets
$ lsipc [--shmems|--queues|--semaphores]
copy

Show full details on the resource with a specific ID
$ lsipc [--shmems|--queues|--semaphores] [[-i|--id]] [resource_id]
copy

Print the given output columns (see all supported columns with --help)
$ lsipc [[-o|--output]] [KEY,ID,PERMS,SEND,STATUS,NSEMS,RESOURCE,...]
copy

Use [r]aw, [J]SON, [l]ist or [e]xport (key="value") format
$ lsipc [--raw|--json|--list|--export]
copy

Don't truncate the output
$ lsipc --notruncate
copy

SYNOPSIS

lsipc [OPTIONS]

PARAMETERS

-h, --help
    Display a help message and exit.

-V, --version
    Display version information and exit.

-J, --json
    Use JSON output format, ideal for scripting.

-H, --human
    Print human-readable sizes (e.g., 1K, 234M, 2G) for shared memory segments.

-l, --list
    List all IPC objects (this is the default behavior).

-i id, --id id
    Show details for a specific IPC object identified by its ID. Can be used with --ipc or type-specific options.

-ipc type, --ipc type
    Show only IPC objects of a specific type. Valid types are shm (shared memory), msg (message queues), and sem (semaphores).

-m, --shm
    Display only shared memory segments. This is a shorthand for --ipc shm.

-q, --msg
    Display only message queues. This is a shorthand for --ipc msg.

-s, --sem
    Display only semaphore arrays. This is a shorthand for --ipc sem.

-t, --time
    Display the time of the last control operation and the last operation for each object.

-B, --bytes
    Display shared memory sizes in bytes rather than a human-readable format (default when -H is not used).

--output list
    Specify which output columns to display. list is a comma-separated list of column names (e.g., ID,KEY,OWNER,SIZE). Use --help to see available columns.

--output-all
    Output all available columns. This option can be used with --json.

DESCRIPTION

lsipc is a utility that lists inter-process communication (IPC) facilities in Linux. It is part of the util-linux project and provides a modern, user-friendly interface for inspecting System V IPC objects, which include shared memory segments, message queues, and semaphore arrays.

It offers significant improvements over the older ipcs command, particularly with its ability to output information in a structured, machine-readable JSON format, making it ideal for scripting and automation.

Users can filter results by IPC type, display detailed information for specific IDs, and customize the output columns. It's an essential tool for system administrators and developers debugging applications that rely on IPC mechanisms or for general system monitoring.

CAVEATS

lsipc primarily focuses on System V IPC objects. It does not display information about POSIX IPC objects (e.g., POSIX message queues, semaphores, or shared memory created with shm_open).

To view detailed information for all IPC objects, the command usually requires root privileges or CAP_IPC_OWNER capability. Non-privileged users may only see limited information for objects they own or have explicit permissions for.

OUTPUT CUSTOMIZATION

Beyond basic filtering, lsipc allows extensive customization of its output via the --output and --output-all options. This enables users to select specific columns, such as ID, Key, Owner, Permissions, Size, Nattach, and Time, to tailor the information displayed to their exact needs, enhancing readability and usefulness for specific tasks.

JSON OUTPUT

A key advantage of lsipc over traditional IPC tools like ipcs is its native support for JSON output via the -J or --json option. This structured data format makes it significantly easier to parse lsipc's output programmatically, facilitating integration into scripts, monitoring tools, and automated system checks.

HISTORY

lsipc is a relatively modern command introduced as part of the util-linux project. It was developed to provide a more consistent, user-friendly, and especially scriptable interface for listing System V IPC facilities, addressing limitations of the older ipcs command. Its inclusion of JSON output capabilities highlights its design for modern scripting and automation workflows, making it a preferred tool for system diagnostics and monitoring in contemporary Linux environments.

SEE ALSO

ipcs(1), ipcrm(1), ipcmk(1), sysvipc(7)

Copied to clipboard