馬哥教育網絡班22期+第1周課程練習

問題1:

計算機組成如下:CPU、存儲器、輸入設備、輸出設備1、中央處理器(Central Processing Unit,簡稱 CPU)。它主要由控制器、運算器等組成,并采用大規模集成電路工藝制成的芯片,又稱微處理器芯片。   CPU又由運算器和控制器組成。1)運算器 運算器又稱算術邏輯單元(Arithmetic Logic Unit簡稱ALU)。它是計算機對數據進行加工處理的部件,包括算術運算(加、減、乘、除等)和邏輯運算(與、或、非、異或、比較等)。    2)控制器 控制器負責從存儲器中取出指令,并對指令進行譯碼;根據指令的要求,按時間的先后順序,負責向其它各部件發出控制信號,保證各部件協調一致地工作,一步一步地完成各種操作??刂破髦饕芍噶罴拇嫫?、譯碼器、程序計數器、操作控制器等組成。    2、存儲器是計算機記憶或暫存數據的部件。計算機中的全部信息,包括原始的輸入數據。經過初步加工的中間數據以及最后處理完成的有用信息都存放在存儲器中。而且,指揮計算機運行的各種程序,即規定對輸入數據如何進行加工處理的一系列指令也都存放在存儲器中。存儲器分為內存儲器(內存)和外存儲器(外存)兩種。3、輸入設備輸入設備是給計算機輸入信息的設備。它是重要的人機接口,負責將輸入的信息(包括數據和指令)轉換成計算機能識別的二進制代碼,送入存儲器保存,如鍵盤鼠標等。4、輸出設備輸出設備是輸出計算機處理結果的設備。在大多數情況下,它將這些結果轉換成便于人們識別的形式,如顯示器。 

問題2

Linux發行版實際上是linux內核以及GNU的應用程序進行的二次封裝和編譯的產物。發行版為許多不同的目的而制作, 包括對不同計算機結構的支持, 對一個具體區域或語言的本地化,實時應用,和嵌入式系統。將主要的發行版介紹如下:    Red Hat Linux可能這是最著名的Linux版本了,1994年創業,Red Hat Linux是公共環境中表現上佳的服務器。它擁有自己的公司,能向用戶提供一套完整的服務,這使得它特別適合在公共網絡中使用。
   CentOS(Community ENTerprise Operating System)是來自于Red Hat Enterprise Linux依照開放源代碼規定釋出的源代碼所編譯而成。由于出自同樣的源代碼,因此有些要求高度穩定性的服務器以CentOS替代商業版的Red Hat Enterprise Linux使用。兩者的不同,在于CentOS并不包含封閉源代碼軟件,CentOS 是一個基于Red Hat Linux 提供的可自由使用源代碼的企業級Linux發行版本。新版本的 CentOS 大約每兩年發行一次,而每個版本的 CentOS 會定期(大概每六個月)更新一次,以便支持新的硬件。這樣,建立一個安全、低維護、穩定、高預測性、高重復性的 Linux 環境。
    Fedora Core(自第七版直接更名為Fedora)是眾多 Linux 發行版之一。它是一套從Red Hat Linux發展出來的免費Linux系統。Fedora Core 的前身就是Red Hat Linux。Fedora是一個開放的、創新的、前瞻性的操作系統和平臺,基于Linux。它允許任何人自由地使用、修改和重發布,無論現在還是將來。它由一個強大的社群開發,這個社群的成員以自己的不懈努力,提供并維護自由、開放源碼的軟件和開放的標準。Fedora 項目由 Fedora 基金會管理和控制,得到了 Red Hat, Inc. 的支持。Fedora 是一個獨立的操作系統,是Linux的一個發行版,可運行的體系結構包括 x86(即i386-i686), x86_64 和 PowerPC。
    Debian Project誕生于1993年8月13日,它的目標是提供一個穩定容錯的Linux版本。支持Debian的不是某家公司,而是許多在其改進過程中投入了大量時間的開發人員,這種改進吸取了早期Linux的經驗。Debian以其穩定性著稱,雖然它的早期版本Slink有一些問題,但是它的現有版本Potato已經相當穩定了。Debian主要通過基于Web的論壇和郵件列表來提供技術支持。作為服務器平臺,Debian提供一個穩定的環境。為了保證它的穩定性,開發者不會在其中隨意添加新技術,而是通過多次測試之后才選定合適的技術加入。    MandrakeSoft,Linux Mandrake的發行商,在1998年由一個推崇Linux的小組創立,它的目標是盡量讓工作變得更簡單。最終,Mandrake給人們提供了一個優秀的圖形安裝界面,它的最新版本還包含了許多Linux軟件包。
作為Red Hat Linux的一個分支,Mandrake將自己定位在桌面市場的最佳Linux版本上。但該公司還是支持服務器上的安裝,而且成績并不壞。Mandrake的安裝非常簡單明了,為初級用戶設置了簡單的安裝選項。它完全使用GUI界面,還為磁盤分區制作了一個適合各類用戶的簡單GUI界面。軟件包的選擇非常標準,另外還有對軟件組和單個工具包的選項。安裝完畢后,用戶只需重啟系統并登錄進入即可。    Ubuntu是一個以桌面應用為主的Linux操作系統基于Debian發行版和unity桌面環境,與Debian的不同在于它每6個月會發布一個新版本。Ubuntu的目標在于為一般用戶提供一個最新的、同時又相當穩定的主要由自由軟件構建而成的操作系統。Ubuntu具有龐大的社區力量,用戶可以方便地從社區獲得幫助。隨著云計算的流行,ubuntu推出了一個云計算環境搭建的解決方案,可以在其官方網站找到相關信息。    SuSE總部設在德國的SuSE AG在商界已經奮斗了8年多,它一直致力于創建一個連接數據庫的最佳Linux版本。為了實現這一目的,SuSE與Oracle 和IBM合作,以使他們的產品能穩定地工作。在SuSE 操作系統下,可以非常方便地訪問Windows磁盤,這使得兩種平臺之間的切換,以及使用雙系統啟動變得更容易。SuSE的硬件檢測非常優秀,該版本在服務器和工作站上都用得很好。SuSE擁有界面友好的安裝過程,還有圖形管理工具,可方便地訪問Windows磁盤,對于終端用戶和管理員來說使用它同樣方便,這使它成為了一個強大的服務器平臺。 SuSE也通過基于Web的論壇提供技術支持。    Gentoo是Linux世界最年輕的發行版本,正因為年輕,所以能吸取在她之前的所有發行版本的優點。Gentoo最初由Daniel Robbins(FreeBSD的開發者之一)創建,首個穩定版本發布于2002年。由于開發者對FreeBSD的熟識,所以Gentoo擁有媲美FreeBSD的廣受美譽的ports系統 ——Portage包管理系統。
 問題3:
Linux哲學思想:1、一切皆文件:硬件設備、系統運行時的性能參數、均以文件的方式存在;2、單一目的的小程序:眾多單一功能的小程序能夠通過組合完成復雜的任務;3、文本文件保存配置信息:用戶通過文本編輯器能夠對應用的配置進行簡單直觀的修改和調優;4、盡量避免捕獲用戶接口:而是通過編程完成自動化任務;

問題4:

1、ifconfig 用于查看系統接口網絡配置

NAME

       ifconfig – configure a network interface


SYNOPSIS

       ifconfig [-v] [-a] [-s] [interface]

       ifconfig [-v] interface [aftype] options | address …

OPTIONS

       -a     display all interfaces which are currently available, even if down

       -s     display a short list (like netstat -i)

       -v     be more verbose for some error conditions

[admin@localhost ~]$ ifconfig -as

ifconfig: option `-as' not recognised.

ifconfig: `–help' gives usage information.

注意:參數不能合并

[admin@localhost ~]$ ifconfig -a -s

Iface      MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg

eno16777  1500     4902      0      0 0          2687      0      0      0 BMRU

lo       65536       16      0      0 0            16      0      0      0 LRU

virbr0    1500        0      0      0 0             0      0      0      0 BMU

virbr0-n  1500        0      0      0 0             0      0      0      0 BM

2、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


[admin@localhost ~]$ echo -e "hello \nworld"

hello 

world


3、tty 顯示連接到標準輸入設備的終端名稱

