學(xué)習(xí)計(jì)劃
32周內(nèi)完成全程課程
- 基礎(chǔ)課32節(jié),每周完成一節(jié)
- 架構(gòu)課32節(jié),每周完成一節(jié)
Linux基礎(chǔ)入門
1、按系列羅列Linux的發(fā)行版,并描述不同發(fā)行版之間的聯(lián)系與區(qū)別。
Linux三大主流發(fā)行版及其衍生版本(比較著名的)目錄樹為:
Debian系列
--Ubuntu
--KnopixSlackware系列
--Suse
--OpensuseRedhat系列
--Centos
--Fedora
debian系列采用的是 apt-get/dpkg 包管理方式,redhat系列采用的是 yum/rpm 的包管理方式。
Slackware一直以來是以簡潔、安全和穩(wěn)定所著稱的。KISS(Keep it simple,stupid——保持簡單)是Slackware一貫的原則,盡量保持系統(tǒng)的簡潔,從而實(shí)現(xiàn)穩(wěn)定、高效和安全。在Slackware的哲學(xué) 里面,簡單(Simple)意味著系統(tǒng)設(shè)計(jì)的簡潔明了,而不是用戶友好(User friendly),為了達(dá)到簡單的目標(biāo),Slackware在一定程度上犧牲了易用性。
2、安裝Centos7.6操作系統(tǒng),創(chuàng)建一個(gè)自己名字的用戶名

























3、配置環(huán)境變量,實(shí)現(xiàn)執(zhí)行history的時(shí)候可以看到執(zhí)行命令的時(shí)間。
[root@localhost ~]# export HISTTIMEFORMAT='%F %T '
[root@localhost ~]# ls
anaconda-ks.cfg
[root@localhost ~]# pwd
/root
[root@localhost ~]# history
1 2019-11-26 02:21:10 useradd yangxy
2 2019-11-26 02:21:10 passwd yangxy
3 2019-11-26 02:21:10 exit
4 2019-11-26 02:21:43 cat /etc/sysconfig/network-scripts/
5 2019-11-26 02:21:47 cat /etc/sysconfig/network-scripts/ifcfg-ens33
6 2019-11-26 02:21:52 vi /etc/sysconfig/network-scripts/ifcfg-ens33
7 2019-11-26 02:23:50 echo $HISTTIMEFORMAT
8 2019-11-26 02:24:08 export HISTTIMEFORMAT='%F %T '
9 2019-11-26 02:24:14 ls
10 2019-11-26 02:24:15 pwd
11 2019-11-26 02:24:18 history
4、Linux哲學(xué)思想總結(jié)。
linux 哲學(xué)思想有以下幾點(diǎn):
1、一切皆文件(包括硬件);
2、由眾多目的單一的小程序組成;
3、組合小程序完成復(fù)雜任務(wù);
4、盡量避免跟用戶交互;為了方便腳本編程實(shí)現(xiàn)程序自動(dòng)化運(yùn)行;
5、使用文本文件保存程序的配置數(shù)據(jù);
操作系統(tǒng)的基本功能
1、將硬件規(guī)格抽象為系統(tǒng)調(diào)用(System Call);
2、進(jìn)程管理;
3、文件系統(tǒng);
4、硬件驅(qū)動(dòng);
5、網(wǎng)絡(luò)協(xié)議棧;
6、安全功能;
7、內(nèi)存管理;
5、Linux命令使用格式
## 命令的語法通用格式:
## COMMAND OPTIONS ARGUMENTS
[root@localhost ~]# man echo
NAME
echo - display a line of text
SYNOPSIS
echo [SHORT-OPTION]... [STRING]...
echo LONG-OPTION
[root@localhost ~]# echo "hello world"
hello world
## -e 選項(xiàng) 輸出轉(zhuǎn)義字符
[root@localhost ~]# echo -e "hello\nworld"
hello
world
## -n 選項(xiàng) 輸出不換行
[root@localhost ~]# echo -n "hello world"
hello world[root@localhost ~]#
[root@localhost ~]# man date
NAME
date - print or set the system date and time
SYNOPSIS
date [OPTION]... [+FORMAT]
date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
## 輸出默認(rèn)格式的時(shí)間
[root@localhost ~]# date
Tue Nov 26 02:43:46 CST 2019
## 輸出指定格式的時(shí)間
[root@localhost ~]# date "+%F %T"
2019-11-26 02:43:05
[root@localhost ~]# man ifconfig
NAME
ifconfig - configure a network interface
SYNOPSIS
ifconfig [-v] [-a] [-s] [interface]
ifconfig [-v] interface [aftype] options | address ...
## 顯示當(dāng)前所有可用的網(wǎng)絡(luò)接口
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.240.163 netmask 255.255.255.0 broadcast 192.168.240.255
inet6 fe80::f1bf:bae9:3994:edc8 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:73:72:ff txqueuelen 1000 (Ethernet)
RX packets 1256 bytes 459210 (448.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 774 bytes 226040 (220.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
## 顯示特定的網(wǎng)絡(luò)接口
[root@localhost ~]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.240.163 netmask 255.255.255.0 broadcast 192.168.240.255
inet6 fe80::f1bf:bae9:3994:edc8 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:73:72:ff txqueuelen 1000 (Ethernet)
RX packets 1429 bytes 481470 (470.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 916 bytes 265256 (259.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]# ifconfig -s ens33
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
ens33 1500 1454 0 0 0 934 0 0 0 BMRU