CentOS 7 命令总结
启动: systemctl start firewalld
查看状态:systemctl status firewalld
停止: systemctl disable firewalld
禁用: systemctl stop firewalld
启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled
查看启动失败的服务列表:systemctl –failed
装环境库:sudo yum -y install autoconf
查看服务:whereis nginx
调整Linux时区
1、date
查看系统时间
# date
设置系统时间
# date –s “01/05/15 13:19″ (月/日/年时:分:秒)
2、hwclock/clock
查看硬件时间
# hwclock –-show
或者# clock –-show
设置硬件时间
# hwclock –-set –-date=”01/05/15 13:19″ (月/日/年 时:分:秒)
或者# clock -–set –-date=”01/05/15 13:19″ (月/日/年 时:分:秒)
3、硬件时间和系统时间的同步
按照前面的说法,重新启动系统,硬件时间会读取系统时间,实现同步,但是在不重新启动的时候,需要用hwclock或clock命令实现同步。
硬件时钟与系统时钟同步:# hwclock -–hctosys(hc代表硬件时间,sys代表系统时间)或者# clock –-hctosys
系统时钟和硬件时钟同步:# hwclock -–systohc或者# clock –systohc
4、时区的设置
# tzselect
一次选择
亚洲
中国
北京时间
确认
如果不用tzselect命令,可以修改文件变更时区。
# vi /etc/sysconfig/clock ZONE=Asia/Shanghai(查/usr/share/zoneinfo下面的文件) UTC=false ARC=false
# rm /etc/localtime
# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
暂无评论内容