你的位置:首页 > 软件开发 > 操作系统 > 浅谈centos7

浅谈centos7

发布时间:2015-10-01 22:00:03
1、centos最小好化安装没有ifconfig命令,表示这个好坑,这么基本的命令都么有刚安装了centos7.0,最小化安装,发现没有ifconfig命令,要使用ifconfig命令,在/etc/sysconfig/network-scripts/ifcfg-***里面配置好网 ...

1、centos最小好化安装没有ifconfig命令,表示这个好坑,这么基本的命令都么有

刚安装了centos7.0,最小化安装,发现没有ifconfig命令,要使用ifconfig命令,在/etc/sysconfig/network-scripts/ifcfg-***里面配置好网络,记住onboot=on这个选项一定要设置,不然网络启动不了,重启网络,/etc/init.d/network restart 使用centos的官方yum源

yum clean all 

yum install net-tools

ifconfig命令在net-tools软件包里

nslookup,dig在bind-utils中

2、centos 7使用了systemd来代替sysvinit

systemd使用方法:

systemd的服务管理程序 

systemctl是最主要的工具,它融合 service 和chkconfig的功能于一体,你可以使用它永久性或只在当前会话中启用/禁用服务。  

下面命令用于列出正在运行的服务或其他: systemctl 

如何启动/关闭、启用/禁用服务? 

运行一个服务: 

systemctl start foo.service 关闭一个服务: 

systemctl stop foo.service 重启一个服务: 

systemctl restart foo.service 

显示一个服务(无论运行与否)的状态: systemctl status foo.service 

在开机时启用一个服务: systemctl enable foo.service 

在开机时禁用一个服务: systemctl disable foo.service

查看服务是否开机启动:systemctl is-enabled iptables.service;echo $?

修改运行级别:

systemd使用比sysvinit的运行级更为自由的 target 概念作为替代。  

第 3 运行级用 multi-user.target替代,第 5 运行级用graphical.target替代。runlevel3.target 和 runlevel5.target 分别是指向 multi-user.target和graphical.target的符号链接。  

你可以使用下面的命令切换到“运行级 3 ”: 

systemctl isolate multi-user.target (or)

systemctl isolate runlevel3.target  

你也可以使用下面的命令切换到“运行级 5 ”: 

systemctl isolate graphical.target (or) 

systemctl isolate runlevel5.target   

如何改变默认运行级别? 

systemd使用链接来指向默认的运行级别。在创建新的链接前,你可以通过下面命令删除存在的链接: rm /etc/systemd/system/default.target 

默认切换到运行级 3 : 

ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target 

默认切换到运行级 5 : 

ln -sf /lib/systemd/system/graphical.target/etc/systemd/system/default.target 

systemd不使用/etc/inittab文件。 如何查看当下运行级别? 

runlevel命令在systemd下仍然可以工作。你可以继续使用它,尽管systemd使用 'target' 概念(多个的 'target' 可以同时激活)替换了之前系统的runlevel。

等价的systemd命令是 

systemctl list-units --type=target

3、引导方式:使用grub2引导

grub2特点:

模块化设计

不同于Grub的单一内核结构,Grub 2 的功能分布在很多的小模块中,并且能在运行时动态装载和卸除。

支持多体系结构

Grub 2可支持PC(i386), MAC(powerpc)等不同的体系机构,而且支持最新的EFI架构

国际化的支持

Grub 2 可以支持非英语的语言。

内存管理

Grub 2 有真正的内存管理系统。

脚本语言

Grub 2 可以支持脚本语言,例如条件,循环,变量,函数等。


 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:浅谈centos7

关键词:Centos

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。