当前位置:首页 > 有云笔记 > Linux > 正文内容

linux练习(根目录、/dev目录,字符控制台快速切换,硬盘的命名规则)

小白2年前 (2021-12-01)Linux261650

linux练习(根目录、/dev目录,字符控制台快速切换,硬盘的命名规则)


linux练习(根目录、/dev目录,字符控制台快速切换,硬盘的命名规则)

1 简答题:请列举你所知道的Linux发行版

参考答案

常见的Linux发行版:

  • Red Hat Enterprise Linux 5/6/7

  • CentOS 5/6/7

  • Suse Linux Enterprise 11

  • Debian Linux 6.0

  • Ubuntu Linux 13.04/13.10

  • Oracle Linux 6

RedHat,Centos,Ubuntu,Debian

2 简答题:Linux系统的根目录、/dev目录的作用是什么

参考答案

  • /:linux文件系统的起点,linux所有的文件都放在其中。

  • /dev:存放硬盘、键盘、鼠标、光驱等各种设备文件。

3 简答题:从Linux桌面环境如何快速切换到字符控制台终端

参考答案

按组合键Ctrl+Alt+Fn,其中Fn为F2、F3、F4、F5、F6键中的任何一个。

4 简答题:硬盘的命名规则是什么?

参考答案

1)IDE硬盘为hda

2)SCSI或SATA硬盘为sda

3)nvme硬盘为nvme0n2

4)KVM虚拟机硬盘为vda

6 实验练习题,完成如下练习

  • 查看操作系统版本信息

  • 查看CPU信息

  • 查看主机名和IP地址

  • 创建目录、创建空文件

  • 查看文件头部、末尾信息

参考答案

//查看操作系统版本信息

[root@localhost ~]# cat /etc/redhat-release

CentOS Linux release 7.5.1804 (Core)

//查看CPU信息

[root@localhost ~]# lscpu

Architecture:          x86_64

CPU op-mode(s):        32-bit, 64-bit

Byte Order:            Little Endian

CPU(s):                2

On-line CPU(s) list:   0,1

Thread(s) per core:    1

Core(s) per socket:    1

... ...

//查看主机名和IP地址

[root@localhost ~]# hostname

localhost.localdomain

[root@localhost ~]# ip a s

... ...

//创建目录、创建空文件

[root@localhost ~]# mkdir /test

[root@localhost ~]# touch /test/myfile

[root@localhost ~]# ls /

[root@localhost ~]# ls /test

//查看文件头部(开始10行)

[root@localhost ~]# head /etc/fstab

#

# /etc/fstab

# Created by anaconda on Sat Jan 26 04:32:52 2099

#

# Accessible filesystems, by reference, are maintained under '/dev/disk'

# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

#

/dev/vda1       /       xfs     defaults        0 0

//查看文件末尾信息(末尾10行)

[root@localhost ~]# tail /var/log/messages

Oct 11 17:29:28 localhost systemd: Stopping User Slice of root.

Oct 11 17:29:29 localhost systemd: serial-getty@ttyS0.service holdoff time over, scheduling restart.

Oct 11 17:29:29 localhost systemd: Started Serial Getty on ttyS0.

Oct 11 17:29:29 localhost systemd: Starting Serial Getty on ttyS0...

Oct 11 17:29:42 localhost systemd: Created slice User Slice of root.

Oct 11 17:29:42 localhost systemd: Starting User Slice of root.

Oct 11 17:29:42 localhost systemd: Started Session 2 of user root.

Oct 11 17:29:42 localhost systemd-logind: New session 2 of user root.

Oct 11 17:29:42 localhost systemd: Starting Session 2 of user root.

Oct 11 17:30:01 localhost kernel: random: crng init done


linux练习(根目录、/dev目录,字符控制台快速切换,硬盘的命名规则)  您阅读本篇文章共花了: 

分享到:

    扫描二维码推送至手机访问。

    版权声明:本文由有云转晴发布,如需转载请注明出处。

    本文链接:https://www.yyzq.cf/?id=16

    标签: Linux
    分享给朋友:

    相关文章

    发表评论

    访客

    ◎欢迎参与讨论,请在这里发表您的看法和观点。