CentOS 7入门操作基础教程

安装完CentOS 7 minimal后,无力吐槽,变化之大,,发现以前常用的一些命令都没有。

一、常用命令安装

查看anaconda-ks.cfg,原来是没装base group的包

[root@centos7 ~]# cat anaconda-ks.cfg #version=RHEL7# System authorization informationauth –enableshadow –passalgo=sha512# Use CDROM installation mediacdrom# Run the Setup Agent on first bootfirstboot –enableignoredisk –only-use=sda# Keyboard layoutskeyboard –vckeymap=us –xlayouts=’us’# System languagelang en_US.UTF-8 –addsupport=zh_CN.UTF-8# Network informationnetwork –bootproto=dhcp –device=eno16777736 –onboot=off –ipv6=autonetwork –hostname=localhost.localdomain# Root passwordrootpw –iscrypted $6$Zz5VMf1HPPRm0YRL$QSoaU9pAUApXMj9BXuK5qlUFGAfCv9Y/ylVGUcDYv.lrxfNodTiI/7DO1UR7carvL1EdgwQpuiwDt524f6.GR.# System timezonetimezone Asia/Chongqing –isUtc –nontp# System bootloader configurationbootloader –location=mbr –boot-drive=sdaautopart –type=lvm# Partition clearing informationclearpart –none –initlabel %packages@core # 这里只有core%end

[root@centos7 ~]# yum groupinstall base # 安装完后ifconfig、service、chkconfig等命令就都有了

二、运行级别切换

[root@centos7 ~]# cat /etc/inittab # 系统运行级别的设置方式也变化了# inittab is no longer used when using systemd.## ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.## Ctrl-Alt-Delete is handled by /etc/systemd/system/ctrl-alt-del.target## systemd uses ‘targets’ instead of runlevels. By default, there are two main targets:## multi-user.target: analogous to runlevel 3# graphical.target: analogous to runlevel 5## To set a default target, run:## ln -sf /lib/systemd/system/<target name>.target /etc/systemd/system/default.target这里写的很明白了,做个软链修改默认运行级别

[root@centos7 system]# ll /lib/systemd/system/runlevel*.target # 系统0-6 7个运行级别,2 3 4 运行指向同一个文件lrwxrwxrwx 1 root root 15 Oct 11 03:51 /lib/systemd/system/runlevel0.target -> poweroff.targetlrwxrwxrwx 1 root root 13 Oct 11 03:51 /lib/systemd/system/runlevel1.target -> rescue.targetlrwxrwxrwx 1 root root 17 Oct 11 03:51 /lib/systemd/system/runlevel2.target -> multi-user.targetlrwxrwxrwx 1 root root 17 Oct 11 03:51 /lib/systemd/system/runlevel3.target -> multi-user.targetlrwxrwxrwx 1 root root 17 Oct 11 03:51 /lib/systemd/system/runlevel4.target -> multi-user.targetlrwxrwxrwx 1 root root 16 Oct 11 03:51 /lib/systemd/system/runlevel5.target -> graphical.targetlrwxrwxrwx 1 root root 13 Oct 11 03:51 /lib/systemd/system/runlevel6.target -> reboot.target

三、systemctl管理系统服务

systemctl可以看作是service和chkconfig的组合

jobchkconfig、servicesystemctl

服务状态

service httpd status

systemctl status httpd(服务详细信息)

systemctl is-active httpd(只显示是否active)

centos 7之前的版本都采用Sysvinit的系统启动进程管理体系,因为是串行的进程启动流程,可能因为某个进程的阻塞而影响启动过程。centos 7使用systemd。目标是尽可能启动更少进程;尽可能将更多进程并行启动(这是性能优于SysVinit的理念基础)。

更详解的systemd介绍

RHEL7/CentOS7默认运行级别和终端分辨率

U盘安装CentOS 7.0图文详解教程

U盘安装64位CentOS 6.5方法

Win7安装64位CentOS 6.4双系统详细图文教程

CentOS与Windows双系统安装注意事项记录

UEFI+GPT安装Windows8和CentOS双系统

Windows8.1和CentOS6.5双系统安装

本文永久更新链接地址:

通电话,旅行,重复一个承诺和梦想,

CentOS 7入门操作基础教程

相关文章:

你感兴趣的文章:

标签云: