setsid(1)

setsid1

Run a program in a new session

Usage

setsid [options] program [arguments]

Overview

setsid runs a program in a new session. The command calls fork(2) if already a process group leader. Otherwise, it executes a program in the current process. This default behavior is possible to override by the --fork option.

Options

-c, --ctty

Set the controlling terminal to the current one.

-f, --fork

Always create a new process.

-w, --wait

Wait for the execution of the program to end, and return the exit status of this program as the exit status of setsid.

-h, --help

Display help text and exit.

-V, --version

Display version and exit.

Releases

10 releases since Debian 5.0 (Lenny); the text changed 9 times.

  1. 5.0
  2. 6.0
  3. 7
  4. 8
  5. 9
  6. 10
  7. 11
  8. 12
  9. 13
  10. Arch

--ctty since Debian 8 (Jessie); --fork since Debian 10 (Buster); --help since Debian 9 (Stretch); --version since Debian 9 (Stretch); --wait since Debian 8 (Jessie); -V since Debian 9 (Stretch); -c since Debian 8 (Jessie); -f since Debian 10 (Buster); -h since Debian 9 (Stretch); -w since Debian 8 (Jessie).

Authors

Rick Sladkey <[email protected]>

Reporting bugs

For bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>.

Availability

The setsid command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.

From util-linux 2.42.4-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.