运维操作
查看硬件信息:
#查看cpu和内存
top
# 查看内存
free -m
# 查看磁盘分区,哪个分区大就把文件都放到大的分区里面.
df -h
网络操作
安装完成以后,ifconfig不好使; 使用
yum -y install net-tools
查看版本:
more /etc/redhat-release
一键升级:
yum upgrade
升级内核:
# 查看内核版本
rpm -qa|grep kernel
# 卸载内核
yum remove kernel-3.10.0-957.el7.x86_64
kernel-3.10.0-1160.42.2.el7.x86_64.rpm
磁盘挂载:参照网址:linux挂载新磁盘_云溪111的博客-CSDN博客_linux挂载磁盘
防火墙:Linux防火墙常用操作及端口开放_weixin_38819951的博客-CSDN博客_linux防火墙开放端口命令
selinconfig:关闭
vim /etc/selinux/config
打开文件数要修改,以下内容追加到此文件中(/etc/security/limits.conf)
# End of file
* soft nofile 65535
* hard nofile 65535
安装软件
所有软件安装尽量使用yum安装.
如果没有yum源可以把rpm包下载到本地,通过yum -y install rpm包的路径
如安装jdk
常用命令
- 复制大量文件覆盖相同的文件
# -f 表示强制,前面的\一定要添加
\cp -rf /usr/local/a/* /home/mddddc/b/
Windows中输入Linux命令;需要安装软件;cygwin
http://www.cygwin.com/setup-x86_64.exe
爬虫相关
wget相关的操作
wget --no-check-certificate \
--timeout=0 \
--header 'Authorization: HmacSHA xx:xx:xx' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host: xxx' \
--header 'Connection: keep-alive' \
--post-data '{"streamType":0,"protocolType":0,"id":"xx","type":0,"deviceId":"xx"}' \
'https://xx.xx.com/xx/xx/url/'
curl操作:
curl --location --request POST 'https://xx.xxxcom/third/video/url/' \
--header 'Authorization: HmacSHA xxx' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host: xxx.xx.xx' \
--header 'Connection: keep-alive' \
--data '{"streamType":0,"protocolType":0,"id":"xx","type":0,"deviceId":"xx"}'