Linux Basics Learning - Cloud computing first test questions

First, fill in the blank.

  1. In the Linux system to _______ access equipment.
    file
  2. Linux file system, each file is identified by _______.
    i-node
  3. Permissions for a file is d-rw-r-r--, a numerical value represented by the permission _______ _______ the file attributes.
    644 directory
  4. When you install Linux system hard disk partition, the heart must have two partition types: _______ and ______.
    / Root partition swap swap
  5. Show / etc / passwd file, not to / sbin end / nologin line: ___________________.
    grep -v "/ sbin / nologin $ " / etc / passwd
  6. The / home / stud1 / wang directory do archive compression, file compression wang.tar.gz generate and save this file to the / home directory, to accomplish this task tar command format: _____________________.
    tar -czvf /home/wang.tar.gz / home / sutd1 / wang
  7. For a given document file, in which all the statistics a number of command line string line contains the word "WHU" is: _____________________.
    grep "WHU" file | wc -l
  8. In Linux, there is a process states _____, _____ after the process using the system calls into the dead state.
    6 exit (in Linux2.4.0 version)
  9. Each device file name and number from the master device is described by the device number. Second IDE disk device called _______ thereon corresponding to the third primary partition file name is ________.
    hdb hdb3
    resolved: the IDE interface has two IDE0, the IDE1, two devices connected to each interface, into the Master and Slave, each device reserved primary partition 1-4, the partition should expand from 5 numbered
    slave relationship on the IDE0 second extended partition /dev/hdb6
    IDE0 master of the four primary partitions of the hard disk /dev/hda4
    the master IDE1 second logical partitions/dev/hdc6
IDE interface Connected devices
IDE0 Master(/dev/hda)和Slave(/dev/hdb)
IDE1 Master(/dev/hdc)和Slave(/dev/hdd)
  1. ________ superblock data structure is described, _________ inode data structure is described.
    File system attributes file attributes
  2. _______________ df command completion function, du command completion _______________ function.
    Displays the file system space usage Display files or directories take up disk space capacity
  3. _____ disk quota management software tools can be used, which limit the capacity of most hard-soft quota should ____.
    greater than the quota
  4. In the Linux system, the system used to store the required configuration files and subdirectories of the directory is ______.
    / etc
  5. After a standard input standard output as a command before a command, called _______.
    pipeline
  6. Forced to kill background processes of command is _________.
    kill -9% n
  7. The following explanation field.
    Here Insert Picture DescriptionRecv-Q: ________
    Send-Q: ________
    the Local Accress: ________
    State: ________
    the PID / Program name: ________

    recv-Q: network receiving queue
    Send-Q: the network sending queue 0 /
    the Local the Address: Native Address: Port Number
    State : link state
    PID / Program mane: IP and name process

Second, the choice.

  1. cron background resident program (daemon) to ( D )
    A. responsible file sharing network
    B. print management subsystem
    C. tracing information management system and errors
    schedule daily tasks D. management system
  2. In most Linux distributions, which belongs to the block device (Block Devices)? ( B )
    A. Serial Port
    B. hard
    C. Virtual Terminal
    D. printer

