第二周作业_20200608

亲爱的小伙伴们,作业来一波吧

###第一周作业,请同学们完成作业后,将本周博客作业提交地址:https://www.wjx.top/jq/79955817.aspx

▲就业班和全程班的小伙伴看这里:(学习老王视频的作业第1-2节)

1、按系列罗列Linux的发行版,并描述不同发行版之间的联系与区别。

2、安装Centos7.6操作系统,创建一个自己名字的用户名,并可以正常登录,将主要步骤截图。

3、配置环境变量,实现执行history的时候可以看到执行命令的时间。

4、总结Linux哲学思想。

5、总结Linux常用命令使用格式,并用实例说明。例如echo、screen、date、ifconfig、export等命令

▲单独架构的小伙伴看这里:(学习杰哥视频的作业第1-2天)

1、编译安装LNMP,配置自定义404页面,配置访问日志为json格式。

2、配置虚拟主机,实现https访问www.x.com(x.com为自己定义的域名)






1、按系列罗列Linux的发行版,并描述不同发行版之间的联系与区别。


Linux的主要发行版本如下

slackware: SUSE Linux Enterprise Server (SLES)

专业的操作系统,易用的YAST软件包管理系统

Debian: ubuntu , deepin(深度) ,mint

Ubuntu 是基于著名的发行版本Debian Linux发展而来,它的界面非常是人性化,相对更容易上手,另外它对硬件的支持也是非常的全面,是目前最适合做桌面系统使用的Linux发行版本,并且Ubuntu的所有发行版本都是免费提供使用的。

Redhat:RHEL: RedHat Enterprise Linux

Red Hat (红帽公司)成立于1993年,是目前位置全球最资深的Linux厂商,也是最获任何的Linux品牌,其中红帽的认证也是更加具有代表性。  Red Hat的Linux发行版本注意分为Red Hat Enterprise Linux(收费版本),和CentOS(RHEL 的社区克隆版本,免费版本)、Fedora Core(由 Red Hat 桌面版发展演变,免费版本)。  Red Hat 系列是目前国内适用人群最多的Linux发行版本,如果在使用过程中遇到问题,很容易向别人请教或者在网上找到相关的答案。以国内互联网公司最常使用的CentOS发行版为例,他说基于Red Hat Enterprise Linux 的源代码进行重新的编译、去除Red Hat商标的产物,各种的使用方式和收费版本没有任何的区别,而且完全免费。但缺点也就是不向用户提供各种的技术支持,也不负任何的商业责任

CentOS

ContOS是一种对RHEL源代码再编译的产物,由于Linux是开源的操作系统,并不排斥基于源代码的再分发,CentOS就是讲商业Linux操作系统RHEL进行源代码的再编译后分发。并在RHEL的基础上修正了一些已知的漏洞。

ArchLinux

Gentoo

Gentoo 最开始是由Daniel Robbins(FreeBSD 的开发者之一)创建并于2002年发布了第一个稳定版本,到目前为止Gentoo依旧采用源码编译安装的方式进行系统的安装,是所有Linux发型版本里面安装过程最为复杂的发行版。  虽然大家都吐槽于Gentoo复杂的安装过程,但安装完成后的Gentoo是最便于管理的版本,因为得益于采用编译的方式去安装系统,在同等配置下Gentoo也是所有发行版本中运行最快的版本。  网上有人这样评价Gentoo:快速、设计干净而有弹性,它的出名是因为其高度的自定制性(基于源代码的发行版)。尽管安装时可以选择预先编译好的软件包,但是大部分使用 Gentoo 的用户都选择自己手动编译。这也是为什么 Gentoo 适合比较有 Linux 使用经验的老手使用。  不过要注意的是,由于编译软件需要消耗大量的时间,所以,如果你所有的软件都由自己编译,并安装 KDE 桌面系统等比较大的软件包,则可能需要花费很长时间。

LFS : Linux From scratch 自制Liunx