NAME

       tty – print the file name of the terminal connected to standard input


SYNOPSIS

       tty [OPTION]…


DESCRIPTION

       Print the file name of the terminal connected to standard input.


       -s, –silent, –quiet

              print nothing, only return an exit status


       –help display this help and exit


       –version

              output version information and exit


       GNU  coreutils  online  help:  <http://www.gnu.org/software/coreutils/>  Report  tty translation bugs to

       <http://translationproject.org/team/>

[admin@localhost ~]$ tty

/dev/pts/0

4、startx 開啟圖形界面

STARTX(1)                                   General Commands Manual                                   STARTX(1)


NAME

       startx – initialize an X session


SYNOPSIS

       startx [ [ client ] options … ] [ — [ server ] [ display ] options … ]


DESCRIPTION

       The startx script is a front end to xinit(1) that provides a somewhat nicer user interface for running a

       single session of the X Window System.  It is often run with no arguments.


       Arguments immediately following the startx command are used to start a client  in  the  same  manner  as

       xinit(1).   The  special  argument  '–'  marks  the end of client arguments and the beginning of server

       options.  It may be convenient to specify server options with startx to change on  a  per-session  basis

       the default color depth, the server's notion of the number of dots-per-inch the display device presents,

       or take advantage of a different server layout, as permitted by the Xorg(1) server and specified in  the

       xorg.conf(5)  configuration.   Some  examples  of specifying server arguments follow; consult the manual

       page for your X server to determine which arguments are legal.


              startx — -depth 16


              startx — -dpi 100


              startx — -layout Multihead

事例略


5、exports  設置shell的環境變量

[admin@localhost ~]$ help export

export: export [-fn] [name[=value] …] or export -p

    Set export attribute for shell variables.

    

    Marks each NAME for automatic export to the environment of subsequently

    executed commands.  If VALUE is supplied, assign VALUE before exporting.

    

    Options:

      -f refer to shell functions

      -n remove the export property from each NAME

      -p display a list of all exported variables and functions

    

    An argument of `–' disables further option processing.

    

    Exit Status:

    Returns success unless an invalid option is given or NAME is invalid.

例如:

export LANG=en_US


6、pwd 

PWD(1)                    BSD General Commands Manual                   PWD(1)


NAME

     pwd — return working directory name


SYNOPSIS

     pwd [-L | -P]


DESCRIPTION

     The pwd utility writes the absolute pathname of the current working

     directory to the standard output.


     Some shells may provide a builtin pwd command which is similar or identi-

     cal to this utility.  Consult the builtin(1) manual page.


     The options are as follows:


     -L      Display the logical current working directory.


     -P      Display the physical current working directory (all symbolic

             links resolved).

例如:

Mac-Air:~ Johnny$ pwd -L

/Users/Johnny

7、history 顯示或執行歷史命令

[admin@localhost ~]$ help history

history: history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg…]

    Display or manipulate the history list.

    

    Display the history list with line numbers, prefixing each modified

    entry with a `*'.  An argument of N lists only the last N entries.

    

    Options:

      -c clear the history list by deleting all of the entries

      -d offset delete the history entry at offset OFFSET.

    

      -a append history lines from this session to the history file

      -n read all history lines not already read from the history file

      -r read the history file and append the contents to the history

     list

      -w write the current history to the history file

     and append them to the history list

    

      -p perform history expansion on each ARG and display the result

     without storing it in the history list

      -s append the ARGs to the history list as a single entry

例如:

[admin@localhost ~]$ history -d 29

8、shutdown 關機重啟命令

SHUTDOWN(8)                        shutdown                        SHUTDOWN(8)


NAME

       shutdown – Halt, power-off or reboot the machine


SYNOPSIS

       shutdown [OPTIONS…] [TIME] [WALL…]


DESCRIPTION

       shutdown may be used to halt, power-off or reboot the machine.

OPTIONS

       The following options are understood:


       –help

           Print a short help text and exit.


       -H, –halt

           Halt the machine.


       -P, –poweroff

           Power-off the machine (the default).


       -r, –reboot

           Reboot the machine.


       -h

           Equivalent to –poweroff, unless –halt is specified.


       -k

           Do not halt, power-off, reboot, just write wall message.

       –no-wall

           Do not send wall message before halt, power-off, reboot.


       -c

           Cancel a pending shutdown. This may be used cancel the effect of an

           invocation of shutdown with a time argument that is not "+0" or

           "now".