Analysis: Block devices include hard disks, floppy disks, CD-ROM drives, and flash memory.
① The application can randomly access the device data, the program can determine its own position read data
write data ② only in multiples of the block (typically 512B) of

  1. Which of the following Linux command to display the contents of one page? ( C )
    A. PAUSE
    B. CAT
    C. More
    D. grep
  2. How to know how much space you have in the current directory? ( C )
    A. the Use df
    B. the Use du /
    C. the Use du.
    D. the Use df.
  3. How to change file permissions eleven? ( B )
    A. attrib
    B. chmod
    C. Change
    D. File
  4. If you need to find out /etc/my.conf (Iraq belong to which package (package), you can perform ( C )
    A. RPM -q /etc/my.conf
    B. RPM -requires /etc/my.conf
    C. -qf /etc/my.conf RPM
    D. RPM -q | grep /etc/my.conf
  5. Which command is used to change the settings for IDE hard disk? ( C )
    A. hdparam
    B. ideconfig
    C. hdparm
    D. hddparm

Analytical: hdparm read and set parameters IDE or SCSI hard Detailed
-C  detect IDE hard drive power management mode
-g  display parameters disk track, head, and other magnetic domain
-t  reading efficiency assessment hard
-m #  setting multiple hard disk the number of partitions partitioned access

  1. Which of the following command lists all defined tasks once run after a specific time? ( A )
    A. atq
    B. cron
    C. BATCH
    D. AT
  2. As an administrator, you want to decentralization in every new user a directory file .bashrc, then you should place the file in which directory to automatically copy this file to your home directory to the directory when creating new users. ( A )
    A. / etc / skel /
    B. / etc / default /
    C. / etc / Defaults /
    D. /etc/profile.d/

Analysis: User variable settings related files user environment variables
/ etc / skel to store the new user profile
skel skeleton is the acronym meaning bone, framework
/ etc / skel all files in the directory are hidden files
when adding new users, this all files in the directory are automatically copied to the newly added user's home directory
by modifying, adding, file deletion / etc / skel directory, we can provide a unified standard for the newly created user, initialization, user environment
/ etc / profile for each user to set environment information system
when the user first log on when the file is executed, the shell and collect settings from the configuration file directory /etc/profile.d
global (public) configuration, no matter what user login will read the file
/ etc / bashrc for each user running bash shell execute this file
when the bash shell is opened, the file is read
global (public), when the bash execution, no matter how will read this file
~ / .bash_profile personal shell configuration information for
the user's personal shell configuration information when the user logs on and every time you open a new When the shell, the file is read, the document is performed only once, by default, the profile will be configured to read ~ / .bashrc

Here Insert Picture Description

  1. In bash, the role of export orders is: ( C )
    A. In the sub-shell to run commands
    B. You can use the command history in the sub-shell
    C. set the environment variable to other applications
    D. partitions to provide NFS network other systems use
  2. 在使用了shadow口令的系统中,/etc/passwd和/etc/shadow两个文件的权限正确的是(C
    A. -rw-r-----, -r--------
    B. -rw-r–r--, -r–r--r–
    C. -rw-r–r--, -r--------
    D. -rw-r–rw-, -r-----r–
  3. 下面哪个参数可以删除一个用户并同时删除用户的主目录? (C
    A. rmuser -r
    B. deluser -r
    C. userdel -r
    D. usermgr -r
  4. 有一个备份程序mybackup,需要在周一至周五下午1点和晚上8点各运行一次,下面哪条
    crontab的项可以完成这项工作?(B
    A. 0 13,20 ** 1,5 mybackup
    B. 0 13,20 ** 1,2,3,4,5 mybackup
    C. * 13,20 ** 123.4,5 mybackup
    D. 0 13,20 1,5 ** mybackup
  5. 如何从当前系统中卸载一个已装载的文件系统(A
    A. umount
    B. dismount
    C. mount -u
    D. 从/etc/fstab中删除这个文件系统项
  6. 如果你的umask设置为022,缺省的你创建的文件的权限为(D
    A. ----w–w-
    A. -w–w----
    C. r-xr-x—
    D. rw-r–r--

解析: umask
umask=022(默认)
文件权限 = 666-umask 文件默认不能拥有执行权限
目录权限 = 777-umask

如果减得的结果中有执行权限,则需要将其加1
umask=023
666-023=644
777-023=754

  1. 在一条命令中如何查找一个二进制命令Xcofigurator的路径?(D
    A. apropos Xconfigurator
    B. find Xconfigurator
    C. where Xconfigurator
    D. which Xconfigurator
  2. 哪一条命令用来装载所有在/etc/fstab中定义的文件系统?(B
    A. amount
    B. mount-a
    C. fmount
    D. mount-f
  3. 运行一个脚本,用户不需要什么样的权限?(B
    A. read
    B. write
    G. execute
    D. browse on the directory
  4. 在Linux中,如何标识接在IDE0上的save硬盘的第2个扩展分区?(C
    A. /dev/hdb2
    B. /dev/hd1b2
    C. /dev/hdb6
    D. /dev/hd1b6

解析: IDE接口有两个IDE0、IDE1,每个接口连接两个设备,分为Master和Slave,每个设备预留主分区1~4,拓展分区应该从5开始编号
IDE0上的slave硬盘的第2个扩展分区 /dev/hdb6
IDE0的master硬盘的第4个主分区 /dev/hda4
IDE1的master的第2个逻辑分区 /dev/hdc6

IDE接口 连接的设备
IDE0 Master(/dev/hda)和Slave(/dev/hdb)
IDE1 Master(/dev/hdc)和Slave(/dev/hdd)
  1. 在应用程序启动时,如何设置进程的优先级? (B
    A. priority
    B. nice
    C. renice
    D. setpri

解析: nice 设置进程的优先级
详解
nice
nice命令以更改过的优先序来执行程序,范围为 -20 ~ 19(由高到低)

[root@zycentos7 ~]# nice -n -5 sleep 600 &
[4] 36673
[root@zycentos7 ~]# ps axo command,pid,nice|grep sleep
sleep 600                    36673  -5
grep --color=auto sleep      36706   0
  1. 在bash中,在一条命令后加入"1>&2"意味着(C
    A. 标准错误输出重定向到标准输入
    B. 标准输入重定向到标准错误输出
    C. 标准输出重定向到标准错误输出
    D. 标准输出重定向到标准输入
  2. 下面哪 条命令可以把f1.xt复制为f2.txt?(C
    A. cp f1.txt | f2.txt
    B. cat f1.txt| f2.txt
    C. cat f1.txt> f2.txt
    D. copy f1.txt | f2.txt
  3. 显示一个文件最后几行的命令是(B
    A. tac
    B. tail
    C. rear
    D. last
  4. 如何快速切换到用户John的主目录(D
    A. cd @John
    B. cd #John
    C. cd &John
    D. cd ~John

解析: cd 切换目录 cd
cd ~ 切换到当前用户的家目录
cd ~ zhao 切换到用户zhao的家目录

  1. 使用In命令将生成了一个指向文件old的符号链接new,如果你将文件old删除,是否还能够访问文件中的数据?(A
    A. 不可能再访问
    B. 仍然可以访问
    C.能否访问取决于文件的所有者
    D.能否访问取决于文件的权限
  2. 哪个命令用来显示系统中各个分区中inode的使用情况?(A
    A. df -i
    B. df -H
    C. free -b
    D. du -a -c/
  3. 在系统文档中找到关于print这个单词的所有说明?(D
    A. man print
    B. which print
    C. locate print
    D. apropos print

解析: apropos命令在一些特定的包含系统命令的简短描述的数据库文件里查找关键字,然后把结果送到标准输出。如果不知道完成某个特定任务所需要命令的名称,可以使用一个关键字通过 apropos key 搜索关键字并且显示所有包含匹配项的man页面的简短描述 apropos print == man -k print

  1. man 5 passwd含义是?(B
    A. 显示passwd命令的使用方法
    B. 显示passwd文件的结构
    C. 显示passwd命令的说明的前五行
    D. 显示关于passwd的前五处说明文档

解析: man 手册
1 用户指令
2 系统调用
5 文件系统
8 系统指令

  1. 如何在文件中查找显示所有以“*”打头的行? (D
    A. find * file
    B. wc -l < file
    C. grep -n * file
    D. grep ‘^*’ file
  2. 在ps命令中什么参数是用来显示所有用户的进程的?(A
    A. a
    B. b
    C. u
    D. x
  3. 显示二进制文件的命令是?(A
    A. od
    B. vil
    C. view
    D. binview
  4. 如何显示Linux系统中注册的用户数(包含系统用户) ?(D
    A. account -l
    B. nl /etc/passwd |head
    C. wc --users /etc/passwd
    D. wc --lines /etc/passwd
  5. 在行结束位置加上什么符号, 表示未结束,下一行继续?(B
    A./
    B.
    C. ;
    D.|
  6. 命令kill9的含义是(D
    A. klls the process whose PID is 9.
    B. kills all processes belonging to UID 9.
    C. sends SIGKILL to the process whose PID is 9.
    D. sends SIGTERM to the process whose PID IS 9.

解析: kill 9和kill -9 的区别
kill 9 表示系统给PID为9的程序发送SIGTERM,当程序收到信号时,程序有可能出现以下的情况:①程序程序立刻停止 ②当程序释放相应资源后再停止 ③程序可能仍然继续运行
kill -9 表示系统给某个程序发送SIGKILL,当程序收到信号时必被杀死,如果要杀死PID为9的程序应该是 kill -9 9

  1. 如何删除一个非空子目录/tmp?(B
    A. del /tmp/*
    B. rm -rf /tmp
    C. rm -Ra /tmp/*
    D. rm -rf /tmp/*
  2. Linux系统中,一般把命令Is定义为ls–color 的别名,以便以不同颜色来标识不同类型,但是,如何能够使用原先的ls命令?(A
    A. \Is
    B. ;ls
    C. ls$$
    D. ls --noalias
  3. 在哪个文件中定义网卡的I/O地址?(C
    A. cat /proc/modules
    B. cat /proc/devices
    C. cat /proc/ioports
    D. cat /io/dma
  4. Linux中,提供TCP/IP包过滤功能的软件叫什么?(C
    A. rarp
    B. route
    C. iptables
    D. filter
  5. 在vi中退出不保存的命令是?(D
    A. :q
    B. :w
    C. :wq
    D. :q!
  6. 使用什么命令检测基本网络连接?(A
    A. ping
    B. route
    C. netstat
    D. ifconfig
  7. 下面哪个文件系统应该分配最大的空间?(A
    A. /usr
    B. /lib
    C. /root
    D. /bin
  8. 什么命令用来只更新已经安装过的rpm软件包? (B
    A. rpm -U *.rpm
    B. rpm -F *.rpm
    C. rpm -e *.rpm
    D. rpm -q *.rpm
  9. 下面哪个命令可以压缩部分文件:(C
    A. tar -dzvf filename.tgz *
    B. tar -tzvf filename.tgz *
    C. tar -czvf filename.tgz *
    D. tar -xzvf filename.tgz *
    的文件。
  10. 在bash shell环境下,当一条命令正在执行时,按下control-Z会(C
    A.中止前台任务
    B.给当前文件加上EOF.
    C.将前台任务转入后台
    D.注销当前用户
  11. 定义bash环境的用户文件是:(D
    A. bash & .bashrc
    B. bashrc & .bashconf
    C. bashrc & bashprofile
    D. .bashrc & .bash_profile
  12. 如何查看个RPM软件的修改记录? (D
    A. rpm -Vc postfix
    B. rpm -qpil postfix
    C. rpm -changelog postfix
    D. rpm -q --changelog postfix
  13. 什么命令解压缩tar文件?(B
    A. tar -czvf filename.tgz
    B. tar -xzvf filename.tgz
    C. tar -tzvf filename.tgz
    D. tar -dzvf filename.tgz
  14. ping使用的协议是(D
    A. TCP
    B. UDP
    C. SMB
    D. ICMP
  15. 下面哪个命令不是用来查看网络故障的?(B
    A. ping
    B. init
    C. telnet
    D. netstat
  16. 下面哪个文件定义了网络服务的端口?(B
    A. /etc/netport
    B. /etc/services
    C. /etc/server
    D. /etc/netconf
  17. 下面哪个命令可以查看网卡的中断?(B
    A. cat /proc/ioports
    B. cat /proc/interrupts
    C. cat /proc/memoryinfo
    D. which interrupts

三、解答题

  1. 什么是链接?符号链接与硬链接的区别是什么?
    链接是指用一个i节点对应多个文件名。
    硬链接是把文件的i节点号指向该i节点,且链接计数器值加1。删除链接文件时计数器值减1,当其值为0时,i节点被释放。
    符号链接是只有文件名的一个链接文件,并不指向一个真正的i节点。在删除符号链接文件时与硬链接文件有区别。
  2. 在UNIX/Linux系统中,环境变量是非常重要,在字符界面下试说明:
    (1) PATH变量的作用,如何得到PATH的值?
    PATH为命令搜索路径,可用echo $PATH命令显示
    (2)在UNIX/Linux系统的超级用户的环境变量PATH中允许包含当前目录吗?
    不允许
    (3)若在超级用户的当前目录内有可执行文件mypro,如何执行它(写出执行时键盘输入内容)?
    ./ mypro
    (4)如何使用该命令在后台执行(写出执行时键盘输入内容)?
    ./mypro &
  3. 叙述Linux如何实现开机自动挂载、机使用Windows系统硬盘(设备名为/dev/hda3, 分区类型为fat32) 上的文件,windows硬盘。写出详细的步骤。
    (1) 用fdisk -l /dev/had 命令查看硬盘分区中情况及文件系统情况,决定要挂装Windows分区
    (2) 建立挂装目录 mkdir /mnt/dos
    (3) 挂装Windows系统 mount –tvfat /dev/had/ /mnt/dos
    (4) 浏览Windows文件系统 ls /mnt/dos
    (5) 卸载:umount /mnt/dos
    (6) 打开/etc/fstab 添加一行
    /dev/hda3 /mnt/hd vfat defaults 0 0
  4. 简述源码安装步骤,配置一个简单的yum仓库,本地安装包地址/media
    ①获取源码
    ②将软件的源码下载至/usr/local/,并解压
    查看INSTALL与README文件;
    解压后查看INSTALL与README文件,这两个文件中详细介绍了本软件的安装方法和注意事项。
    ③创建Makefile文件
    执行configure命令,生成Makefile文件。
    ④编译
    执行make clean;make命令将源码编译成二进制文件。
    make clean命令用来清除上一次编译生成的目标文件。这个步骤可有可无,但为了确保编译的成功,还是加上为好。防止由于软件中含有残留的目标文件导致编译失败。
    ⑤安装
    执行make install命令将上一步编译好的二进制文件安装到指定的目录中去
    配置本地源
    vim C7.repo
    内容如下:
    [C7]
    name=C7
    baseurl=file://media
    enable=1
    gpgcheck=0
  5. 按要求写出以下命令。

(1) Find / app / the last seven days of general access logs directory and delete files.
Find / App / F -type logs -ctime -7 RM -exec {};
(2) Find / etc directory greater than 1M and common files for all types of files.
Find / etc / 1M + -type -size F
(. 3) to /data/20191123.tar.gz file to obtain scp manner is transmitted to the user test / data 192.168.1.182 directory services, time stamp and file permissions are not change.
-p /data/20191123.tar.gz [email protected] SCP: / Data
(. 4) Copy / etc / fstab file to / var / tmp, file owner to set tomcat access rights, shared by a group group apps have write access to others without permission.
CP / etc / fstab / var / tmp
chown tomcat.apps / var / tmp / fstab
the chmod 660. / var / tmp / fstab

(. 5) and down three rows grep filter file or files have root ROOT row, and displays an exact match No travel.
grep -C 3 -w -n -i "root " / etc / passwd

Published 43 original articles · won praise 30 · views 5914

Guess you like

Origin blog.csdn.net/qq_42049496/article/details/103937539