Job One:
1) Add a 15G SCSI hard disk before opening the Linux system
2) Turn on the system, right click on the desktop, open the terminal
3) for the newly added hard disk partition, a primary partition size of 5G, the remaining space to the extended partition, on the extended partition divided 1 logical partitions, the size of 5G
fdisk-l /dev/sdb See more details on new drive SDB the first hard drive is called SDA, and the new second one is called SDB, and then an additional is called SDC, and so on.
fdisk /dev/sdb to the SDB hard disk block in the/dev directory disk partition m view Help
N Add a new partition p Add primary partition after two not written is the default last +5g is to set the primary partition size
p Print the added partition table to see the next
W writes to the list of disks and exits the circled disk information is a 5G size primary partition that has just been added successfully
Fdisk/dev/sdb to the SDB hard disk block in the/dev directory partition n Add a partition e add an extended partition after 2 empty all default to the last 1 empty means to add the hard disk after the primary partition The remaining space size is divided to the extended partition p print added extended partition column See View w write to disk list and exit
Fdisk/dev/sdb to the SDB hard disk block in the/dev directory partition n Add a partition L Add a logical partition (only P and L are shown here because the logical partition L Zone, the extended partition has been divided so that no extension partition E has been added) the first empty default after +5g for logical partition set 5G size p Print partition list w write to disk list and exit
fdisk-l /dev/sdb Use the fadisk-l command to view the disk details of the partition under the/DEV/SDB directory, partition complete
4) format primary partition as EXT3 system
mkfs. ext3 /dev/sdb1 Use the command mkfs format for. ext3 to format the/SDB1 primary partition under the/dev directory
5) Set logical partition to swap partition
Mkswap /DEV/SDB5 using the Mkswap command to set the/SDB5 logical partition under the/dev directory to a swap partition (that is, virtual partition or virtual memory)
6) enable the Swap partition for the previous step
swapon /DEV/SDB5 using the Swapon command to enable the/SDB5 swap partition under the/dev directory
swapon-s Lists the status of all system swap partitions that are currently in use and views
7) View the status of the swap partition
swapon-s Lists the status of all system swap partitions that are currently in use and views
Job Two:
1) Free command to view memory
Free View memory Information
2) Organizing buffer and cache function
Buffer has not been written to the hard disk file for storing data to be output to disk (block device).
The cache has read the memory file, storing the data read from disk
Both are designed to improve IO performance and are managed by the OS
3) Calculate the actual memory utilization
Real memory Usage = amount of real memory used (Yellow Line portion)/Total memory (Blue line portion)
Calculation result: 491544/999936=49% (rounding take Integer)
Job Three: DD command to test hard drive speed
DD if=/dev/sdb1 of=/x.txt bs=10m count=1 will be in the/dev directory/sdb1 files written to/under the X.txt file, 2M block size, the number is 1
(DD command is a tool to test the speed of a hard drive, but this is a very amateur tool, not necessarily accurate)
Note: if (inputfile) of (outputfile)
See Test drive Speed Results: Copy 4.2M file, time 1.07718s, write speed is 3.9m/s
Job Four: Find a process named Init and force it to kill
PS aux view all process grep filtering (equivalent to filtering out other processes, just looking for the desired process, for example: grep init means to see only init-related processes)
PS aux | grep init uses PS aux |grep to view only init-related processes
Pstree View all processes in a tree-like manner
Pgrep only filter the process you want to see (tree)
Run Firefox & process here & means let the program run in the background without taking up the operation of the current terminal (see Red and Yellow sections)
Then pkill-9 Firefox process directly to Kill (Red section), found that the Firefox process is still running in the background is closed (kill), no (see red circle).
Kill (here plus process PID) kills the process (normal kill, may not kill)
Kill-9 (add process PID here) Force kill process
Jobs view background in run work number
Kill-9% The work number can be used to view the background running process work number, and then through the kill-9% (processing in this case) this way can also kill the process (the way to kill the background running the program)
Pkill-9 (add process name here) (Another way to kill the process)
Pkill-9 Init forced to kill Init process
Job Five: RPM command
1) Mount the disc file to the/media directory
Mount/run/media/root/centos\ 7\ x86_64 mount disc file to/run/media
2) Enter the packages directory under the/media directory
Ls/run/media/root/centos\ 7\ x86 64/View directory to find the attached disc
Cd/run/media/root/centos\ 7\ x86 64/re-enter HERE
LS Packages re-view Packages directory information
3) View all RPM packages installed on the system
LS Packages | Less to view the installed RPM packages in a paginated manner
4) Check to see if the system is installing DHCP packages
5) Install the DHCP package
CD Packages First enter the Packages directory
RPM-IVH DHCP-........... RPM-IVH install DHCP this package
6) View information for DHCP packages
Rpm-qi DHCP uses RPM-QI to view package DHCP details
RPM-QA Viewing all system packages
7) View all files included in the DHCP package
RPM-QL DHCP uses RPM-QL to view the file installation path of the DHCP package and all files contained in it
8) See which package generated the/bin/ls file
RPM-QF See which package the file was generated by, RPM-QF followed by the filename/bin/ls, to find out coreutils this package (yellow), indicating that this file is generated by the Coreutils this package
9) Uninstalling the DHCP package
RPM-E DHCP removal package (uninstall)
Rpm-e ' rpm-qa |grep file name ' Remove the result ' from the command inside the inverted quotation mark this way will increase productivity, for example to remove a lot of packages
Job Six: Yum command
1) Customizing the Yum repository: Createrepo
View disc Information
Mount to/opt Directory
Go to/opt directory to view information
2) Customizing the repo file
Go to the YUN.REPOS.D directory first
⑴
⑵
Then create local and edit the information, see ⑴⑵ Step
[Local]
Name=local Repo
Baseurl=file:///opt
Enabled=1
Gpgcheck=0
3) Install the HTTPD package using the Yum command
Yum-y httpd installing httpd software with Yum
Here is the installation information:
Note Press Y to confirm the installation, but you can actually install it directly via the yum-y command (omit hint)
Installation Complete
4) Uninstalling the HTTPD package: yum–y Remove software name
Yum-y Remove httpd
5) Install the component ' KDE desktop ' using yum: Yum–y Groupinstall Component Name
Installation information omitted
Yum–y Groupinstall KDE Plasma Workspaces
6) Master using Yum to remove components ' KDE Desktop ': Yum–y groupremove Component Name
yum–y Groupremove KDE Plasma Workspaces
7) Master purge Yum cache: Yum Clean all
Yum Clear All
8) Use Yum to find packages: Yum Search package Name
Yum Search httpd
Job Six: source code installation Python
1) Python compressed package download (official website: www.python.org)
2) Load Xshell 5
3) Installation process:
Linux basic--------Monitoring system, process management, package management-------free, DD, kill, RPM, yum, source installation python