Linux commands Four

Source: Internet
Author: User

Job One:

1) Add a 20G SCSI hard disk before opening the Linux system

2) Turn on the system, right click on the desktop, open the terminal

The command line interface is installed

3) for the newly added hard disk partition, a primary partition size of 10G, the remaining space to the extended partition, on the extended partition divided two logical partitions, the size of each 5G

4) format primary partition as EXT3 system

5) format two logical partitions for EXT4 system


5) Set logical partition to swap partition

[Email protected] ~]# MKSWAP/DEV/SDB3

6) enable the Swap partition for the previous step

[Email protected] ~]# swapon-a/DEV/SDB3

7) View the status of the swap partition

[Email protected] ~]# swapon-s

Job Two: Free command to view memory

Free-m (displays memory in megabytes)

Organizing the role of buffer and cache

Buffer is something that has not been written to disk, and the cache is something that has been read from disk to memory. Buffer is allocated by various processes and is used in areas such as input queues. A simple example is when a process requires multiple fields to be read, and before all fields are read into full, the process saves the previously read-in fields in buffer. The cache is often used on disk I/O requests, and if more than one process accesses a file, the file is made into a cache for next access, which improves system performance.

Calculate Real Memory utilization

Total = used + Free +buffers/cached The first mem line explains:   totals: Memory count;       used:  The number of memory used; free       :   the number of free memory;       Buffers/cached:      The size of the disk cache. The second part of swap refers to the swap partition, which is what we typically call virtual memory. Memory utilization equals (total-free-buffers-cached)/total=used/total=120/976=12%

Job Three: DD command to test hard drive speed

where if= file name: Enter a file name, default to standard input. The source file is specified. < if=input file >of= file name: Output file name, default is standard output. That is, the specified destination file. < of=output file >bs=bytes: Set the read/output block size to bytes bytes at the same time.

Job Four: Find a process named firewall and force it to kill

[[email protected] ~]# pgrep firewall[[email protected] ~]# kill-9 663

Job Five: RPM command
1) Mount the disc file to the/media directory

[Email protected] ~]# Mount/dev/cdrom/media

2) Enter the packages directory under the/media directory

[Email protected] ~]# cd/media/packages/

3) View all RPM packages installed on the system

[Email protected] ~]# RPM-QA

4) Check to see if the system is installing DHCP packages

[Email protected] ~]# Rpm-qa | grep DHCP

5) Install the DHCP package

[Email protected] ~]# RPM-IVH dhcp-*

6) View information for DHCP packages

[[email protected] ~]# Rpm-qi DHCP

7) View all files included in the DHCP package

[[email protected] ~]# RPM-QF DHCP

8) See which package generated the/bin/ls file

[Email protected] ~]# Rpm-qf/bin/ls

9) Uninstalling the DHCP package

[[email protected] ~]# rpm-e DHCP

Job Six: Yum command
1) Customizing the Yum repository: Createrepo

[[email protected] ~]# yum-y install createrepo[[email protected] yum.repos.d]# Mkdir/cangku[[email protected] Yum.repos . d]# Createrepo/cangku[[email Protected] yum.repos.d]# createrepo/cangkusaving Primary metadatasaving file lists Metada tasaving other metadatagenerating sqlite dbssqlite DBs complete

2) Customizing the repo file

[Email protected] yum.repos.d]# VI httpd.repo[httpd]name=httpd_serverbaseurl=file:///cangkuenabled=1gpgcheck=0

3) Install the HTTPD package using the Yum command

[Email protected] ~]# yum-y install httpd

4) Uninstalling the HTTPD package: yum–y Remove software name

[Email protected] ~]# yum–y remove httpd

5) Install the component ' KDE desktop ' using yum: Yum–y Groupinstall Component Name

[Email protected] ~]# yum–y groupinstall KDE

6) Master using Yum to remove components ' KDE Desktop ': Yum–y groupremove Component Name

[Email protected] ~]# yum–y groupremove KDE

7) Master purge Yum cache: Yum Clean all

8) Use Yum to find packages: Yum Search package Name

[email protected] ~]# Yum search httpd

Job Six: source code installation Python

1. [[email protected] ~]# Yum groupinstall development tools, install dev Kit 2, [[email protected] ~]# tar-xvf python-3.6.0.tgz, download good Python's tgz installation package, unzip. 3, [[email protected] ~]#./configure--prefix=/usr/local/python3.6, configuring Installation path 4, [[email protected] ~]# make && make Install 5, [[email protected] ~]# echo ' path=/usr/local/python3.6/bin: $PATH ' >>/etc/profile6, [[email protected] ~ ]# tail-1/etc/profilepath=/usr/local/python3.6/bin: $PATH 7, [[email protected] ~]# Source/etc/profile

Linux commands Four

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.