![]() Every UNIX system administrator needs to become root from time to time, but you should always use extra caution, and only execute commands as root when absolutely necessary. Letting root access fall into the wrong hands is, of course, also very dangerous. It’s relatively easy, with a few keystrokes, to erase massive amounts of data or render the system unusable. The root user has unlimited power over the operating system. For example, without quotation marks “ /Applications/My Folder/My App” will be interpreted by the command line as three items rather than one. On macOS the Finder hands off application starts to an admin cleared process named launchd. However, they are necessary if any part of the filename or path contains spaces. ![]() The quotation marks aren’t actually necessary in the example above.Then type ls to see the folder’s contents. Use the cd command to change to the appropriate folder ( cd /Applications). You can figure out whether an app uses this extension in Terminal. app” extension shown above, while others do not. Open Terminal (in Applications > Utilities) and at the command prompt, type: Suppose you want to run the Chess application as root. You can run any app the same way, using sudo and the open command. (If you haven’t used sudo in a while you’ll be prompted for your password first.) Typing sudo myProcess at a command prompt runs myProcess as root. This can be very useful: For example, if you want to edit a system configuration file in TextEdit or BBEdit, you’ll have to do so as root or you won’t be able to save changes. ![]() However, sudo can also be used to run any Mac OS X application as root. It lets you execute commands as root (also known as the super-user), which you may want to do periodically for various UNIX system administration tasks. If you’ve used Mac OS X’s command line at all, you may have already seen the sudo command. ![]()
0 Comments
Leave a Reply. |