马哥教育网络班22期+第1周课程练习

1、描述计算机的组成及其功能。

    计算机由五大功能部分组成(冯诺依曼体系):运算器、控制器、储存器、输入设备、输出设备,对应到具体的硬件设备如下:

    CPU    :    包含运算器、控制器、寄存器及缓存

        功能:以时间流逝的方式来提供计算能力

    内存    :    存储器

        功能:程序(指令+数据)运行时需加载到内存中,以便CPU寻址访问

    键盘鼠标    :输入设备

        功能:与计算机交互的入口,用来提供命令,数据等

    显示器    :    输出设备

        功能:反馈计算机运算处理的结果

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

    Linux发行版三大分支:

    1、Debian (以社区方式运作)

        子分支:ubuntu

            子分支:mint

            knopix

    2、Slackware (以商业公司运作)

        子分支:S.u.S.E

            子分支:SLES

                 OpenSUSE

    2、RedHat (以商业公司运作)

        RedHat Enterprise Linux(RHEL)

            子分支:CentOS (Community Enterprise OS)

        Fedora

    其他有代表性的发行版:Gentoo、ArchLinux等。

3、描述Linux的哲学思想,并按照自己的理解对其进行解释性描述。

    Linux的重要哲学思想之一:一切皆文件,Linux上的一切都可以抽象为文件,包括设备,驱动等;

4、说明Linux系统上命令的使用格式;详细介绍ifconfig、echo、tty、startx、export、pwd、history、shutdown、poweroff、reboot、hwclock、date命令的使用,并配合相应的示例来阐述。

    Linux命令的使用格式:命令 选项 参数

                命令:将某个二进制文件运行起来(进程)

                选项:指定命令的运行特性

                参数:命令的作用对象

    ifconfig:显示系统网络设备的配置信息

    echo:将内容回显到标准输出上

[root@T01-7-2-1511 ~]# echo "Test"
Test
[root@T01-7-2-1511 ~]#

    tty:显示连接到标准输入的终端名

[root@T01-7-2-1511 ~]# tty
/dev/pts/0
[root@T01-7-2-1511 ~]#

    startx:在CLI中启动GUI界面的命令

    export:unknow

    pwd:显示用户的工作目录(当前目录)

[root@T01-7-2-1511 test]# pwd
/tmp/test
[root@T01-7-2-1511 test]#

    history:显示命令的历史纪录

[root@T01-7-2-1511 test]# history
    1  ls
    2  pwd
    3  exit
    4  date
......
  307  tree /tmp/magedu.com
  308  ls -d /etc/[^[:alpha:]][a-z]*
  309  ls -d /etc/[0-9]*[^0-9]
  310  ls -d /var/l?[[:lower:]]
  311  logout
  312  ifconfig
  313  man ifconfig
  314  man echo
  315  echo "Test"
  316  man tty
  317  tty
  318  cd /tmp/test/
  319  pwd
  320  history
[root@T01-7-2-1511 test]#

    shutdown、poweroff、reboot:系统关机重启的命令(管理类命令,需管理员权限)

    hwclock:显示、设定系统的硬件时间

[root@T01-7-2-1511 test]# hwclock
Mon 15 Aug 2016 10:08:33 AM CST  -0.145705 seconds
[root@T01-7-2-1511 test]#

    date:显示、设定系统时间及日期

[root@T01-7-2-1511 test]# date
Mon Aug 15 10:02:15 CST 2016
[root@T01-7-2-1511 test]#

5、如何在Linux系统上获取命令的帮助信息,请详细列出,并描述man文档的章节是如何划分的。

    对于BASH内建的命令:help 命令

