親愛的小伙伴們终息,作業(yè)來一波吧
###第一周作業(yè)皿渗,請同學(xué)們完成作業(yè)后钦睡,將本周博客作業(yè)提交地址:https://www.wjx.top/jq/79955817.aspx
▲就業(yè)班和全程班的小伙伴看這里:(學(xué)習(xí)老王視頻的作業(yè)第1-2節(jié))
1、按系列羅列Linux的發(fā)行版实束,并描述不同發(fā)行版之間的聯(lián)系與區(qū)別幽钢。
2、安裝Centos7.6操作系統(tǒng)傅是,創(chuàng)建一個自己名字的用戶名匪燕,并可以正常登錄,將主要步驟截圖喧笔。
3帽驯、配置環(huán)境變量,實(shí)現(xiàn)執(zhí)行history的時候可以看到執(zhí)行命令的時間书闸。
4尼变、總結(jié)Linux哲學(xué)思想。
5浆劲、總結(jié)Linux常用命令使用格式嫌术,并用實(shí)例說明。例如echo牌借、screen度气、date、ifconfig膨报、export等命令
▲單獨(dú)架構(gòu)的小伙伴看這里:(學(xué)習(xí)杰哥視頻的作業(yè)第1-2天)
1磷籍、編譯安裝LNMP,配置自定義404頁面现柠,配置訪問日志為json格式院领。
2、配置虛擬主機(jī)够吩,實(shí)現(xiàn)https訪問www.x.com(x.com為自己定義的域名)
1比然、按系列羅列Linux的發(fā)行版,并描述不同發(fā)行版之間的聯(lián)系與區(qū)別周循。
Linux的主要發(fā)行版本如下
slackware: SUSE?Linux Enterprise Server (SLES)
專業(yè)的操作系統(tǒng)谈秫,易用的YAST軟件包管理系統(tǒng)
Debian: ubuntu , deepin(深度) ,mint
Ubuntu 是基于著名的發(fā)行版本Debian Linux發(fā)展而來鱼鼓,它的界面非常是人性化拟烫,相對更容易上手,另外它對硬件的支持也是非常的全面迄本,是目前最適合做桌面系統(tǒng)使用的Linux發(fā)行版本硕淑,并且Ubuntu的所有發(fā)行版本都是免費(fèi)提供使用的。
Redhat:RHEL: RedHat Enterprise Linux
Red Hat (紅帽公司)成立于1993年,是目前位置全球最資深的Linux廠商置媳,也是最獲任何的Linux品牌于樟,其中紅帽的認(rèn)證也是更加具有代表性。??Red Hat的Linux發(fā)行版本注意分為Red Hat Enterprise Linux(收費(fèi)版本)拇囊,和CentOS(RHEL 的社區(qū)克隆版本迂曲,免費(fèi)版本)、Fedora Core(由 Red Hat 桌面版發(fā)展演變寥袭,免費(fèi)版本)路捧。??Red Hat 系列是目前國內(nèi)適用人群最多的Linux發(fā)行版本,如果在使用過程中遇到問題传黄,很容易向別人請教或者在網(wǎng)上找到相關(guān)的答案杰扫。以國內(nèi)互聯(lián)網(wǎng)公司最常使用的CentOS發(fā)行版為例,他說基于Red Hat Enterprise Linux 的源代碼進(jìn)行重新的編譯膘掰、去除Red Hat商標(biāo)的產(chǎn)物章姓,各種的使用方式和收費(fèi)版本沒有任何的區(qū)別,而且完全免費(fèi)识埋。但缺點(diǎn)也就是不向用戶提供各種的技術(shù)支持凡伊,也不負(fù)任何的商業(yè)責(zé)任
CentOS
ContOS是一種對RHEL源代碼再編譯的產(chǎn)物,由于Linux是開源的操作系統(tǒng)窒舟,并不排斥基于源代碼的再分發(fā)窗声,CentOS就是講商業(yè)Linux操作系統(tǒng)RHEL進(jìn)行源代碼的再編譯后分發(fā)。并在RHEL的基礎(chǔ)上修正了一些已知的漏洞辜纲。
ArchLinux
Gentoo
Gentoo 最開始是由Daniel Robbins(FreeBSD 的開發(fā)者之一)創(chuàng)建并于2002年發(fā)布了第一個穩(wěn)定版本笨觅,到目前為止Gentoo依舊采用源碼編譯安裝的方式進(jìn)行系統(tǒng)的安裝,是所有Linux發(fā)型版本里面安裝過程最為復(fù)雜的發(fā)行版耕腾。??雖然大家都吐槽于Gentoo復(fù)雜的安裝過程见剩,但安裝完成后的Gentoo是最便于管理的版本,因?yàn)榈靡嬗诓捎镁幾g的方式去安裝系統(tǒng)扫俺,在同等配置下Gentoo也是所有發(fā)行版本中運(yùn)行最快的版本苍苞。??網(wǎng)上有人這樣評價Gentoo:快速、設(shè)計(jì)干凈而有彈性狼纬,它的出名是因?yàn)槠涓叨鹊淖远ㄖ菩裕ɑ谠创a的發(fā)行版)羹呵。盡管安裝時可以選擇預(yù)先編譯好的軟件包,但是大部分使用 Gentoo 的用戶都選擇自己手動編譯疗琉。這也是為什么 Gentoo 適合比較有 Linux 使用經(jīng)驗(yàn)的老手使用冈欢。??不過要注意的是,由于編譯軟件需要消耗大量的時間盈简,所以凑耻,如果你所有的軟件都由自己編譯太示,并安裝 KDE 桌面系統(tǒng)等比較大的軟件包,則可能需要花費(fèi)很長時間香浩。
LFS :?Linux From scratch?自制Liunx
Red Hat (紅帽公司)成立于1993年类缤,是目前位置全球最資深的Linux廠商,也是最獲任何的Linux品牌邻吭,其中紅帽的認(rèn)證也是更加具有代表性餐弱。??Red Hat的Linux發(fā)行版本注意分為Red Hat Enterprise Linux(收費(fèi)版本),和CentOS(RHEL 的社區(qū)克隆版本囱晴,免費(fèi)版本)膏蚓、Fedora Core(由 Red Hat 桌面版發(fā)展演變,免費(fèi)版本)速缆。??Red Hat 系列是目前國內(nèi)適用人群最多的Linux發(fā)行版本,如果在使用過程中遇到問題恩闻,很容易向別人請教或者在網(wǎng)上找到相關(guān)的答案艺糜。以國內(nèi)互聯(lián)網(wǎng)公司最常使用的CentOS發(fā)行版為例,他說基于Red Hat Enterprise Linux 的源代碼進(jìn)行重新的編譯幢尚、去除Red Hat商標(biāo)的產(chǎn)物破停,各種的使用方式和收費(fèi)版本沒有任何的區(qū)別,而且完全免費(fèi)尉剩。但缺點(diǎn)也就是不向用戶提供各種的技術(shù)支持真慢,也不負(fù)任何的商業(yè)責(zé)任
Ubuntu 是基于著名的發(fā)行版本Debian Linux發(fā)展而來,它的界面非常是人性化理茎,相對更容易上手黑界,另外它對硬件的支持也是非常的全面,是目前最適合做桌面系統(tǒng)使用的Linux發(fā)行版本皂林,并且Ubuntu的所有發(fā)行版本都是免費(fèi)提供使用的朗鸠。
Gentoo 最開始是由Daniel Robbins(FreeBSD 的開發(fā)者之一)創(chuàng)建并于2002年發(fā)布了第一個穩(wěn)定版本,到目前為止Gentoo依舊采用源碼編譯安裝的方式進(jìn)行系統(tǒng)的安裝础倍,是所有Linux發(fā)型版本里面安裝過程最為復(fù)雜的發(fā)行版烛占。??雖然大家都吐槽于Gentoo復(fù)雜的安裝過程,但安裝完成后的Gentoo是最便于管理的版本沟启,因?yàn)榈靡嬗诓捎镁幾g的方式去安裝系統(tǒng)忆家,在同等配置下Gentoo也是所有發(fā)行版本中運(yùn)行最快的版本。??網(wǎng)上有人這樣評價Gentoo:快速德迹、設(shè)計(jì)干凈而有彈性芽卿,它的出名是因?yàn)槠涓叨鹊淖远ㄖ菩裕ɑ谠创a的發(fā)行版)。盡管安裝時可以選擇預(yù)先編譯好的軟件包胳搞,但是大部分使用 Gentoo 的用戶都選擇自己手動編譯蹬竖。這也是為什么 Gentoo 適合比較有 Linux 使用經(jīng)驗(yàn)的老手使用沼沈。??不過要注意的是,由于編譯軟件需要消耗大量的時間币厕,所以列另,如果你所有的軟件都由自己編譯,并安裝 KDE 桌面系統(tǒng)等比較大的軟件包旦装,則可能需要花費(fèi)很長時間页衙。
2、安裝Centos7.6操作系統(tǒng)阴绢,創(chuàng)建一個自己名字的用戶名店乐,并可以正常登錄,將主要步驟截圖呻袭。
配置環(huán)境變量眨八,實(shí)現(xiàn)執(zhí)行history的時候可以看到執(zhí)行命令的時間。
4左电、總結(jié)Linux哲學(xué)思想廉侧。
一切皆文件,包括硬件
小型篓足,單一用途的程序
鏈接程序段誊,共同完成復(fù)雜的任務(wù)
避免令人困惑的用戶界面
配置數(shù)據(jù)存儲在文本中
5、總結(jié)Linux常用命令使用格式栈拖,并用實(shí)例說明连舍。例如echo、screen涩哟、date索赏、ifconfig、export等命令
Linux命令贴彼,分為內(nèi)部命令和外部命令参滴。?
command [option..] [arguments..]
echo命令
NAME?
? ? ? echo - display a line of text? ?顯示一行文本
SYNOPSIS
? ? ? ?echo [SHORT-OPTION]...[STRING]...
? ? ? ?echo LONG-OPTION
DESCRIPTION
? ? ? ?Echo the STRING(s) to standard output??
? ? ? ?-n? ?do not output the trailing newline? ?不輸出末尾的換行符? ? 就是不換行
? ? ? ?-e? ?enable interpretation of backslash escapes? ?啟用反斜杠轉(zhuǎn)義的解釋
? ? ? ?-E? ?disable interpretation of backslash escapes (default)? 禁用反斜杠轉(zhuǎn)義的解釋(默認(rèn))
? ? ? ?--help display this help and exit? ? 顯示此幫助或者退出
? ? ? ?--version
? ? ? ? ? ? ? ? ? output version information and exit? ? 輸出版本信息并退出
? ? ? ? ? If -e is in effect, the following sequences are recognized:
? ? ? ? ? ? ?\\? ? ? ?backslash? 反斜杠
? ? ? ? ? ? ? \a? ? ? alert (BEL)
? ? ? ? ? ? ? \b? ? ? backspace? ?回退
? ? ? ? ? ? ? \c? ? ? ?produce no further output? ?不產(chǎn)生進(jìn)一步的輸出
? ? ? ? ? ? ? \e? ? ? escape
? ? ? ? ? ? ? \f? ? ? ?form feed
? ? ? ? ? ? ? ?\n? ? ?new line
? ? ? ? ? ? ? ?\r? ? ? carriage return? ? 回車
? ? ? ? ? ? ? ?\t? ? ? horizontal tab? ? ? 橫表
? ? ? ? ? ? ? \v? ? ? ?vertical tab? ? ? ? ? 垂直表符
? ? ? ? ? ? ? \0NNN? ?byte with octal value NNN (1 to 3 digits)? ? 八進(jìn)制值為NNN的字節(jié)(1到3位)
? ? ? ? ? ? ? \xHH? ? ?byte with hexadecimal value HH ( 1 to 2 digits)? ?具有十六機(jī)制值HH的字節(jié) (1到2位)
? ? ? ? ? ? ?NOTE: your shell may have its own version of echo, which ussually supersedes the version described here. please?
? ? ? ? ? ? ? refer to your shell's documentation for details about the options it supports
? ? ? ? ? ? GNU coreutils online help :? <http://www.gnu.org/software/coreutils/>? report echo translation bugs to <http://translationproject.org/team/>
AUTHOR
? ? ? ? ? ? Writen by Brian Fox and Chet Ramey.
SEE ALSO
The full documentation forechois? maintained as a Texinfo manual. If the infro and echo programs are properly installed at your site, the command
? ? ? ? ? ? ? ?info coreutils ‘echo invocation’
? ? ? ? ? ? ? ?should give you access to the complete manual
screen
?NAME?
? ? ? ? ? ?screen - screen manager with VT100/ANSI terminal emulation
SYNOPSIS
? ? ? ? ? ?screen [ -options ] [cmd [args]]
? ? ? ? ? ?screen -r [[pid.] tty [.host]]
? ? ? ? ? ?screen -r sessionowner/ [[pid.]tty[.host]]
DESCRIPTION
? ? ? ? ?Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shelles). Each virtual terminal provides the functions of a DEV VT100 terminal and, in addition, several control funcatios from the ISO 6429 ( ecma 48 , ANSI X3.64) and ISO 2022 standards (e,g,?inser/delete line and support form multiple character sets). There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows moving text regicons between windows.
描述
Screen是一個全屏窗口管理器,它可以在多個進(jìn)程(通常是交互式shell)之間多路傳輸一個物理終端锻弓。每個虛擬終端提供了一個DEV VT100終端的功能砾赔,此外,一些控制功能來自ISO 6429 (ecma 48, ANSI X3.64)和ISO 2022標(biāo)準(zhǔn)(e,g, inser/delete行和支持形式的多字符集)青灼。每個虛擬終端都有一個滾動回滾歷史緩沖區(qū)和一個允許在窗口之間移動文本重新圖標(biāo)的復(fù)制粘貼機(jī)制暴心。
date
NAME?
? ? ? ? ? ? date - print or set the system date and time?
SYNOPSIS
? ? ? ? ? ? ? date [OPTION]...[+FORMAT]
? ? ? ? ? ? ? ?date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
DESCRIPTION
? ? ? ? ? ? ?Display the current time in the given FORMAT, or set the system date? ?以給定格式顯示當(dāng)前時間,或設(shè)置系統(tǒng)日期
? ? ? ? ? ? ?Mandatory arguments to long options are mandatory form short options too.? 長選項(xiàng)的強(qiáng)制性參數(shù)也是短選項(xiàng)的強(qiáng)制性參數(shù)
? ? ? ? ? ? ?-d, --date=STRING
? ? ? ? ? ? ? ? ? ? ? ? ? ?display time described by STRING, not 'now'
? ? ? ? ? ? ?-f, --file=DATEFILE
? ? ? ? ? ? ? ? ? ? ? ? ? ? like --date once for each line of DATEFILE
? ? ? ? ? ? ?-I[TIMESPEC], --iso-8601[=TIMESPEC]
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?output date/time in ISO 8601 format. TIMESPEC='date' for date only (the default), ‘hours’,'minutes','seconds'. or 'ns' for date and time to the indicated precision.
? ? ? ? ? ? ? -r, --reference=FILE
? ? ? ? ? ? ? ? ? ? display the last modification time of FILE
? ? ? ? ? ? ?-R , --rfc-2822
? ? ? ? ? ? ? ? ? ? output date and time in RFC2822 format . Example: Mon, 07 Aug 2006 12:34:56 -0600
? ? ? ? ? ? ? --rfc-3339=TIMSPEC
? ? ? ? ? ? ? ? ? ? ? ?output date and time in FRC 3339 format. TIMESPEC='date','seconds',or 'ns' for date and time to the indicated precision. Date and time components are separated by a single space: 2006-08-07 12:34:56-06:00
? ? ? ? ? ?-s, --set=STRING
? ? ? ? ? ? ? ? ? ? set time described by STRING
? ? ? ? ? ? -u --utc, --universal
? ? ? ? ? ? ? ? ? ? print or set Coordinated Universal Time (UTC)
? ? ? ? ? ?--help diskplay this? help and exit
? ? ? ? ? ?--version?
? ? ? ? ? ? ? ? ? ?output version information and exit
? ? ? ? ? ? ?FORMAT controls the output. Interpreted sequences are:
? ? ? ? ? ? %%? ? ? a literal %
? ? ? ? ? ? %a? ? ? ?locale's abbreviated weekday name (e.g.,Sun)
? ? ? ? ? ?%A? ? ? ? locale's full weekday name (e.g.,Sunday)
? ? ? ? ? ?%b? ? ? ? locale's abbreviated month name (e.g.,Jan)
? ? ? ? ? ?%B? ? ? ? locale's full month name (e.g.,January)
? ? ? ? ? ? %c? ? ? ? locate's date and time (e.g., Thu Mar 3 23:05:25 2005)
? ? ? ? ? ?%C? ? ? ? century; like %Y, except omit last two digites (e.g.,20)
? ? ? ? ? ? %d? ? ? ?day of month (e.g.,01)
? ? ? ? ? ? %D? ? ? date; same as %Y-%m-%d
? ? ? ? ? ? ?%F? ? ? full date; same as %Y-%m-%d
? ? ? ? ? ? %g? ? ? ?last two digits of year of ISO week number (see %G)
? ? ? ? ? ? %G? ? ? ?year of ISO?week number (see %V); normally useful only with %V
? ? ? ? ? ?%h? ? ? ? same as %b
? ? ? ? ? ? %H? ? ? ?hour? (00..23)
? ? ? ? ? ? %I? ? ? ? hour (01..12)
? ? ? ? ? ? %j? ? ? ? day of year (001..366)
? ? ? ? ? ? %k? ? ? ?hour, space padded (0..23); same as %_H
? ? ? ? ? ? %l? ? ? ? hour, space padded (1..12); dame as %_I
? ? ? ? ? ? %m? ? ?month (01..12)
? ? ? ? ? ? %n? ? ? a newline
? ? ? ? ? ? ?%N? ? ?nanoseconds (000000000..999999999999)
? ? ? ? ? ? %p? ? ? locale's equivalent of either AM or PM; blank if not known
? ? ? ? ? ? %P? ? ? like %p, but lower case
? ? ? ? ? ? %r? ? ? locale's 12-hour clock time (e.g., 11:11:04 PM)
? ? ? ? ? ? ?%R? ? 24-hour hour amd minute; same as %H:%M
? ? ? ? ? ? ?%s? ? ?seconds sine 1970-01-01 00:00:00 UTC
? ? ? ? ? ? ?%S? ? ?second (00..60)
? ? ? ? ? ? ?%t? ? ? a tab
? ? ? ? ? ? ? %T? ? time; same as? %H:%M:%S
? ? ? ? ? ? ? %u? ? ?day of week (1..7);? 1 is Monday
? ? ? ? ? ? ?%U? ?week nuber of year,? with Sunday as first day of week (00..53)
? ? ? ? ? ? %V? ? ISO week nuber, with Monday as first day of week (01..53)
? ? ? ? ? ? ?%w day of week (0..6) ; 0 is Sunday
? ? ? ? ? ? ?%W week number of? year,? with Monday as grist day of week (00.. 53)
? ? ? ? ? ? ?%x? ?locale's date representation (e.g., 12/31/99)
? ? ? ? ? ? ?%X? ? ?localeps time representation (e.g., 23:13:48)
? ? ? ? ? ? ?%y? ? ? last two digits of year(00..99)
? ? ? ? ? ? %Y? ? year
? ? ? ? ? ? ?%z? ?+hhmm mumeric time zone (e.g., -0400)
? ? ? ? ? ? ?%:Z? ? ?+hh:mm numeric time zone (e.g., -4:00)
? ? ? ? ? ? ? %::z? ? ? +hh:mm:ss numeric time zone (e.g., -04:00:00)
? ? ? ? ? ? ? %:::z? ? numeric time zone with : to necessary precision (e.g., -04, +%:30)
? ? ? ? ? ? ? %Z? ? ? ? alphabetic time zone abbreviation (e.g., EDT)
? ? ? ? ? ? ?By default, date pads numeric fields with zeroes. The following optional flags may foolow '%':
? ? ? ? ? ? ? - n? ? (hyphen)? do not pad the field
? ? ? ? ? ? ? _? ? ? ?(underscore) pad with spaces
? ? ? ? ? ? ?0? ? ? ? (zero)? ?pad with zeros
? ? ? ? ? ? ?^? ? ? ? ?use upper case if possible
? ? ? ? ? ? ? ?#? ? ?use opposite case if possible
? ? ? ? ? ? ? ?After any flags comes an optional field width, as a decimal number; then an optional modifer, which is either E to use the locale's alternate representations if available, or 0 to use the locale's altername numeric symbols if available.
Ifconfig
ifconfig - ;configure a network interface
SYNOPSIS
? ? ? ? ? ? ? ? ifconfig [-v] [-a] [-s] [interface]
? ? ? ? ? ? ? ? ifconfig [-v] interface [aftype] options | address ....
NOTE??
? ? ? ? ? ? ? ? this program is obsolete!? ?For replacement? check ip addr and ip link., For statistics use ip -s link.
DESCRIPTION
? export
Shell內(nèi)建命令??
export命令用于將shell變量輸出為環(huán)境變量杂拨,或者將shell函數(shù)輸出為環(huán)境變量专普。??
一個變量創(chuàng)建時,它不會自動地為在它之后創(chuàng)建的shell進(jìn)程所知弹沽。而命令export可以向后面的shell傳遞變量的值檀夹。當(dāng)一個shell腳本調(diào)用并執(zhí)??行時筋粗,它不會自動得到原為腳本(調(diào)用者)里定義的變量的訪問權(quán),除非這些變量已經(jīng)被顯式地設(shè)置為可用炸渡。export命令可以用于傳遞一個或多個變量的值到任何后繼腳本娜亿。??語法??export(選項(xiàng))(參數(shù))??選項(xiàng)??-f:代表[變量名稱]中為函數(shù)名稱;??-n:刪除指定的變量蚌堵。變量實(shí)際上并未刪除买决,只是不會輸出到后續(xù)指令的執(zhí)行環(huán)境中;??-p:列出所有的shell賦予程序的環(huán)境變量吼畏。??參數(shù)???變量:指定要輸出或者刪除的環(huán)境變量督赤。??
實(shí)例???一般來說,配置交叉編譯工具鏈的時候需要指定編譯工具的路徑泻蚊,此時就需要設(shè)置環(huán)境變量躲舌。查看已經(jīng)存在的環(huán)境變量: