CentOS 7入门操作基础教程.doc_第1页
CentOS 7入门操作基础教程.doc_第2页
CentOS 7入门操作基础教程.doc_第3页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

安装完CentOS 7 minimal后,无力吐槽,变化之大,发现以前常用的一些命令都没有。一、常用命令安装查看anaconda-ks.cfg,原来是没装base group的包rootcentos7 # 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 %packagescore # 这里只有core%endrootcentos7 # yum groupinstall base # 安装完后ifconfig、service、chkconfig等命令就都有了二、运行级别切换rootcentos7 # 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 /etc/systemd/system/default.target这里写的很明白了,做个软链修改默认运行级别rootcentos7 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服务开机自启动chkconfig -level 3 httpd onsystemctl enable httpd服务不开机自启动chkconfig -level 3 httpd offsystemctl disable httpd服务状态service httpd statussystemctl status httpd(服务详细信息)systemctl is-active httpd(只显示是否active)所有服务的启动状态chkconfig -listsystemctl list-units -type=service启动服务service httpd startsystemctl start httpd停止服务service httpd stopsystemctl stop httpd重启服务service httpd restartsystemctl restart httpdcentos 7之前的

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论