command

wget

下载全站内容

wget --mirror  -p --convert-links -P . http://xxxxx.com

seq

[root@centos get_artTitlelist]# seq -s "+" 10
1+2+3+4+5+6+7+8+9+10
[root@centos get_artTitlelist]# seq -f "stu%02g" 10
stu01
stu02
stu03
stu04
stu05
stu06
stu07
stu08
stu09
stu10

help

[root@centos get_artTitlelist]# seq --help
Usage: seq [OPTION]... LAST
  or:  seq [OPTION]... FIRST LAST
  or:  seq [OPTION]... FIRST INCREMENT LAST
Print numbers from FIRST to LAST, in steps of INCREMENT.

  -f, --format=FORMAT      use printf style floating-point FORMAT
  -s, --separator=STRING   use STRING to separate numbers (default: \n)
  -w, --equal-width        equalize width by padding with leading zeroes
      --help     display this help and exit
      --version  output version information and exit

...

yum

仅下载不安装

yum install yum-utils -y
yumdownloader

yum clean all //清除原有的yum信息
yum list //检查DVD软件列表

yum提示命令不存在

rpm -ivh --nodeps http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm

rpm -ivh --nodeps http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

yum repolist ##查看epel源是否安装成功
yum --enablerepo=epel info inotify-tools   查看某个包的详细信息

yum --disablerepo="*" --enablerepo="epel" list available | less  ##列出epel源的所有包列表

移除epel

yum remove epel...

yum -y update
# 升级所有包,改变软件设置和系统设置,系统版本内核都升级

yum -y upgrade
# 升级所有包,不改变软件设置和系统设置,系统版本升级,内核不改变

安装epel源

1、备份(如有配置其他epel源)

    mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
    mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup

2、下载新repo 到/etc/yum.repos.d/
epel(RHEL 7)

    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

epel(RHEL 6)

    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo

epel(RHEL 5)

    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-5.repo

## 方法二 ##

    yum install -y epel-release

yum设置软件缓存

keepcache=1 # 修改成1即可
[root@centos scripts]# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=1 # 修改成1即可
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release

#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d