ps aux 查看所有进程
ps -ef |grep uwsgi 查看指定进程
cd / 切换目录
mkdir 创建目录
rmdir 删除目录
vim xx.log 创建目录并且编辑内容
i 在指定光标处编写内容
:q 退出编辑不保存
:q! 强制退出编辑不保存
:wq 退出并且保存
rm xx.log 删除文件
service nginx start 启动nginx
reload 重启nginx 加载最新配置
stop 停止运行nginx
nohup ****** $ 进程托管运行,(关闭cmd 程序也运行)
nohup yourcommand 2>&1 & 实现屏幕输出记录到当前目录的nohup.out文件中。
nohup yourcommand > myout.log 2>&1 & 日志输出到myout.log 文件中
ps命令也是nohup命令的好搭档,用于显示当前进程 (process) 的状态。可以监视后台程序是否在正常运行中或者已经挂掉。
ps -ef|grep yourcommand
tail -f myout.log 实时查看运行的日志文件信息
kill pid 杀死以pid的进程
killalll nginx 杀死nginx有关的进程
防火墙命令
systemctl start firewalld.service#启动firewall
systemctl stop firewalld.service#停止firewall
systemctl disable firewalld.service#禁止firewall开机启动
打开端口命令
sudo firewall-cmd --add-port=81/tcp --permanent
刷新
sudo firewall-cmd --reload
查看打开的端口
firewall-cmd --list-all