Q. 1、按系列罗列Linux的发行版,并描述不同发行版之间的联系与区别。
A. Linux 主要系列:
* Debian
主要代表有 Ubuntu, Deepin, Mint
* Slackware
主要代表有 SUSE Linux Enterprise Server (SLES), OpenSuse
* RedHat
主要代表有 RedHat Enterprise Linux (RHEL): 每18个月发行一个新版本,商业版。
CentOS: 完全兼容RHEL的格式,社区版。
Fedora: 每6个月发行一个新版本。
* ArchLinux: 轻小简洁,遵循 keep it simple and stupid 原则。
* Gentoo: 追求极致性能和定制,不提供传统的安装程序,需下载源代码在本机编译安装软件。
* LFS: Linux From Scratch, 自制Linux。
* Android: 由Google基于Linux内核开发的Open Source 移动设备操作系统。
不同发行版之间的联系与区别:
* 所有版本都是使用Linux的Kernel, 且遵循一定的开源协议。
* 版本之间的区别在于使用不同版本的Linux Kernel 和Package 管理系统。RedHat 系列用RPM管理系统,Debian系列使用DPKG管理系统。
Q. 2、安装Centos7.6操作系统,创建一个自己名字的用户名,并可以正常登录,将主要步骤截图。
Q. 3、配置环境变量,实现执行history的时候可以看到执行命令的时间。
A. 1) 将 HISTTIMEFORMAT = "d%/m%/y% T% " 写入 ~/.bash_profile 文件中。
2)用source 命令将 HISTTIMEFORMAT 从 ~/.bash_profile 文件中加载到当前的命令界面。
Q. 4、总结Linux哲学思想。
A. * 一切皆文件,包括硬件也有对应文件存在。
* 配置数据储存在文本中。
* 使用轻小单一用途的程序。
* 小程序连接完成复杂任务。
* 避免使用图形界面。
Q. 5、总结Linux常用命令使用格式,并用实例说明。例如echo、screen、date、ifconfig、export等命令
A. echo
Shell 内部命令. 在屏幕上显示一行文字。将字符串做为标准输出。
格式:
echo [SHORT-OPTION] . . . [STRING] . . .
echo LONG-OPTION
选项:
-n do not output the trailing newline.
-e enable interpretation of backslash escapes.
-E disable interpretation of backslash escapes (default).
示例:
screen
用户可通过screen软件实现同时连接多个本地或远程的命令行会话。screen也可以让一个或多个用户从不同终端多次登录一个会话,共享会话的所有特性。
格式:
screen [-opts] [cmd [args]]
常用选项:
-S [SESSION] Create and name a new session.
-x [SESSION] Attach to not detached screen.
-ls List all current created screen sessions.
-r [SESSION] Reattach to a detached screen process.
Ctrl+a,d Detach current screen session.
exit Exit and terminate current screen session.
date
显示或设置系统时间。
格式:
date [OPTION]... [+FORMAT]
常用选项:
-d, --date=STRING Display time described by STRING, not 'now'.
-s, --set=STRING Set time described by STRING
示例:
ifconfig
用于配置和显示Linux内核中网络接口的网络参数。
格式:
ifconfig [-v] [-a] [-s] [interface]
ifconfig [-v] interface [aftype] options | address ...
常用选项:
-a display all interfaces which are currently available, even if down (default).
-s display a short list (like netstat -i).
-v be more verbose for some error conditions.
示例:
export
将shell变量或函数输出为环境变量,可以用于传递一个或多个变量的值到任何后续脚本。
格式:
export [-fn] [name[=word]] ...
export -p
常用选项:
-p List of all names that are exported in the current shell
-n Remove names from export list
-f Names are exported as functions
示例: