1
① 命令行切换图形界面:startx &
② 显示文字转换命令行输入:localectl list-locales
localectl set-locale LANG=zh_CN.utf8(反之en-US)查看语言locale
③ 查看所用shell类型:
】#echo $SHELL
2
① ssh协议secure shell:
【root@test~】#ss -tnl
(查看系统是否监听于TCP协议的22端口)
查看ip(ifconfig)
3
① 确保防火墙是否关闭:
~】#iptables -L -n
centOS 7:(执行)
~】#systemctl disable firewalld.service(先禁用下一步再停止)
#systemctl stop firewalld.service
centOS 6:
]#service iptables stop
]#chkconfig iptables off
4
①,基础命令:
关机命令:
centOS 7:
】#systemctl poweroff(关机)
]#systemctl reboot(重启)
②普通命令语法格式:/bin,/usr/bin,/usrlocal/bin
管理命令语法格式:/sbin,/usr/sbin,/usr/local/sbin
共享库:/lib,/lib64,/usr/bin,/usr/local64,/usr/local/lib,/usr/local/lib64
32tits的库:/lib,/usr/lib,/usr/local/lib
64bits的库:/lib64,/usr/lib64,/usr/local/lib64
liunx设置静态IP
编辑 ifcfg-eth0 文件,vim 最小化安装时没有被安装,需要自行安装不描述。
# vim /etc/sysconfig/network-scripts/ifcfg-eth0
修改如下内容
1 BOOTPROTO="static" #dhcp改为static 2 ONBOOT="yes" #开机启用本配置 3 IPADDR=192.168.7.106 #静态IP 4 GATEWAY=192.168.7.1 #默认网关 5 NETMASK=255.255.255.0 #子网掩码 6 DNS1=192.168.7.1 #DNS 配置
修改后效果
1 # ]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 2 HWADDR="00:15:5D:07:F1:02" 3 TYPE="Ethernet" 4 BOOTPROTO="static" #dhcp改为static 5 DEFROUTE="yes" 6 PEERDNS="yes" 7 PEERROUTES="yes" 8 IPV4_FAILURE_FATAL="no" 9 IPV6INIT="yes" 10 IPV6_AUTOCONF="yes" 11 IPV6_DEFROUTE="yes" 12 IPV6_PEERDNS="yes" 13 IPV6_PEERROUTES="yes" 14 IPV6_FAILURE_FATAL="no" 15 NAME="eth0" 16 UUID="bb3a302d-dc46-461a-881e-d46cafd0eb71" 17 ONBOOT="yes" #开机启用本配置 18 IPADDR=192.168.7.106 #静态IP 19 GATEWAY=192.168.7.1 #默认网关 20 NETMASK=255.255.255.0 #子网掩码 21 DNS1=192.168.7.1 #DNS 配置
重启下网络服务
# service network restart
查看改动后的效果,Centois 7 不再使用 ifconfig 而是用 ip 命令查看网络信息。
1 # ip addr 2 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 3 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 4 inet 127.0.0.1/8 scope host lo 5 valid_lft forever preferred_lft forever 6 inet6 ::1/128 scope host 7 valid_lft forever preferred_lft forever 8 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000 9 link/ether 00:15:5d:07:f1:02 brd ff:ff:ff:ff:ff:ff 10 inet 192.168.7.106/24 brd 192.168.7.255 scope global eth0 11 valid_lft forever preferred_lft forever 12 inet6 fe80::215:5dff:fe07:f102/64 scope link 13 valid_lft forever preferred_lft forever