0

I was looking at some codes, and found this code

{ "su", "-c", "reboot" }

I know that this will make your phone to reboot, because it ask for su first then reboot, but I don't know what that -c means.

Its like an enter button on the keyboard? also could I add as much ones as I want? something like

{ "su", "-c", "code", "-c", "code", "-c", "code" }

Thanks

Rotary Heart
  • 1,899
  • 3
  • 29
  • 44

2 Answers2

4

-c is a flag that tells the su command to execute the command following -c. So in this case, it is simply, as root, telling the system to reboot.

Some documentation on the su command.

mjgpy3
  • 8,597
  • 5
  • 30
  • 51
0

su reboot already means "give me a session under the credentials of a user named reboot". So there has to be a way to indicate that reboot is not the name of a user to become, but the name of a command to run (as superuser).

(Does your system not have a man page for su?)

Kaz
  • 55,781
  • 9
  • 100
  • 149