Introduction to Linux System Administrator (1)

Source: Internet
Author: User

Author Li Wanpeng

 

1.

Add User useradd + name

 

2.

Whoami command to view the current user and exit the current user using the exit command

 

3.

Ls-

. Bash_profile. bashrc

These two are the initialization of the user's login Environment

. Bash_logout

This is the script that the user executes when exiting the system.

 

4.

/Lost + found: fragment files found when the system starts the self-check Disk

/Misc, which contains files not classified

/Proc Virtual File System, which is short for process

/Sbin is a management tool used by super users. It is generally used only by administrators.

/Tmp each user can write, with a t-bit (Sticky Bit) permission to prevent users from writing files to each other

 

5.

Df command

Measure the test taker's knowledge about partition usage in the system.

Df-h looks better

Here/dev/shm is a virtual swap File System

Du can count the size of a file or directory.

Du-sh + file name

 

6.

Fdisk-l view disk status

Hdparm. If you are using an IDE hard disk, you can see the options supported by DMA.

Hdparm-d1/dev/hda

D Indicates DMA.

1 indicates on.

This command can be written to the/etc/rc. local file. rc. local is the script file started by the system and used by the Administrator.

 

7.

View network conditions

Nameserver is the DNS address

You can use netconfig to configure the network. This is a text window tool. After configuration:

I installed red hat 9 on Vmware to access the Internet. Method:

Bridge:
Vmnet0 is used by default.
Set the ip address of the Virtual Machine and the ip address of the host in the same network segment, and the rest are the same as those of the Host:
For example, if the host ip address is 9.123.247.43, set the Virtual Machine ip address to 9.123.247.11. Netmask, broadcast, gateway, and dns are all the same as the host to implement Internet communication between virtual machines <---> host virtual machines <---->.

 

Route-n View default routes

Add Default Gateway

# Route add default gw xxx. xxx

If we use ifconfig, the route command will not modify the configuration file, and the restart will be gone, but netconfig will modify the configuration file.

The network-related scripts are under/etc/sysconfig/network-scripts/, as shown in figure

 

8.

Locale command to view the language environment

All languages supported by locale-

 

9.

The setup command is a comprehensive Configuration tool.

# Setup

A lot of information can be set here, such as firewalls and system services on the following side.

 

 

 

 

10.

Runlevel view current running level

The default system services can be displayed in chkconfig -- list. These services are started by init. Xinetd is a super server and can run many sub-services. As long as it is enabled, all sub-services on under Xinetd will be enabled.

Start a service

# Chkconfig xxxx on

Eg.

# Chkconfig rsync on

# Chkconfig rsync -- list

Rsync on

# Service Xinetd restart

All services started by init are put under init. d.

Rc0.d ~ under etc ~ Rc6.d is actually a symbolic link.

Rc0.d ~ under rc. d ~ Rc6.d is also a symbolic link to the corresponding service under the init. d directory, rc0.d ~ In rc6.d, set the services that should be enabled at the running level and the services that should be disabled.

Rc. d/rc0 ~ In rc6, the start of K is not enabled, and the start of S is enabled, from one running level to another, and the start of K needs to be disabled.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.