美文网首页
Linux常用命令

Linux常用命令

作者: 锅碗瓢盆油盐酱醋 | 来源:发表于2021-01-16 14:25 被阅读0次

1.和指定服务器同步时间

#手动方式
ntpdate remoteIp
#自动方式,配后crond定时同步(十分钟同步一次)
0 0/10 * * *  /usr/sbin/ntpdate 192.168.0.1

2.crond定时服务

#启用|停止|重启|查看 crond定时服务
service crond start|stop|restart|status
#编辑定时任务
crontab -e
#查看定时任务
crontab -l

3.进程相关

#ps查看进程的实际内存占用
ps -eo 'pid,comm,rsz' --sort rsz | awk '{print $1,$2,$3/1024/1024"G"}'

4.防火墙

#查看防火墙状态
systemctl status firewalld
#启用防火墙
systemctl start firewalld
#关闭防火墙
systemctl stop firewalld
#设置开机启动
system enable firewalld

相关文章

网友评论

      本文标题:Linux常用命令

      本文链接:https://www.haomeiwen.com/subject/turnaktx.html