例如:

[admin@localhost ~]$ shutdown -k

Must be root.

[admin@localhost ~]$ su

Password: 

ABRT has detected 1 problem(s). For more info run: abrt-cli list –since 1470757101

[root@localhost admin]# shutdown -k

Shutdown scheduled for Sun 2016-08-14 03:26:48 PDT, use 'shutdown -c' to cancel.


Broadcast message from root@localhost.localdomain (Sun 2016-08-14 03:25:48 PDT):


The system is going down for power-off at Sun 2016-08-14 03:26:48 PDT!

9、poweroff 關機重啟命令

HALT(8)                              halt                              HALT(8)


NAME

       halt, poweroff, reboot – Halt, power-off or reboot the machine


SYNOPSIS

       halt [OPTIONS…]


       poweroff [OPTIONS…]


       reboot [OPTIONS…]

DESCRIPTION

       halt, poweroff, reboot may be used to halt, power-off or reboot the

       machine.


OPTIONS

       The following options are understood:


       –help

           Print a short help text and exit.

       –halt

           Halt the machine, regardless of which one of the three commands is

           invoked.


       -p, –poweroff

           Power-off the machine, regardless of which one of the three

           commands is invoked.


       –reboot

           Reboot the machine, regardless of which one of the three commands

           is invoked.


       -f, –force

           Force immediate halt, power-off, reboot. Do not contact the init

           system.


       -w, –wtmp-only

           Only write wtmp shutdown entry, do not actually halt, power-off,

           reboot.

       -d, –no-wtmp

           Do not write wtmp shutdown entry.


       –no-wall

           Do not send wall message before halt, power-off, reboot.

10、reboot 關機重啟命令

HALT(8)                              halt                              HALT(8)


NAME

       halt, poweroff, reboot – Halt, power-off or reboot the machine


SYNOPSIS

       halt [OPTIONS…]


       poweroff [OPTIONS…]


       reboot [OPTIONS…]

11、hwclock 獲取或設置硬件時鐘

HWCLOCK(8)                   System Administration                  HWCLOCK(8)


NAME

       hwclock – query or set the hardware clock (RTC)


SYNOPSIS

       hwclock [function] [option…]

FUNCTIONS

       You need exactly one of the following  options  to  tell  hwclock  what

       function to perform:


       -r, –show

              Read  the  Hardware Clock and print the time on standard output.

              The time shown is always in local time, even if  you  keep  your

              Hardware  Clock  in  Coordinated  Universal Time.  See the –utc

              option.  Showing the Hardware Clock time is the default when  no

              function is specified.


       –set  Set the Hardware Clock to the time given by the –date option.


       -s, –hctosys

              Set the System Time from the Hardware Clock.

例如:

[root@localhost admin]# hwclock -r

Sun 14 Aug 2016 03:34:18 AM PDT  -0.260038 seconds

12、date 獲取或設置系統時鐘

DATE(1)                          User Commands                         DATE(1)


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 for 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]

       -s, –set=STRING

              set time described by STRING


       -u, –utc, –universal

              print or set Coordinated Universal Time (UTC)


       –help display this help and exit


       –version

              output version information and exit

問題5:

Linux的命令分為內部和外部兩種:

內部命令為shell內嵌命令可以通過help command進行查看幫助;

外部命令可以用command –help進行查看幫助;

大部分的命令都可以通過man查看幫助,但man內部命令一般會顯示bash shell的介紹。

centos 7 的man有九個章節:

 The table below shows the section numbers of the manual followed by the

       types of pages they contain.


       1   Executable programs or shell commands    用戶命令

       2   System calls (functions provided by the kernel)    系統調用

       3   Library calls (functions within program libraries)    庫調用

       4   Special files (usually found in /dev)    特殊文件

       5   File formats and conventions eg /etc/passwd    文件格式介紹    

       6   Games    游戲

       7   Miscellaneous  (including  macro  packages  and  conventions), e.g.

           man(7), groff(7)    雜項

       8   System administration commands (usually only for root) 系統管理命令

       9   Kernel routines [Non standard]    內核程序


