Linux简介第一天
1、Linux简介
Linux是一种自由和开放源码的操作系统,存在着许多不同的Linux版本,但它们都使用Linux内核
2、特点:
- 多用户,多任务,丰富的网络功能,可靠的系统安全,良好的可移植性,具有标准兼容性,良好的用户界面,出色的速度性能
- 开源
- 主流:目前的Linux操作系统主要应用于生产环境,主流企业级Linux系统仍旧是Redhat或者CentOS
- 免费:Redhat和CentOS差别不大,基于Red Hat Linux 提供的可自由使用源代码的企业CentOS是一个级Linux发行版本
- 更新方便:CentOS独有的yum命令支持在线升级,可以即时更新系统,不像RedHat 那样需要花钱购买支持服务!
3.虚拟机的安装
环境准备:
Windows7/Windows10
VMware® Workstation 12 Pro
CentOS6.9
4.linux指令
关机指令
shutdown -h now
powerroff
重启指令
reboot
网络配置
修改主机名
vim /etc/sysconfig/network
修改中按Esc退出编辑,之后shift+: 最后输入wq 完成修改
设置主机名映射
vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.179.150 master
测试 ping master
``` [root@master Desktop]# ping master PING master (192.168.179.150) 56(84) bytes of data. 64 bytes from master (192.168.179.150): icmp_seq=1 ttl=64 time=0.039 ms 64 bytes from master (192.168.179.150): icmp_seq=2 ttl=64 time=0.032 ms 64 bytes from master (192.168.179.150): icmp_seq=3 ttl=64 time=0.049 ms ```
防火墙设置
service iptables status 查看防火墙状态
service iptables start 启动防火墙
service iptables stop 停止防火墙
开机设置防火墙的状态
chkconfig iptables on 开机启动
chkconfig iptables off 开机关闭防火墙
chkconfig iptables --list