wget 工具
wget工具用于从指定的URL地址下载文件,wget很稳定同时支持断点下载,在窄带宽和不稳定网络中有很强的适应性;
wget指令常用参数如下:
-h:显示帮助说明;
-b:后台下载;
-c:继续上次终端的下载任务;
-r:递归下载文件
使用示例:
1)下载单个文件
1
wget http://search.maven.org/remotecontent?filepath=log4j/log4j/1.2.17/log4j-1.2.17.tar.gz2)下载多个文件
1
wget -i fileList
fileList 内容
1
url12
url23
url33)断点下载
1
wget -c http://search.maven.org/remotecontent?filepath=log4j/log4j/1.2.17/log4j-1.2.17.tar.gz
4)后台下载
1
wget -b http://search.maven.org/remotecontent?filepath=log4j/log4j/1.2.17/log4j-1.2.17.tar.gz5)限速下载
1
wget --limit-rate=400k http://search.maven.org/remotecontent?filepath=log4j/log4j/1.2.17/log4j-1.2.17.tar.gz
yum工具
yum是CentOS下的软件下载安装工具,所有文件在yum源中下载,并自动执行安装过程,这些软件在yum源中以rpm包的形式存在;
对应在Ubuntu,Debian下的工具是 apt-get ,使用用法类似;
1)查看系统中的所有的 rpm 包
1
rpm -qa # 查看系统中所有已经安装的软件2
rpm -qa httpd # 查看系统中是否已经安装apache2)查看,查找 yum 源中的rpm包
1
yum list # 列举所有yum源上的安装包
2
yum search java # 查看yum源上的所有java相关资源
3)安装,删除rpm包
1
yum install tomcat #安装tomcat的默认最新版本rpm包2
yum install apche-tomcat-8.5.0 #安装tomcat指定版本,具体rpm包名称可以通过yum search tomcat查询获取3
4
yum remove apache-tomcat-8.5 #删除rpm包,包括所有相关的依赖性包4)更新rpm包
1
yum update #更新所有rpm包
2
yum update tomcat #更新指定包tomcat包
※ 如果某些rpm在yum中查找到的版本过低,找不到需要的包,可以更新epel 和 remi源
1
# Centos 6 的方式2
rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm3
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm4
5
#Centos 7 的方式6
yum install epel-release7
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm此时的查看,安装remi源的rpm包,指令如下(以下载php5.6为例)
1
#查看remi源上的php相关的包
2
yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
3
4
#安装remi源上的php5.6的所有运行包
5
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof
本文介绍了wget工具的基本用法及参数设置,包括普通下载、断点续传、后台下载及限速下载等操作。此外还详细讲解了yum工具的使用方法,如查看系统中的rpm包、搜索yum源中的包、安装及卸载rpm包、更新rpm包以及如何配置额外的源。
4239

被折叠的 条评论
为什么被折叠?



