The Unix Influence on Mac OS X - Page 3
A Command Named 'Su'
Not to be confused with sudo, the "su" command stands for "substitute user." It allows you to quickly substitute a user for any other user in Terminal Application. With the "su" command you can "go in" as one of your end users, for instance. To use this command, type in "su," followed by the user's name. Hit enter and type in the user's password.
"You really do need the user's password, though. So, this isn't a security hole," says White. To get back to the original account, enter "exit" at the prompt.
Modifying File Ownership and Permissions
Changes in file and folder ownership and permissions can be made either in the Finder, using the Get Info tool, or in Terminal Application. "Ownership and permissions define access to file and folder content. File permissions are defined separately for owner, group, or others. 'Others' are anyone that can somehow access your computer," according to The Mac Trainers.
Furthermore, "every file and folder belongs to one owner and one group. An owner is any user on the system. A group is simply a list of users." Only the owner, though, can change ownership of a file.
If you're using Terminal App, the "chown" command is employed for changing ownership, and the "chmod" command is used for changing permissions.
First, though, you should type in [s-] to view ownerships and permissions, according to Regan. You'll see separate columns for permissions, numbers of files, owner, group, size in bytes, modify date and time, and name. In the permissions column, the first character indicates type: "d" for directory, "l" for link, and "-" for file. Access rights are defined as follows: "r" for read, "w" for write, and "x" for access.
If the character "t" appears at the end of a permissions string, the sticky bit has been set, which means that the file or folder is append only. The sticky bit is typically used for the Shared Folder, in which anyone can add files to the folder, but renaming or deleting the file is restricted to the user who added the file.
Other common Unix commands Mac network administrators should be familiar with include the following:
Move file – mv <original> <destination>
Copy file – cp <original> <destination>
Erase file – rm <filename>
Erase directory – rm –R <directory>
Also in Unix, the cd command is for navigating directories, whereas the ls command is for listing file names. Unix utilizes the standard forward slash, /, to delineate directory hierarchies.