Compressed packaging
Common Compressed Files
Windows:rar, Zip, 7z
Linux:.zip,. GZ,. bz2,. XZ,. Tar,. GZ,. tar.bz2,. Tar.xz
Gzip Compression Tool
It compresses directly behind the file name and can
Command: The meaning of gzip-d decompression
Command gzip-number indicates its compression level, 1--9, the larger the number the more rigorous, the default is to maintain the 6 level.
Command: File to view the extracted files, because it is uncompressed and is a binary file so you cannot use cat to view its contents.
Command: Zcat can view the contents of the extracted file
Command: Gzip-c When compressing it, assign it to a directory and do not let the file disappear.
Form: First decompression gzip-d 1.txt.gz
Gzip-c 1.txt >/tmp/1.txt.gz
Decompression: gzip-d-c/tmp/1.txt.gz >/tmp/d6z/2.txt
BZIP2 Compression Tool
First install Yum install-y bzip2
Command bzip2-d Decompression
Command Bzcat to view the contents of a file
XZ Compression Tool
Zip compression tool
Install Yum install-y Zip first
Compression form: Zip 2.txt.zip 2.txt
Command: Zip-r the compressed directory command
Command: Unzip extract files or directories
Tar packaging
Command: TAR-CVF Packaging command
Form: TAR-CVF Aminglinux.tar aminglinux/
Command: TAR-XVF unpacking command Form TRA-XVF Aminglinux.tar
Command: TAR-TF View the list inside the file
Command:--exclude filter the specified file not to pack it
Form: TAR-CVF Aminglinux.tar--exclude aming1 aminglinux
Package and Compress
Three ways to install packages
RPM Package Introduction
Mount mount/dev/cdrom/mnt/
Usage: Install RPM-IVH rpm
Upgrade Package RPM-UVH rpm
Uninstall RPM-E directly behind the parking name
Query the installed package RPM-QA
RPM-Q Package Name, query whether the specified package is installed
Rpm-qi querying the specified package information
RPM-QL package name, listing files for package installation
RPM-QF file absolute path to see which package the file was installed by
Yum Tool usage
Just parking name behind
Yum List List of available RPM packages
Configuration file for Ls/etc/yum.repos.d/yum
Yum Search package behind with vim or network
Yum List | grep filters a tool for strings, precise search
Yum install-y Install a package
Yum Grouplist all the available groups, and can also change Chinese to English, lang=en
Yum Groupinstall-y installs the package inside this kit, if there is a word, do not add ' single quotation marks, if there are two words with a space, plus
Yum remove-y Uninstall Package
Yum update-y Upgrade Pack
Yum provides "/*/vim" if your command is not available use this command to search to see which package it is installed on, such as Vim.
Yum builds local warehouses
① first to mount the image to the/MNT directory
② because some files may be deleted, make a backup first copy cp-r/etc/yum.repos.d/etc/yum.repos.d.bak
③ then delete rm-f/etc/yum.repos.d/*
④ then edit the configuration file Vim/etc/yum.repos.d/dvd.repo
⑤, write down the contents of the bottom.
[DVD] Name
Name=install DVD Customization
Where is the baseurl=file:///mnt RPM package?
Enable=1 is available
Gpcheck=0 whether to detect
⑥ before putting some cache cleanup Yum Cean all
⑦ look at the Yum list again.
Yum replaces the domestic source and replaces the Yum warehouse source.
The first thing to do is remove rm-f/yum.repos.d/dvd.repo
The copy of the test back to the CP. /yum./yum.repos.d.bak/*.
Then erase the mirror rm-f Centos-base.repo
In the download 163 image, with the second, wget Http://mirrors.163.com/.help/CentOS7-Base-163.repo
· Or
· Curl-o Http://mirrors.163.com/.heIp/CentOS7-Base-163.repo
· Yum list look at
Yum Download RPM Package
Installing the extension source Epel
Yum Install-y epel-release
Yum List Lgrep Epel
Yum Download RPM Package
Installation: Yum install-y package name--downloadonly only download not installed
· is/var/cache/yum/x86-64/7/
· Yum install-y Package name--downloadonly--downloaddir= path
Reinstall Download: Yum reinstall-y package name--downloadonly--downloaddir= path
--downloaddir Plus it means that only download does not install
SOURCE Package Installation
In the future, the source package is placed in this path
cd/usr/local/src/
Download an Apache wget http://mirrors.cnnic.cn/apache/httpd/httpd-
2.2.32.tar.gz
Then unzip it TAR-ZXVF httpd-2.2.32.tar.gz
After unpacking, go to this directory. CD httpd-2.2.32 ls look at
There's a readme. More readme Look at
There is also an install more to look at, this is the installation document, the method is as follows:
First step./configure--prefix=/usr/local/apache2
Step two make
Step three make Install
Uninstall is to delete the installed files
If you don't know your command, can you use echo $? command if it shows non-zero proof it's not right
Shell
Command history
History can save up to 1000 records
echo $HISTSIZ Environment variables
Vi/etc/profile can modify the data of the environment variable/search to Histsiz it can be modified and then source/etc/profile take effect
History-c can empty the cache in the current command history
History is just a command that shows the LD, how to record a command of what time it is running, can run this command: Histtim eformat= "%y/%m/%d%h:%m:%s" but only in the current terminal takes effect
Permanent entry requires Edit profile: Vim/etc/profile
/Search for histsiz command histtim eformat= "%y/%m/%d%h:%m:%s" put it there, as
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9A/A0/wKioL1lYrz-gtA_xAADGkaLTLow221.png "title=" Mjrbi9$taq%v@sv ' N4r20qb.png "alt=" Wkiol1lyrz-gta_xaadgkaltlow221.png "/>
Permanently save Chattr + a/.bash history
! N runs the specified command, n indicates the number
!echo in command history, looking for the first command to begin with Echo.
Command completion and aliases
TAB key,
Parameter completion: Yum install-y bash-completion
Reboot reboot
Alias aliases give the command a name again
Wildcard characters
· is *.txt file terminated with. txt
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9A/A2/wKioL1lYw-awB_wtAAFPDis1OIs301.png "title=" x}8~ B6]z[iw[9roens) y{fp.png "alt=" Wkiol1lyw-awb_wtaafpdis1ois301.png "/>
· Any one character of is?. txt
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/9A/A2/wKioL1lYxDuhzWZ9AADIaVN9fR8384.png "title=" u6xq~ svgx{z) X0@G7ATS1MV.png "alt=" Wkiol1lyxduhzwz9aadiavn9fr8384.png "/>
· is [0-9].txt within the range of
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9A/A1/wKiom1lYxEiR_JD_AAF6EGV8y_A346.png "title=" er7{ Ip}ri}{4nun{iz~sk6v.png "alt=" Wkiom1lyxeir_jd_aaf6egv8y_a346.png "/>
· is {1,2}.txt One of this range
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9A/A1/wKiom1lYxFnyyAt0AACG6TFN8W4330.png "title=" a%d6a (15~f_qo3ep] B})]x6.png "alt=" Wkiom1lyxfnyyat0aacg6tfn8w4330.png "/>
Input and output redirection
> The meaning of redirection
· Cat 1 txt > 2.txt put the output of the front file directly into the back of the file, redirect the contents of 1.txt to 2.txt, and it will delete the contents of the file to rewrite
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9A/A2/wKiom1lYzvvRIUmaAADEGCh8EnI506.png "title=" h$[4p $H]np9pdbme{4_w$74.png "alt=" Wkiom1lyzvvriumaaadegch8eni506.png "/>
> > Add the meaning that it will not remove your original content
· Cat I.txt >> 2.txt
2> error Redirect, it will specify the error message generated by the command input into the file
· is Aaa.txt 2>err
2>> Error Append redirect
· is Aaa.txt 2 >>err
Input redirection, the contents of a file or file on the right to the left of a file or command inside
· Wc-l < 1. txt
· Command > L.txt 2 > &1
&= the right and wrong combination
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9A/A2/wKiom1lYzxTyPGOLAAB1ZJ4p7-8206.png "title=" g_ 42w5cvk6siiv{g5jm{n]i.png "alt=" Wkiom1lyzxtypgolaab1zj4p7-8206.png "/>
This article is from the "12912638" blog, please be sure to keep this source http://12922638.blog.51cto.com/12912638/1943852
Note 6 compression tools, installation packages (RPM, yum, source packages), Shell.