Linux cmd


curl和wget的区别和使用

curl和wget基础功能有诸多重叠,curl由于可自定义各种请求参数所以在模拟web请求方面更擅长;wget由于支持ftp和Recursive所以在下载文件方面更擅长。

1.下载文件

curl -O http://man.linuxde.net/text.iso                    #O大写,不用O只是打印内容不会下载
wget http://www.linuxde.net/text.iso                       #不用参数,直接下载文件

2.下载文件并重命名

curl -o rename.iso http://man.linuxde.net/text.iso         #o小写
wget -O rename.zip http://www.linuxde.net/text.iso         #O大写

CentOs安装chrome

# 如果没有安装wget用下面这个命令 -y表示在后续提示是否安装中输入y
# yum -y install wget
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
yum localinstall google-chrome-stable_current_x86_64.rpm

CentOs安装字体

yum -y install fontconfig
yum -y install ttmkfdir
ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir
mkdir -p /usr/share/fonts/chinese
上传宋体至上面这个文件夹
chmod -R 755 /usr/share/fonts/chinese
fc-cache
# 下面这两个如果fonts.conf里没有这个配置的话加上
# vim /etc/fonts/fonts.conf
# /usr/share/fonts/chinese

CentOs安装ifconfig

yum search ifconfig
yum install net-tools.x86_64 -y

CentOs换源

# 先备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# 下载说明使用wget下载到上述目录内。
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache

CentOs指定yum安装软件路径

yum -c /etc/yum.conf --installroot=/opt/all_venv/ --releasever=/  install nginx
# -c /etc/yum.conf     指定yum配置文件地址
# --installroot=/usr/local    指定自定义的安装目录
# --releasever=/  指定yum源的临时版本