Friday 19 September 2014

Linux command line : User Administration

User Administration
halt
This command shuts down the operating system, but can only be run by the root user.
#halt
reboot
This command shuts down and restarts the operating system. It also can only be run by root.
#reboot           [will perform simple reboot]
#reboot -f        [will perform fast reboot ]
init 0
This command also shuts down the operating system, and can only be run by root.
#init 0
init 6
This command restart the operating system. It also can only be run by root.
#init 6
man
This command opens the manual page for the command or utility specified. The man utility is a very useful tool. If you are unsure how to use any command, use man to access its manual page. For example, you could enter man ls at the shell prompt to learn how to use the ls utility.
#man ls
info
The info utility also displays a help page for the indicated command or utility. The information displayed with info command will be in-depth than that displayed in the man page for the same command.
info ls
su
This command switches the current user to a new user account. For example, if you’re logged in as vickey and need to change to user account to vinita, you can enter su vinita at the shell prompt. This command is most frequently used to switch to the superuser root account.
In fact, if you don’t supply a username, this utility assumes that you want to change to the root account. If you enter su -, then you will switch to the root user account and have all of root’s environment variables applied.
This command require password of the user you want switch.

cat

The most basic command for reading files is cat. The cat filename command scrolls the text within the filename file. It also works with multiple file names; it concatenates the file names that you might list as one continuous output to your screen. You can redirect the output to the file name of your choice.

ps

It's important to know what's running on your Linux computer. The ps command has a number of critical switches. When trying to diagnose a problem, it's common to get the fullest possible list of running processes, and then look for a specific program. For example, if the Firefox Web browser were to suddenly crash, you'd want to kill any associated processes. The ps aux | grep firefox command could then help you identify the process(es) that you need to kill.

who and w

If you want to know what users are currently logged into your system, use the who command or the w command. This can help you identify the usernames of those who are logged in, their terminal connections, their times of login, and the processes that they are running.



No comments:

Post a Comment