计算机组成及Linux基础

第1题:描述计算机的组成及功能

1.1计算机的组成

      计算机是有 运算器,控制器,存储器,输入设备和输出设备组成计算机

1.2计算机各部件功能

运算器
    对数据进行算术运算,逻辑运算和对数据进行加工处理

存储器
    存储程序,数据和各种信号,命令等信息,并在需要时提供这些信息

控制器
    是整个计算机的中枢神经,其动能是对程序规定的控制信息进行解释,根据要求进行控制,
    调度程序、数据、地址,协调计算机各部分工作及内存与外设的访问等

输入设备
    是将程序、原始数据、文字、字符、控制命令等信息输入到计算机,
    例常见的输出设备,鼠标、键盘等

输出设备
    从计算机输出各类数据的设备叫做输出设备。
    输出设备把计算机加工处理的结果(仍然是数字形式的编码)
    变换为人或其它设备所能接收和识别的信息形式如文字、数字、图形、声音、电压等。
    常用的输出设备有显示器、打印机等。

第2题:按系罗列Linux的发行版本,并描述不同发行 版之间的联系与区别

2.1linux 的发行版有:

    三大主流的发行版本:Slackware, debain, redhat

2.1其之间的联系与区别:

Slackware: 最老的Linux发行版,主用于桌面、工作站,采用默认桌面则为KED.

    SUSE: 基于Slackware二次开发的Linux,主用于商业桌面、针对个人用户。流行于欧洲。

        OPEN SUSE: 由SUSE发展而来,主用于桌面环境、桌面较为炫酷,免费。

debian: 互联网自发组织,最接近原滋原味的Linux,三大发行版中唯一以社区形式运作,不以商业公司形式运作,
        是一个致力于创建自由操作系统的合作组织。而且debian开发者所创建的操作系统中绝大部分基础工具来自于GNU工程。

    Ubuntu:Ubuntu是基于debian发行版和gnome桌面环境,没6个月发行一次新的版本,用于桌面环境。

redhat  :是Redhat自己的发行的企业版本,是redhat的一个重要节点。

    CentOS:是基于redhat Linux地宫的可自由使用源代码的企业级linux发行版本,目前已被redhat收购,成为redhat旗下的一个组织。

    fedora:主要针对个人用户,一切新的软件皆可使用,可用于桌面,工作站,由红帽公司赞助

第3题:描述linux的哲学思想,并按照自己的理解对其进行解释性描述

3.1一切皆为文件。注:在计算机系统中所有对象包括硬件都视为文件。

3.2有众多小程序组成。注:组成众多的小程序完成复杂的任务。

3.3尽量避免跟用户的交互。注:尽量不与用户交互,一个程序一旦运行,就不需要用户任何操作。

3.4使用文本保存配置信息。注:使用纯文本文件保存配置信息,使得程序配置方式更加统一。

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

4.1 ifconfig

ifconfig #显示当前计算机启用的网卡信息。

[root@localhost ~]# ifconfig
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.1.12 netmask 255.255.255.240 broadcast 172.16.1.15
inet6 fe80::20c:29ff:fe2a:bab9 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:2a:ba:b9 txqueuelen 1000 (Ethernet)
RX packets 17243 bytes 1473492 (1.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10269 bytes 17354288 (16.5 MiB)
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 0 (Local Loopback)
RX packets 164 bytes 14116 (13.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 164 bytes 14116 (13.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@localhost ~]#

ifconfig -a #显示当前计算机上的所有网卡信息,包括已经down掉的网卡信息。

[root@localhost ~]# ifconfig -a
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.1.12 netmask 255.255.255.240 broadcast 172.16.1.15
inet6 fe80::20c:29ff:fe2a:bab9 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:2a:ba:b9 txqueuelen 1000 (Ethernet)
RX packets 20288 bytes 1752689 (1.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10557 bytes 17383343 (16.5 MiB)
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 0 (Local Loopback)
RX packets 216 bytes 18628 (18.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 216 bytes 18628 (18.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0: flags=4098<BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 00:00:00:00:00:00 txqueuelen 0 (Ethernet)
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

virbr0-nic: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 52:54:00:c0:37:2f txqueuelen 500 (Ethernet)
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

[root@localhost ~]#

ifconfig 网卡名称 #只显示指定名称的网卡信息

[root@localhost ~]# ifconfig eno16777736
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.1.12 netmask 255.255.255.240 broadcast 172.16.1.15
inet6 fe80::20c:29ff:fe2a:bab9 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:2a:ba:b9 txqueuelen 1000 (Ethernet)
RX packets 20369 bytes 1759631 (1.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10593 bytes 17390297 (16.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@localhost ~]#

4.2 echo :回显请求

echo $SHELL #请求显示当前是用的shell程序

[root@localhost ~]# echo $SHELL
/bin/bash
[root@localhost ~]#

echo ‘$SHELL’ #单引号为弱引用,不引用变量值,直接输出字符串

[root@localhost ~]# echo '$SHELL'
$SHELL
[root@localhost ~]#

4.3 tty

tty:查看终端设备命令

图形终端:附加在物理终端之上的以软件方式虚拟实现的终端,但额外会提供桌面环境,设备文件路径:/dev/tty#

模拟终端:图形界面下打开的命令行接口,基于SSH协议或telnet洗衣等远程打开的界面,设备文件:/dev/pts/# [0 oo)

物理终端:/dev/console

以下是通过SSH登录的

[root@localhost ~]# tty
/dev/pts/1
[root@localhost ~]#

4.4 startx

startx #显示图形终端

4.5 export

    export #设置显示环境变量 -p:列出环境变量 -n:删除一个环境变量

4.6 pwd

pwd #显示当前工作的目录位置

[root@localhost ~]# cd /var/log/
[root@localhost log]# pwd
/var/log
[root@localhost log]#

4.7 history

history #显示缓存的历史命令,默认是1000条

-c #清空历史记录

-d 数字 #删除指定的那条命令

-a #将缓存中的历史命令手动添加到历史命令文件.bash_history中

history

[root@localhost log]# history
1 cd -
2 cd /home/danry/Desktop/
3 ls
4 cd -
5 rm -rf *
6 ls
7 ls /
8 cd -
9 mv CentOS7-Base-163.repo /etc/yum.repos.d/
10 ls
11 cd -

history -d 2

[root@localhost log]# history -d 2
[root@localhost log]# history
1 cd -
2 ls
3 cd -
4 rm -rf *
5 ls
6 ls /
7 cd -
8 mv CentOS7-Base-163.repo /etc/yum.repos.d/
9 ls
10 cd -
11 yum makecache

history -a

[root@localhost log]# history -a
[root@localhost log]# cd
[root@localhost ~]# cat .bash_history
cd -
ls
cd -
rm -rf *
ls
ls /
cd -
mv CentOS7-Base-163.repo /etc/yum.repos.d/
ls
cd -
yum makecache
vim /etc/sysconfig/network-scripts/ifcfg-
vim /etc/sysconfig/network-scripts/ifcfg-eno16777736
service network restart
yum makecache

history -c

[root@localhost ~]# history -c
[root@localhost ~]# history
1 history
[root@localhost ~]#

4.8 shutdown :关闭或重启系统的命令

shutdown -r 10 #十分钟后重启系统

shutdown -h 10 #十分钟后关闭系统

shutdown -c #取消shutdown所有已执行的命令

shutdown -r -10

[root@localhost ~]# date
Wed Feb 12 23:23:32 EST 2014
[root@localhost ~]# shutdown -r 10
Shutdown scheduled for Wed 2014-02-12 23:33:34 EST, use 'shutdown -c' to cancel.

Broadcast message from root@localhost.localdomain (Wed 2014-02-12 23:23:34 EST):

The system is going down for reboot at Wed 2014-02-12 23:33:34 EST!

[root@localhost ~]#

shutdown -h 10

[root@localhost ~]# date
Wed Feb 12 23:24:23 EST 2014
[root@localhost ~]# shutdown -h 10
Shutdown scheduled for Wed 2014-02-12 23:34:27 EST, use 'shutdown -c' to cancel.

Broadcast message from root@localhost.localdomain (Wed 2014-02-12 23:24:27 EST):

The system is going down for power-off at Wed 2014-02-12 23:34:27 EST!

[root@localhost ~]#

shutdown -c

[root@localhost ~]# shutdown -c

Broadcast message from root@localhost.localdomain (Wed 2014-02-12 23:24:53 EST):

The system shutdown has been cancelled at Wed 2014-02-12 23:25:53 EST!

[root@localhost ~]#

4.9 poweroff :强制关机,有可能丢失数据

4.10 reboot : 强制重启,有可能丢失数据

4.11 hwclock :显示计算机的硬件时钟

hwclock #显示硬件时间

–set # 设置硬件时间

-s #硬件时间同步到系统时间

-w,–systohc #系统时间同步到硬件时间

4.12 date 显示系统时间

date #显示系统时间

date 021223222014.11 #设置系统时间为2014年2月12日23点22分11秒

[root@localhost ~]# date 021223222014.11
Wed Feb 12 23:22:11 EST 2014
[root@localhost ~]#

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

5.1 command –help

ls –help #查看ls命令后可跟什么参数

[root@localhost ~]# 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
-C list entries by columns
--color[=WHEN] colorize the output; WHEN can be 'never', 'auto',
or 'always' (the default); more i

5.2 man :命令使用手册

man command #man的使用格式

man手册的目录位置: /usr/share/man

/usr/share/man/下的man1,man2……man8等,

man1  #用户命令
man2  #系统调用
man3  #c库调用
man4  #设备文件及特殊文件
man5  #文件格式;(配置文件)
man6  #游戏使用帮助
man7  #杂项
man8  #管理工具及守护进行

man ls #查看ls 的使用帮助

LS(1) User Commands LS(1)

NAME
ls - list directory contents

SYNOPSIS
ls [OPTION]... [FILE]...

DESCRIPTION
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
Manual page ls(1) line 1 (press h for help or q to quit)

第6题:请罗列linux发行版的基础目录名称命名法则及功用规定

6.1 命名法则

为了保证Linux发行版之间能够良好的接合,LSB(Linux Standards Base)提供了一种规范,制定了应用程序与运行环境之间的二进制接口。其中 FHS(Filesystem Hierarchy Standard)标准定义了Linux的文件系统规范。

6.2 详细功用

/boot #用于存放linux的应到文件,包括Kernel、和引导加载程序。可以挂载独立的分区。
/bin #存储管理类的基本命令,OS在启动时会用到,不能关联独立的分区               
/sbin #存储管理类的基本命令,不能关联独立分区;
/lib #基本共享库文件,以及内核模块文件(/lib/modules);
/lib64 #作为/lib的补充,专用于x86_64系统上的辅助共享库文件存放位置;
/etc #配置文件目录(纯文本文件);
/home #普通用户的家目录,通常关联独分区;
/root #root用户的家目录;
/media #用于挂载移动式便携设备,如cdrom、USB等;
/mnt #临时文件系统挂载点;
/dev #设备及特殊文件的存储位置,如终端、键盘、硬盘等;
/opt #第三方应用程序的安装位置,逐渐被/usr/local取代;
/srv # 系统上运行的服务用到的数据;
/tmp #临时文件存储位置;
/usr # universal shared, read-only data;普通公共程序的存储位置,如外部命令和安装的程序等。通常挂载到独立分区
/var # variable data files;用于存储频繁变化的数据,如日志、用户的邮件、缓存、和pid文件等。通常挂载到独立分区
/proc #虚拟文件系统,并不真实存储在硬盘上。为内存的映射,可用于临时修改或查看kernel的相关配置;
/sys #用于输出当前系统上硬件设备相关信息的虚拟文件系统;

二进制程序文件:

/bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin

库文件:

/lib, /lib64, /usr/lib, /usr/lib64, /usr/local/lib, /usr/local/lib64

配置文件:

/etc, /etc/DIRECTORY, /usr/local/etc

帮助文件:

/usr/share/man, /usr/share/doc, /usr/local/share/man, /usr/local/share/doc

 

原创文章,作者:N27_Danry,如若转载,请注明出处:http://www.178linux.com/79145

(0)
N27_DanryN27_Danry
上一篇 2017-07-02
下一篇 2017-07-02

相关推荐

  • 马哥教育网络班20期+第3周课程练习

     1、列出当前系统上所有已经登录的用户的用户名,注意:同一个用户登录多次,则只显示一次即可。 法一: who | cut -d ‘ ‘ -f 1 | tail -u 法二: who | cut -d ’’-f&…

    Linux干货 2016-06-26
  • N22-第24周博客作业——-虚拟化技术

    虚拟化技术—基础(1) 本文围绕下面3个问题进行对虚拟化技术展开讨论: 1、虚拟化技术实现方式有哪些?虚拟化技术分哪些? 2、请分别通过kvm、xen工具来实现虚拟化系统的部署? 3、请描述openstack、kvmqemu-kv、libvirt及xen之间的关系。 虚拟化诞生和发展     1961年 IBM709…

    Linux干货 2016-10-17
  • 用户、组命令总结

    useradd:添加用户   -u :指定UID   -o :不对UID的惟一性进行检查,用法是-ou   -g :指定用户的主组或者是GID   -G :指定用户的附加组group1,group2,。。。   -d :指定用户的家目录,所指定的家目录必须是不存在的   -s :指定用户的登录she…

    Linux干货 2016-11-23
  • 计算机操作系统与简单命令

    计算机系统的组成 硬件:主机(cpu、内存等),外部设备(输入设备键盘鼠标、输出设备显示屏;硬软盘   等等)。 软件:主要由操作系统和应用程序构成。 计算机硬件的组成部分及工作流程图 输入设备——存储器——CPU运算——输出设备   服务器主要分类有: 塔式服务器:立式PC相像 机架式服务器:统一标准宽度19英寸(48.26c…

    Linux干货 2017-02-14
  • linux启动和内核管理

    linux启动和内核管理:1. 加载BIOS 的硬件信息,获取第一个启动设备2. 读取第一个启动设备MBR 的引导加载程序(grub) 的启动信息3. 加载核心操作系统的核心信息,核心开始解压缩,并尝试驱动所有的硬件设备4. 核心执行init 程序,并获取默认的运行信息5.init 程序执行/etc/rc.d/rc.sysinit 文件6. 启动核心的外挂模…

    Linux干货 2017-03-28

评论列表(1条)

  • 马哥教育
    马哥教育 2017-07-13 17:08

    总结的非常好的,希望您能牢记这些基础知识,加油!!!