Article Directory
1 Clear the screen
#clear
2 Create a user
-
#useradd username
sudo dscl. -create / Users / username (mac terminal version) -
Password (Linux system each user has a password)
#passwd user name
sudo dscl. -Passwd / Users / username (mac terminal version) -
In the Linux system, by default, create a user at the same time give the user to create one of their own user directory in the directory system,
the directory is called the user's home directory / Home / username
Mac system was / the Users / username
root privileges directory is / var / root
home directory can be "~" instead of
3 switch user
- root user switches to a normal user
# | $ su - user name (no password) - Ordinary users to root
$ SU
the sudo -i (terminal MAC version) - Displays the current user's directory
# | $ pwd
Host name under 4Linux system
- View Host Name
# | $ hostname - Set the host name
#hostname host name
sudo scutil - set HostName Host name (mac terminal version)
in this way design the host name, using only the current is no problem, but after the restart the machine, the host name will automatically restore
reason: In the Linux system , system configuration information comes from documents. - Permanently modify the host name
#vi / etc / sysconfig / network
5 read the contents of files on a Linux system command
cat file name
6Linux System vi editing tools
- vi filename - to modify the file contents
- "I" is inserted into the edit mode
- esc exit insert mode
- : Wq Save the file
- :! Q does not save the file
7 reboot the system
- Shutdown
#halt - Restart
#reboot
#init 6