#查看限制结果
ulimit -a
# 修改配置
# 删除最后一行
echo -e "# add_config" | sudo tee -a /etc/security/limits.conf
# 加上文本
echo -e "\n" | sudo tee -a /etc/security/limits.conf
echo -e "mzc \t soft \t nproc \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "mzc \t hard \t nproc \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "mzc \t soft \t nofile \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "mzc \t hard \t nofile \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "root \t soft \t nproc \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "root \t hard \t nproc \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "root \t soft \t nofile \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "root \t hard \t nofile \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "\n" | sudo tee -a /etc/security/limits.conf
echo -e "# End of file" | sudo tee -a /etc/security/limits.conf
echo -e "\n" | sudo tee -a /etc/systemd/system.conf
echo -e "# add_config" | sudo tee -a /etc/systemd/system.conf
echo -e "DefaultLimitNOFILE=204800" | sudo tee -a /etc/systemd/system.conf
echo -e "\n" | sudo tee -a /etc/systemd/user.conf
echo -e "# add_config" | sudo tee -a /etc/systemd/user.conf
echo -e "DefaultLimitNOFILE=204800" | sudo tee -a /etc/systemd/user.conf
标签:files,limits,many,sudo,tee,echo,etc,Too,conf
From: https://www.cnblogs.com/meizhengchao/p/18207308