[root@T01-7-2-1511 test]# help cd
cd: cd [-L|[-P [-e]]] [dir]
    Change the shell working directory.
    
    Change the current directory to DIR.  The default DIR is the value of the
    HOME shell variable.
    
    The variable CDPATH defines the search path for the directory containing
    DIR.  Alternative directory names in CDPATH are separated by a colon (:).
    A null directory name is the same as the current directory.  If DIR begins
    with a slash (/), then CDPATH is not used.
    
    If the directory is not found, and the shell option `cdable_vars' is set,
    the word is assumed to be  a variable name.  If that variable has a value,
    its value is used for DIR.
    
    Options:
        -L      force symbolic links to be followed
        -P      use the physical directory structure without following symbolic
        links
...
[root@T01-7-2-1511 test]#

    对于外部命令:1、命令 –help

[root@T01-7-2-1511 test]# ls --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.

Mandatory arguments to long options are mandatory for short options too.
  -a, --all                  do not ignore entries starting with .
  -A, --almost-all           do not list implied . and ..
      --author               with -l, print the author of each file
  -b, --escape               print C-style escapes for nongraphic characters
      --block-size=SIZE      scale sizes by SIZE before printing them; e.g.,
                               '--block-size=M' prints sizes in units of
                               1,048,576 bytes; see SIZE format below
  -B, --ignore-backups       do not list implied entries ending with ~
  -c                         with -lt: sort by, and show, ctime (time of last
                               modification of file status information);
                               with -l: show ctime and sort by name;
                               otherwise: sort by ctime, newest first
...
[root@T01-7-2-1511 test]#

            2、man 命令

[root@T01-7-2-1511 test]# man echo
ECHO(1)                                                                                         User Commands                                                                                        ECHO(1)

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)

       \xHH   byte with hexadecimal value HH (1 to 2 digits)

       NOTE: your shell may have its own version of echo, which usually 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
       Written by Brian Fox and Chet Ramey.

COPYRIGHT
       Copyright Â© 2013 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
       This is free software: you are free to change and redistribute it.  There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
       The full documentation for echo is maintained as a Texinfo manual.  If the info and echo programs are properly installed at your site, the command

              info coreutils 'echo invocation'

       should give you access to the complete manual.

GNU coreutils 8.22                                                                              November 2015                                                                                        ECHO(1)
[root@T01-7-2-1511 test]#

    man手册章节划分:

        1:用户命令

        2:系统调用

        3:库用户

        4:特殊文件(如设备文件)

        5:文件格式(如etc/下的配置文件的语法)

        6:游戏

        7:杂项

        8: 管理命令

6、请罗列Linux发行版的基础目录名称法则及公用规定

    

    参照FHS的规定如下:

    /boot: 系统启动相关的文件

    /dev: 设备文件

        设备文件:

        块设备:随机访问,数据块

        字符设备:线性访问,按字符为单位

        设备号:主设备号(major)和次设备号(minor)

    /etc:配置文件

    /home:用户的家目录,每一个用户的家目录通常默认为/home下,目录与用户名相同

    /root:管理员的家目录;

    /lib:库文件

        静态库,  .a

        动态库, .dll, .so (shared object)

        /lib/modules:内核模块文件

    /media:挂载点目录,移动设备

    /mnt:挂载点目录,额外的临时文件系统

    /opt:可选目录,第三方程序的安装目录

    /proc:伪文件系统,内核映射文件

    /sys:伪文件系统,跟硬件设备相关的属性映射文件

    /tmp:临时文件, /var/tmp

    /var:可变化的文件

    /bin: 可执行文件, 用户命令

    /sbin:管理命令

    /usr:shared, read-only

        /usr/bin

        /usr/sbin

        /usr/lib

        /usr/local:

            /usr/local/bin

            /usr/local/sbin

            /usr/local/lib

   

原创文章,作者:N22-无锡-秋林箭,如若转载,请注明出处:http://www.178linux.com/34601

(0)
N22-无锡-秋林箭N22-无锡-秋林箭
上一篇 2016-08-15 11:53
下一篇 2016-08-15 11:54

相关推荐

  • VRRP协议

    VRRP协议 Virtual Router Redundancy Protocol 虚拟路由器冗余协议。 Vrrp协议在linux上的实现(软件实现)是keepalived。 VRRP简单的讲,就是心跳信息。 主节点不断的向备用节点广播信息,信息包含自己的心跳和优先级。 不光如此,还可以在主节点上安装一个监控,来监控其他资源,如果这些资源运行正常,就可以给其…

    2016-11-02
  • LNMP 增加memcached缓存系统 构建LNMMP

    摘抄百度百科 memcache 的解读 memcache是一套分布式的高速缓存系统,由LiveJournal的Brad Fitzpatrick开发,但目前被许多网站使用以提升网站的访问速度,尤其对于一些大型的、需要频繁访问数据库的网站访问速度提升效果十分显著[1]  。这是一套开放源代码软件,以BSD license授权发布。 MemCa…

    Linux干货 2016-09-19
  • ACL权限管理练习

    ACL简介;
    权限管理练习

    2017-09-11
  • 系统时间与硬件时间

    1. “系统时间”与“硬件时间”    系统时间: 一般说来就是我们执行 date 命令看到的时间,linux系统下所有的时间调用(除了直接访问硬件时间的命令)都是使用的这个时间。    硬件时间: 主板上BIOS中的时间,由主板电池供电来维持运行,系统开机时要读取这个时间,并根…

    Linux干货 2016-08-05
  • 马哥教育网络班22期+第9周课程练习

    week9: 1、写一个脚本,判断当前系统上所有用户的shell是否为可登录shell(即用户的shell不是/sbin/nologin); 分别这两类用户的个数;通过字符串比较来实现; #!/bin/bash # SHELL1="/sbin/nologin" declare -i sum1=sum2=0 for&nb…

    Linux干货 2016-10-17
  • N25_第三周

    1、列出当前系统上所有已经登录的用户的用户名,注意:同一个用户登录多次,则只显示一次即可。 who | cut -d' ' -f1 | sort -u [root@server1 ~]# who  | cut -d' ' -f1 …

    Linux干货 2016-12-17

评论列表(1条)

  • 马哥教育
    马哥教育 2016-08-17 16:21

    写的很好,排版还可以在漂亮一点,加油,都超了!