Linux part of the system management command usage summary

  

chkconfig—— system service settings

The chkconfig command is mainly used to update (start or stop) and query the run-level information of the system service. Keep in mind that chkconfig does not automatically disable or activate a service immediately, it simply changes the symbolic link.

Use syntax: chkconfig [--add][--del][--list][system service] or chkconfig [--level <level code>][system service][on/off /reset]

Parameter Usage: --add Adds the specified system service, allows the chkconfig command to manage it, and adds related data to the system-initiated narrative file. --del Deletes the specified system service, no longer managed by the chkconfig command, and deletes the relevant data in the system-initiated statement file. --level(s)<level code> Specifies which execution level the read system service is to be turned on or off. Level 0 means: indicates shutdown level 1 means: single user mode level 2 indicates: multi-user command line mode without network connection level 3 indicates: multi-user command line mode with network connection level 4 indicates: unavailable level 5 indicates: Multi-user mode level 6 of the graphical interface means: Restart It should be noted that the level option can specify the run level to be viewed and not necessarily the current run level. There can only be one startup script or stop script for each run level. When switching the run level, init will not restart the already started service, nor will it stop the stopped service again. Use the service servicename start/stop/restart command to restart the service for the changes to take effect.

chkconfig Displays usage when no parameters are run. If you add a service name, then check if the service is started at the current run level. If yes, return true, otherwise return false. If on, off, or reset is specified after the service name, chkconfi will change the startup information of the specified service. On and off respectively indicate that the service is started and stopped, and reset refers to the startup information of the reset service, regardless of what is specified by the problematic initialization script. On and off switches, the system is only valid for run levels 3, 4, 5 by default, but reset can be active for all run levels.

There are multiple running levels in Linux. The common ones are multi-user 2,3,4,5. Many people know that 5 is running X-Windows
, and 0 is shutting down. It is. Run level changes can be switched by the init command. For example, suppose you want to maintain the system into a single-user state, then you can use init1 to switch. During the Linux-level run-level switching process, the system automatically searches for files starting with K and S in the directory /etc/rc[0-6].d of the corresponding runlevel, and executes the scripts in the following numerical order. The maintenance of these scripts is very cumbersome. Linux provides the chkconfig command to update and query system services at different run levels.

Details: linux chkconfig command parameters and usage details - linux system service settings command


df—— view disk space usage

linux The df command parameter function: check the disk space occupation of the file system. You can use this command to get information about how much space the hard disk is occupied and how much space is left.

The meaning of each option of this command is as follows: -a Displays the disk usage of all file systems, including a file system of 0 blocks, such as the /proc file system. -k is displayed in k-bytes. -i Displays i-node information instead of disk blocks. -t Displays disk space usage for each specified type of file system. -x Lists disk space usage for a file system of a specified type (as opposed to the t option). -T Displays the file system type.

Example:

[root@localhost /]# df -ahT //View all disk usage, list disk types

Filesystem Type Size Used Avail Use% Mounted On /dev/mapper/VolGroup00-LogVol00 ext3 28G 1.5G 25G 6% /proc proc 0 0 0 - /proc sysfs sysfs 0 0 0 - /sys devpts devpts 0 0 0 - /dev/pts /dev/sda1 ext3 99M 19M 76M 20% /boot tmpfs tmpfs 506M 0 506M 0% /dev/shm none binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc sunrpc rpc_pipefs 0 0 0 - /var/lib/nfs/rpc_pipefs

Detailed description: Linux df command parameters and usage details


ps—— process view tool

Parameter:-A: All processes are displayed, with -e Has the same utility; -a : all processes not related to terminal ;-u : effective user related process ;x : usually used with a parameter to list more complete information.

Output format: l: Longer, more detailed information about the PID; j: Job format (fabs format) -f: Make a more complete output

eg

1. List the PIDs and related information that are currently your own login. [root@linux ~]# ps -l

2, list all current The program in the memory [root@linux ~]# ps aux

3, display all the programs with the display content of (1) [root@linux ~]# ps -lA

4, the program listing similar program tree display [root@linux ~] # ps -axjf

Details: linux ps command parameters and usage details


netstat— — Display Network Status

Using the netstat command allows you to know the network status of the entire Linux system.

This command parameter is too much, decisively ignored!

1, check out the connection and network information [root@localhost /]# netstat -ntulpa

2, view the current tcp listening port [root@localhost /]# netstat -nltp



Copyright © Windows knowledge All Rights Reserved