这里发现
一只程序猿O(∩_∩)O
渴望用Hello World改变世界,喜欢电影,喜欢跑步,略带文艺的逗比程序猿一只!

CentOS7.0的几个新特性【转】

centos最小好化安装没有ifconfig命令

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

yum clean all

yum install net-tools

ifconfig命令在net-tools软件包里

nslookup,dig在bind-utils中

centos使用了systemd来代替sysvinit

systemd使用方法:

systemd的服务管理程序

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

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

更多详细信息请参考手册页(man systemctl)。systemd-cgls以树形列出正在运行的进程。它可以递归显示给定控制组内容。详情请参阅systemd-cgls手册页。

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

运行一个服务:

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

引导方式:

使用grub2引导

grub2特点:

1、模块化设计

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

2、支持多体系结构

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

3、国际化的支持

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

4、内存管理

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

5、脚本语言

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

转载请注明出处fullstackdevel.com:SEAN是一只程序猿 » CentOS7.0的几个新特性【转】

分享到:更多 ()