mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
commit
30e0c674a5
@ -1,70 +0,0 @@
|
||||
[su-kaiyao]翻译中
|
||||
|
||||
10 Useful Interview Questions and Answers on Linux Commands
|
||||
================================================================================
|
||||
Linux command Line and the interaction of users with Linux Shell with Linux Commands is the most wonderful part of Linux and is one of the most widely topic from interview point. Here in this article we are coming up with 10 wonderful questions that are important from the interview perspective and will surely add to yours knowledge base.
|
||||
|
||||
![Linux Command Questions](http://www.tecmint.com/wp-content/uploads/2014/07/Linux-Command-Questions.png)
|
||||
Linux Command Questions
|
||||
|
||||
### 1. How will you suspend a running process and put it in the background? ###
|
||||
|
||||
**Answer** : In order to suspend a running process/job and put it in the background we need to use the key combination Ctrl+z.
|
||||
|
||||
### 2. What are the minimum number of partitions required to install Linux and How will you check boot messages? ###
|
||||
|
||||
**Answer** : The /root partition alone is sufficient to perform the whole task however minimum three partitions are recommended to install Linux. These are root, boot and swap. An IDE Hard Disk Drive supports upto 63 partitions and SCSI Hard Disk Drive supports up-to 15 partitions.
|
||||
|
||||
In order to check boot messages we need to use cat or dmesg commands as shown below.
|
||||
|
||||
# cat /var/log/messages
|
||||
|
||||
OR
|
||||
|
||||
# dmesg
|
||||
|
||||
### 3. Name the Daemon responsible for tracking System Event on your Linux box? ###
|
||||
|
||||
**Answer** : The Daemon ‘syslogd’ is responsible for tracking system information and stores the tracked logs in specific log files.
|
||||
|
||||
### 4. What are the minimum requirements to run command ‘fsck’ on root partition? ###
|
||||
|
||||
**Answer** : The /root partition must be mounted as read only mode and not read-write to execute fsck command on root partition.
|
||||
|
||||
### 5. How to copy /home directory hierarchically to another directory. How will you do it? ###
|
||||
|
||||
**Answer** : A Linux command ‘cpio’ comes to rescue here. The ‘cpio’ utility copies files and directories hierarchically over another location.
|
||||
|
||||
### 6. How will you automate the rotation of logs in Linux? ###
|
||||
|
||||
**Answer** : A Linux command ‘logrotate’ comes to rescue when it comes to automate the logs in Linux.
|
||||
|
||||
### 7. How to know who has scheduled the job? ###
|
||||
|
||||
**Answer** : The Linux command ‘at’ along with switch ‘-l’ is all we need to use in order to check who has scheduled the job.
|
||||
|
||||
### 8. How to view the contents of the tar ball without extracting it. How will you do this? ###
|
||||
|
||||
**Answer** : We need to use command ‘tar’ with options ‘-tvf’. The options ‘t’ (Display the contents), ‘v’ (Verbose), ‘f’ (files).
|
||||
|
||||
### 9. What is page Fault and how it happens? ###
|
||||
|
||||
**Answer** : A program request for some data and if it is not available in the Memory it is called as page fault. Page Fault occurs as a result of program shutdown.
|
||||
|
||||
### 10. What are return codes in program? ###
|
||||
|
||||
**Answer** : A return code is the feature of Shell. The result of return code shows the status of a program. A successful program after execution returns ’0′, && can be used to prioritize which application will be executing first.
|
||||
|
||||
That’s all for now. I’ll be here again with another interesting article soon. Till then stay tuned and connected to Tecmint. Don’t forget to provide us with your valuable feedback in the comment section below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/10-useful-interview-questions-and-answers-on-linux-commands/
|
||||
|
||||
原文作者:[Avishek Kumar][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/avishek/
|
@ -0,0 +1,68 @@
|
||||
关于Linux命令的10个有用的面试问题及其答案
|
||||
==================================================================================================================================================
|
||||
Linux命令行,以及用户使用Linux命令进行Linux shell交互,是Linux最吸引人的地方,也是面试中最普遍的话题之一。在这篇文章中,我们将提出10个面试中很重要问题,这肯定能拓宽你的知识面
|
||||
|
||||
![Linux Command Questions](http://www.tecmint.com/wp-content/uploads/2014/07/Linux-Command-Questions.png) Linux Command Questions
|
||||
|
||||
### 1. 如何停止一个正在运行的进程 ###
|
||||
|
||||
**答案**:为了停止正在运行的进程,我们可以使用组合键 Ctrl+Z
|
||||
|
||||
### 2. 什么是安装Linux所需的最小分区数量,以及如何查看系统启动信息? ###
|
||||
|
||||
**答案**:单独一个/root分区足以执行所有的系统任务,但是强烈建议安装Linux时,需要至少三个分区:/root,/boot,/swap。一个IDE硬盘驱动器支持高达63个分区,SCSI硬盘驱动器支持超过15个分区
|
||||
|
||||
为了检查启动信息,我们可以使用cat或者dmesg命令,如下所示:
|
||||
|
||||
#cat /var/log/messages
|
||||
|
||||
OR
|
||||
|
||||
#dmesg
|
||||
|
||||
### 3. 在你的Linux机器上更踪系统事件的守护进程名是什么?###
|
||||
|
||||
**答案**:'syslogd',它负责更踪系统信息,并将更踪日志存储在特定的日志文件里
|
||||
|
||||
### 4. 在/root分区运行'fsck'命令的最低要求是什么?###
|
||||
|
||||
**答案**:/root分区必须挂载为只读模式,而不是读写模式
|
||||
|
||||
### 5. 如何分层复制/home目录到另一个目录,你有什么办法?###
|
||||
|
||||
**答案**:Linux的'cpio'命令起到了效果。'cpio'可以分层地复制文件和目录层次结构到另一个位置
|
||||
|
||||
### 6. 在Linux中,怎样实现日志文件的自动替换?###
|
||||
|
||||
**答案**:'logrotate'提供日志自动替换功能
|
||||
|
||||
### 7. 你知道Linux中是谁在安排工作吗?###
|
||||
|
||||
**答案**:使用'at'命令加上'-l'选项,就可以查出
|
||||
|
||||
### 8. 如何在不解压tar包的前提下,查看包里的内容 ###
|
||||
|
||||
**答案**:使用'tar -tvf'。选项‘t’(显示内容),‘v’(详细报告tar处理的文件信息),‘f’(使用档案文件或者设备)
|
||||
|
||||
### 9. 什么是页面错误,它是怎么发生的?###
|
||||
|
||||
**答案**:当一个程序请求内存中不存在的数据时,就会产生页面错误,导致的结果就是程序停止
|
||||
|
||||
### 10. 什么叫在程序中返回代码?###
|
||||
|
||||
**答案**:返回代码是shell的特性。返回代码显示了程序的状态,一个成功的程序执行后返回‘0’,&&可以用来决定那个应用程序先执行
|
||||
|
||||
好了,文章要结束了。不久以后,我还会在这分享其余有趣文章的,记得和我们保持联系。还有,别忘了在评论栏里面向我们提供您的宝贵意见
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/10-useful-interview-questions-and-answers-on-linux-commands/
|
||||
|
||||
原文作者:[Avishek Kumar][a]
|
||||
|
||||
译者:[su-kaiyao](https://github.com/su-kaiyao) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/avishek/
|
||||
|
Loading…
Reference in New Issue
Block a user