1. Linux system time settings
1. Run the date command to view the current time
[Root @ localhost ~] # Date
2013 14:55:26 CST
2. view the time help
[Root @ localhost ~] # Date -- Help
3. Set the system date
[Root @ localhost ~] # Data-s 02/21/13
4. Set the system time
[Root @ localhost ~] # Date-s 14:58:30
5. Make the system time take effect
[Root @ localhost ~] # Clock-W
2. Linux version number query
[ALM @ 21sq-bbkz01 csvn] $ CAT/etc/issue
Red Hat Enterprise Linux Server Release 5.8 (tikanga)
Kernel \ r on an \ m
3. Difference between Su root and Su-Root
Solution: Switch the Su-root user to the root user.
4. How to automatically restart the service when the system restarts
Solution: In other centos or RedHat systems, if services are installed later, such as httpd and mysqld, the system will not start automatically after installation. Even if you manually run/etc/init. d/mysqld start to start the service, the system will not start the service automatically after the server is restarted.
In this case, we need to set up after installation so that the system can automatically start these services to avoid unnecessary losses and troubles.
A. Check whether the service exists in the service list.
# Chkconfig -- list httpd
B. Add the service to the chkconfig list.
# Chkconfig -- add httpd
C. Set httpd to auto start upon startup:
# Chkconfig httpd on
0 ~ If both are off, the HTTPd service will not be automatically started when the system starts.
2 ~ If all five are on, it indicates that it will be automatically started.
5. After setting up a virtual machine and setting an IP address, other Intranet personnel cannot ping the IP address.(Wireless connection at this time)
Solution: 1. Change to intranet connection
2. Reset the IP address of centos to the IP address of the Intranet CIDR block.
3. Change the network connection access to the "bridging" mode and activate it.
4. Restart the network service network restart
5. Ping the network to test whether access is allowed.
6. The centos system sets sudo permissions for normal users.
A. Check whether sudo is installed.
# Rpm-Qa | grep sudo
B. Modify the/etc/sudoers file and add a sudo user.
# Define do-F/etc/sudoers
C. After root all = (all) All, add
Tom all = (all) All
Defaults: Tom timestamp_timeout =-1, runaspw
// Add the sudo permission for Tom in the normal account
//? Timestamp_timeout =-1 ??? You only need to verify the password once and the system will automatically remember it later.
//? Runaspw ???? The root password is required. If no password is added, the password of the common account is required by default.
D. Modify the. bash_profile file of a common user (VI/home/Tom/. bash_profile) and add the following lines to the PATH variable:
/Sbin:/usr/local/sbin:/usr/Kerberos/sbin
7. Establish a connection
Ln-S/opt/svnedge/csvn/data to establish a connection to the data under the root directory (run as root under the root directory)
8. obtain the services started by the current host
Netstat-tuln
9. Create multi-level Directories
Mkdir-P parent/Child1/clild2/.. (Linux)
MD parent/Child1/clild2/.. (Windows)