Red Hat (红帽公司)成立于1993年,是目前位置全球最资深的Linux厂商,也是最获任何的Linux品牌,其中红帽的认证也是更加具有代表性。  Red Hat的Linux发行版本注意分为Red Hat Enterprise Linux(收费版本),和CentOS(RHEL 的社区克隆版本,免费版本)、Fedora Core(由 Red Hat 桌面版发展演变,免费版本)。  Red Hat 系列是目前国内适用人群最多的Linux发行版本,如果在使用过程中遇到问题,很容易向别人请教或者在网上找到相关的答案。以国内互联网公司最常使用的CentOS发行版为例,他说基于Red Hat Enterprise Linux 的源代码进行重新的编译、去除Red Hat商标的产物,各种的使用方式和收费版本没有任何的区别,而且完全免费。但缺点也就是不向用户提供各种的技术支持,也不负任何的商业责任

Ubuntu 是基于著名的发行版本Debian Linux发展而来,它的界面非常是人性化,相对更容易上手,另外它对硬件的支持也是非常的全面,是目前最适合做桌面系统使用的Linux发行版本,并且Ubuntu的所有发行版本都是免费提供使用的。

Gentoo 最开始是由Daniel Robbins(FreeBSD 的开发者之一)创建并于2002年发布了第一个稳定版本,到目前为止Gentoo依旧采用源码编译安装的方式进行系统的安装,是所有Linux发型版本里面安装过程最为复杂的发行版。  虽然大家都吐槽于Gentoo复杂的安装过程,但安装完成后的Gentoo是最便于管理的版本,因为得益于采用编译的方式去安装系统,在同等配置下Gentoo也是所有发行版本中运行最快的版本。  网上有人这样评价Gentoo:快速、设计干净而有弹性,它的出名是因为其高度的自定制性(基于源代码的发行版)。尽管安装时可以选择预先编译好的软件包,但是大部分使用 Gentoo 的用户都选择自己手动编译。这也是为什么 Gentoo 适合比较有 Linux 使用经验的老手使用。  不过要注意的是,由于编译软件需要消耗大量的时间,所以,如果你所有的软件都由自己编译,并安装 KDE 桌面系统等比较大的软件包,则可能需要花费很长时间。







2、安装Centos7.6操作系统,创建一个自己名字的用户名,并可以正常登录,将主要步骤截图。













配置环境变量,实现执行history的时候可以看到执行命令的时间。






4、总结Linux哲学思想。

一切皆文件,包括硬件

小型,单一用途的程序

链接程序,共同完成复杂的任务

避免令人困惑的用户界面

配置数据存储在文本中


5、总结Linux常用命令使用格式,并用实例说明。例如echo、screen、date、ifconfig、export等命令

Linux命令,分为内部命令和外部命令。 

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   启用反斜杠转义的解释

       -E   disable interpretation of backslash escapes (default)  禁用反斜杠转义的解释(默认)

       --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   不产生进一步的输出

              \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)    八进制值为NNN的字节(1到3位)

              \xHH     byte with hexadecimal value HH ( 1 to 2 digits)   具有十六机制值HH的字节 (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是一个全屏窗口管理器,它可以在多个进程(通常是交互式shell)之间多路传输一个物理终端。每个虚拟终端提供了一个DEV VT100终端的功能,此外,一些控制功能来自ISO 6429 (ecma 48, ANSI X3.64)和ISO 2022标准(e,g, inser/delete行和支持形式的多字符集)。每个虚拟终端都有一个滚动回滚历史缓冲区和一个允许在窗口之间移动文本重新图标的复制粘贴机制。

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   以给定格式显示当前时间,或设置系统日期

             Mandatory arguments to long options are mandatory form short options too.  长选项的强制性参数也是短选项的强制性参数

             -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内建命令  

export命令用于将shell变量输出为环境变量,或者将shell函数输出为环境变量。  

一个变量创建时,它不会自动地为在它之后创建的shell进程所知。而命令export可以向后面的shell传递变量的值。当一个shell脚本调用并执  行时,它不会自动得到原为脚本(调用者)里定义的变量的访问权,除非这些变量已经被显式地设置为可用。export命令可以用于传递一个或多个变量的值到任何后继脚本。  语法  export(选项)(参数)  选项  -f:代表[变量名称]中为函数名称;  -n:删除指定的变量。变量实际上并未删除,只是不会输出到后续指令的执行环境中;  -p:列出所有的shell赋予程序的环境变量。  参数   变量:指定要输出或者删除的环境变量。  

实例   一般来说,配置交叉编译工具链的时候需要指定编译工具的路径,此时就需要设置环境变量。查看已经存在的环境变量:

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。