問題6:

[root@localhost /]# tree -L 1

.

├── bin -> usr/bin  二進制可執行文件,普通用戶

├── boot    系統啟動相關文件夾    

├── dev    設備文件

├── etc    配置文件

├── home    一般用戶家目錄

├── lib -> usr/lib    庫文件

├── lib64 -> usr/lib64    64位庫文件

├── media    掛載點目錄,移動設備

├── mnt    掛載點目錄,臨時文件系統

├── opt    第三方軟件

├── proc    內核映射文件

├── root    管理員家目錄

├── run    系統運行時需要的文件

├── sbin -> usr/sbin    管理員的二進制可執行文件

├── srv    應用服務保存文件的目錄

├── sys    偽文件系統跟硬件設備相關的屬性映射文件

├── tmp    臨時文件夾

├── usr    全局共享只讀文件

└── var    存放可變化的文件和目錄,如日志文件、lockfiles、cache



原創文章,作者:zhangxiaola,如若轉載,請注明出處:http://www.www58058.com/35678

(0)
zhangxiaolazhangxiaola
上一篇 2016-08-15 11:53
下一篇 2016-08-15 11:58

相關推薦

  • N21天天第十一周課程練習

    1、詳細描述一次加密通訊的過程,結合圖示最佳。 SSL協議基礎: SSL協議位于TCP/IP協議與各種應用層協議之間,本身又分為兩層: 1)SSL記錄協議:建立在可靠傳輸層協議(TCP)之上,為上層協議提供數據封裝、壓縮、加密等基本功能。 2)SSL握手協議:在SSL記錄協議之上,用于實際數據傳輸前,通訊雙方進行身份認證、協商加密算法、交換加密密鑰等。 SS…

    Linux干貨 2016-10-09
  • 面向對象簡單介紹

    面向對象簡單介紹

    Linux干貨 2017-11-12
  • yum命令的用法

    1.列出所有可更新的軟件清單命令:yum check-update 2.安裝所有更新軟件命令:yum update 3.僅安裝指定的軟件命令:yum install <package_name> 4.僅更新指定的軟件命令:yum update <package_name> 5.列出所有可安裝的軟件清單命令:yum list 用YUM安…

    Linux干貨 2017-08-11
  • Find命令簡介與使用

    用途:         find命令用來在指定目錄下查找文件。任何位于參數之前的字符串都將被視為欲查找的目錄名。如果使用該命令時,不設置任何參數,則find命令將在當前目錄下查找子目錄與文件。并且將查找到的子目錄和文件全部進行顯示。 語法: find [OPTION]… [查找…

    Linux干貨 2016-08-30
  • 馬哥教育網絡班21期-第一次課程作業

    計算機組成部分及其作用 1.總線 電子管道,攜帶信息字節并在各個部件間傳輸。分為地址總線,數據總線,控制總線。 CPU最大可尋址范圍:2^N*M,  N為地址總線數量,M為數據總線數量。 2.I/O設備 I/O設備及輸入輸出設備,最常見的輸入設備就是我們非常熟悉的鍵盤,鼠標,我們通過我們通過這些設備向計算機傳達指令,讓計算機完成我們想要它完成的工作…

    Linux干貨 2016-06-29
  • N25-第11周博客作業

    1、詳細描述一次加密通訊的過程,結合圖示最佳。 第一步:他們需要實現協商好對稱加密算法,單向加密算法,公鑰加密算法,交換公鑰等。 第二步:B用戶想要將數據傳給A,首先需要使用單向加密算法取出數據的特征碼,并用自己的私鑰對這段特征碼進行加密(數字簽名),B用戶生成臨時對稱密鑰,并用對稱密鑰加密整段數據,B用戶使用 A用戶的公鑰加密一次性對稱密鑰,附加在整段數據…

    Linux干貨 2017-05-21

評論列表(1條)

  • 馬哥教育
    馬哥教育 2016-08-17 15:52

    寫的很好,排版還可以在漂亮一點,加油,把man貼上是幾個意思?要你的理解

欧美性久久久久