2013年8月3日星期六

Linux learning a, useradd

 
      
  • installed VMware
  •   
  • installed Linux
  •   
  • when installing Linux, created a user, dragon, and a password. . . This user is not root user without root privileges
  •   
  • can switch dragon to the user root, this time there is root privileges, the password to establish the user's password and installing the same
  •   
  • use of ordinary users, some commands are not allowed, as follows.
  •   
  •   
  • ordinary users and the root user

    http://blog.sina. com.cn/s/blog_67d873600100kst1.html

    http://www.cnblogs.com/xd502djj/archive/2011/11/23/2260094.html

  •   
  • enter the root user

  •   
  •   
  • this time still did not find the command useradd, using the locate command to view information useradd all paths.

    into / usr / sbin /, you can see that there useradd program. Why is it not found?

  •   
  •   
  • can use the full path to find the command, similar to windows

  •   
  •   
  • question is, command program on a path, in the GNU bash execute a command, it is how to find these programs do? The secret is to have a OS environment variable, $ PATH as shown above, in the environment variable $ PATH does not contain / usr / sbin path, so GNU bash can not find the path is not included in this program command.

  •   
  •   
  • Linux in bash, or shell, just same as cmd in Windows

  •   
  •   
  • order to be able to use another path command, Method One: Temporarily way is the command to export the path to the current OS environment variable $ PATH as shown above, the path has been in the current environment variables and useradd command is available.

  •   
  •   
  • above method is a temporary change environment variables, ie GNU bash up and running, it is read from the file of the environment variable, but during the run, you can export command to dynamically change this variable, the environment variable it is like a variable. Export is GNU bash process an order, rather than the other path command

    as shown below:

  •   
  • operation as described above, if the exit bash, then the environment variable changes made will be lost. Start again bash, bash reads the parameters from the file again and re-set environment variables. To once and modify $ PATH, is as follows:

  •   
  • View OS system environment variables
  •   
  •  
 

没有评论:

发表评论