Recently, vmserver was deployed to facilitate management of hosted servers. The db server is intended to be deployed in linux. Currently, Ubuntu is used. After the server version is installed, the system is dumb-eyed and full-command-line... So let's start to collect useful commands. Let's make a memo here.
1. Force uninstall and install the NIC to forcibly obtain ip addresses from dhcp
Sudo ifdown eth0
Sudo ifup eth0
(Similar to sudo dhclient-r, it seems that the current usage has not taken effect. I will try again later .)
2. Shutdown and restart
Sudo shutdown-p 0 shut down and power off after 0 seconds
Sudo shutdown-r 0 shut down and restart after 0 seconds
3. Set static IP address for ubuntu server
$ Sudo vi/etc/network/interfaces edit the IP settings file
------------------------------------------------- Split line ------------------------------------------------
# This file describes the network interfaces available on your system
# And how to activate them. For more information, see interfaces (5 ).
# The loopback network interface
Auto lo
Iface lo inet loopback
# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
Mapping hotplug
Script grep
Map eth0
# The primary network interface
Auto eth0
Iface eth0 inet static
Address 192.168.0.100 # This is your IP
Netmask 255.255.255.0
Network 192.168.0.0
Broadcast 192.168.0.255
Gateway 192.168.0.1
------------------------------------------------- Split line ------------------------------------------------
Sudo/etc/init. d/networking restart network connection
4 Tib decompress tar.gz package
Tar-xzf does not print the decompression progress
Tar-xvzf: print the decompression progress
5. Move or rename a folder
Mv from
6. New users and user groups
Groupadd usergroup Add User Group
Useradd-r-g user usergroup add user to group
7. Change the owner and group of the folder (. indicates all files and folders)
Chown-R user.
Chgrp-R user.
8. Copy files
Cp from
9. Change the User Password
Passwd [username]
Others to be continued