Linux Common commands

Source: Internet
Author: User
Tags yum repolist

Yum PS top pidof kill killall TR Cut command using the 1 Yum command
yum repolist all     list all warehouses. 
Yum List all     lists all packages in the repository
Yum Info package name   View package Information
Yum Install package name   Install package
Yum reinstal L Package Name Reinstall Package
Yum Update package name     Upgrade Package
Yum Remove package   Remove Package
Yum Clean all   Clear all warehouse cache
Y Um Check-update   Check for updatable packages
Yum grouplist   View installed package groups in the system
Yum Groupinstall Package Group   Install the specified package group
Yum Groupremove Package Group     Remove the specified package group
Yum groupinfo Package Group   Query the specified package group information
2 How to use PS command parameters for PS command

When you first execute this command is estimated to be stunned, so many output values how to look over? In fact, the usual Liu Yan teacher will be the PS command and the 3rd chapter of the pipe symbol technology used to crawl to a specified service process corresponding to the PID number, Common PS command parameters include:

Parametric action

-A shows all processes (including other users)
-u user and other details
-X shows no control of the terminal process
Linux system is running a lot of processes at all times, if you can manage them reasonably, it is absolutely beneficial to the performance optimization of the system, the Linux system is the most common 5 different states are run, interrupt, non-disruptive, zombie and stop, the meaning is:

R (Run): Running or waiting in the running queue.

S (interrupt): Dormant, waiting for a condition to form or receive a signal.

D (non-interruptible): The received signal does not wake up and is not operational, the process must wait until there is an interrupt.

Z: (Zombie): The process has terminated, but the process descriptor exists until the parent process calls WAIT4 () after the system call is released.

T: (STOP): Process received Sigstop, SIGSTP, Sigtin, Sigtou signal after stop operation.

When you execute the "PS aux" command, you will usually see the status of the process in the following format, only some of the output values are listed in the table, and the normal output values do not include the Chinese comment section:

The owner process ID number of the process the processor occupancy memory consumption virtual memory usage (in kilobytes) occupies a fixed amount (in kilobytes) of the time the terminal process state is started actually uses the CPU time command name and parameters
Root10.0 0.453684 7628? Ss 07:22 0:02/usr/lib/systemd/systemd
Root20.0 0.00 0? S 07:22 0:00 [Kthreadd]
Root30.0 0.00 0? S 07:22 0:00 [ksoftirqd/0]
Root50.0 0.00 0? s< 07:22 0:00 [kworker/0:0h]
Root70.0 0.00 0? S 07:22 0:00 [migration/0]
.................. Omit part of the output information ...... .....
3 top Command Top command in front of the five behavior of the system as a whole statistics, the following for the students in line to explain:

Top command in front of the five behavioral system of the overall statistics, the following for the students to explain the line:

top-09:39:38 up 23:05,2Users, load average:0.00, 0.01, 0.05
%CPU (s): 0.0 us, 0.2 sy, 0.0 ni, 99.8 ID, 0.0 wa, 0.0 hi, 0.0 si, 0.0th
KiB Mem:3882140Total3380476Free148312Used,353352Buff/cache
KiB Swap:4063228Total4063228Free0Used.3510648Avail Mem

Line 1th: System time, run time, number of login terminals, system load (1 minutes, 5 minutes, 15 minutes of average, the smaller the value, the lower the load).

Line 2nd: Total number of processes, running, sleeping, stopping, zombie.

Line 3rd: The user occupies resources, the system kernel consumes resources, changes the priority of the process, idle resources, waiting for input and output time.

This row data is CPU data and is displayed in percent format, such as "99.2 ID", which means that 99.2% of CPU processor resources are idle.

Line 4th: The total amount of physical memory, the amount of use, the amount of idle, as the amount of memory in the kernel cache.

Line 5th: Total amount of virtual memory, amount of usage, amount of idle, memory data that has been loaded in advance.

4 pidof Kill Killall Command for a process (1) pidof command to query the PID number value of a specified service process
[root@localhost ~]# pidof squid
[root@localhost ~]#
(2) The KILL command terminates a service process for a specified PID number,
[root@linuxprobe ~]# kill 2156
(3) The Killall command is used to terminate the entire process of a service with a specified name (meaning that the service is stopped and restarted, but the PID is changed)
[Root@localhost~]# pidof httpd
4907 4906 4905 4904 4903 4902
[Root@localhost~]# killall httpd
[Root@localhost~]# pidof httpd
5 TR command replaces characters in a text file (lowercase to uppercase)
[[email protected]Linuxprobe~]# cat Anaconda-ks.cfg | tr [A-z] [a-z]
#VERSION =rhel7
AUTH--enableshadow --passalgo=sha512

# Use CDROM installation MEDIA
6 Cut command to extract the desired character in the file-D is followed by a space (: Is the space) (-F is the first line you want to extract)
[Root@linuxprobe~]# head-n 2/ETC/PASSWD
Root:x:0:0: Root:/root:/bin/bash
Bin:x:1:1: Bin:/bin:/sbin/nologin
[Root@linuxprobe~]# cut-d:-f1/etc/passwd

Yang Wencheng

This article from the "New Network Society Blog" blog, reproduced please contact the author!

Linux Common commands

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: 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.