Linux Commands Examples

A great documentation place for Linux commands


run program with some namespaces unshared from parent


unshare [options] program [arguments]

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


no example yet ...

... Feel free to add your own example above to help other Linux-lovers !


Unshares specified namespaces from parent process and then executes specified program. Unshareable namespaces are:
mount namespace

mounting and unmounting filesystems will not affect rest of the system (CLONE_NEWNS flag),

UTS namespace

setting hostname, domainname will not affect rest of the system (CLONE_NEWUTS flag),

IPC namespace

process will have independent namespace for System V message queues, semaphore sets and shared memory segments (CLONE_NEWIPC flag),

network namespace

process will have independent IPv4 and IPv6 stacks, IP routing tables, firewall rules, the /proc/net and /sys/class/net directory trees, sockets etc. (CLONE_NEWNET flag).

See the clone(2) for exact semantics of the flags.


-h, --help

Print a help message,

-m, --mount

Unshare the mount namespace,

-u, --uts

Unshare the UTS namespace,

-i, --ipc

Unshare the IPC namespace,

-n, --net

Unshare the network namespace.


The unshare command is part of the util-linux package and is available from


The unshare command drops potential privileges before executing the target program. This allows to setuid unshare.


None known so far.

see also

unshare, clone


Mikhail Gusarov <dottedmag[:at:]dottedmag[:dot:]net>

How can this site be more helpful to YOU ?

give  feedback