HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

fakeroot — Run a command in an environment faking root privileges for file manipulation. More information: <htt

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandrunfakerootclienvironmentrootfaking
linux

Problem

How to use the fakeroot command: Run a command in an environment faking root privileges for file manipulation. More information: <https://manned.org/fakeroot>.

Solution

fakeroot — Run a command in an environment faking root privileges for file manipulation. More information: <https://manned.org/fakeroot>.

Start the default shell as fakeroot:
fakeroot


Run a command as fakeroot:
fakeroot -- {{command}} {{command_arguments}}


Run a command as fakeroot and [s]ave the environment to a file on exit:
fakeroot -s {{path/to/file}} -- {{command}} {{command_arguments}}


Load a fakeroot environment and run a command as fakeroot:
fakeroot -i {{path/to/file}} -- {{command}} {{command_arguments}}


Run a command keeping the real ownership of files instead of pretending they are owned by root:
fakeroot {{[-u|--unknown-is-real]}} -- {{command}} {{command_arguments}}


Display help:
fakeroot {{[-h|--help]}}

Code Snippets

Start the default shell as fakeroot

fakeroot

Run a command as fakeroot

fakeroot -- {{command}} {{command_arguments}}

Run a command as fakeroot and [s]ave the environment to a file on exit

fakeroot -s {{path/to/file}} -- {{command}} {{command_arguments}}

Load a fakeroot environment and run a command as fakeroot

fakeroot -i {{path/to/file}} -- {{command}} {{command_arguments}}

Run a command keeping the real ownership of files instead of pretending they are owned by root

fakeroot {{[-u|--unknown-is-real]}} -- {{command}} {{command_arguments}}

Context

tldr-pages: linux/fakeroot

Revisions (0)

No revisions yet.