Thursday, July 24, 2014

Customizing the UNIX User Environment - Part 1 - Working with UNIX environment - Part 4

Customizing the UNIX User Environment

**********************************************************************************

Working with UNIX environment

**********************************************************************************

 

User environment commands

------------------------------------------------------------

UNIX comes with many standard command programs, stored in directories such as /bin, /usr/bin, and /sbin.

Shell programs have additional commands built into them. These commands are known as user environment - or built-in - commands.

 

One of the most useful built-in commands is the su command. Executed without arguments, it allows you to become the root user while logged into any other account, as shown here.

This is extremely convenient if you find yourself in need of admin privileges while logged in as another user, as it saves you having to logout and in again as root. If you use su, you will be required to supply the root password.

 

bash-2.05a$ su

Password:

su-2.05a#

 

When you've finished your admin task, you end your su session with the exit command, which returns you to your normal shell.

 

su-2.05a# exit

exit

bash-2.05a$

 

One of the functions of groups in UNIX is to allow members of groups to share files with each other, or to access resources that belong to the group.

If you need to move a fils, directory or other resource to a different group, you can do so using the built-in command chgrp.

 

Syntax: chgrp [-R] new _groupt object

It takes atleast two arguments: the destination group and the name of the object being moved. And you can specify the -R option if you're moving a directory and you want its subdirectories and all their contents to be moved as well.

 

You can get a lost of all users currently logged into the system using who command.

You can find out more about a currently logged in user using the finger command with their username as an argument

 

The finger command produces info abt a currently logged in user, including their fullname, the path to theor home directory, and which shell they're currently using.

 

No comments:

Post a Comment