done translating by ThomazLgit add --all

This commit is contained in:
ThomazL 2014-02-25 21:03:41 +08:00
parent 71423203f3
commit c88a61d3b5
2 changed files with 90 additions and 90 deletions

View File

@ -1,90 +0,0 @@
>>Translating by ThomazL
10 Useful Random Linux Interview Questions and Answers
================================================================================
To a little surprise this time we are not presenting Interview question on any specific subject but on random topics. These question will surely help you in cracking Interviews beside adding to your Knowledge.
![](http://www.tecmint.com/wp-content/uploads/2014/02/Random-Interview-Questions.png)
1. Lets say you maintains a backup on regular basis for the company you are working. The backups are maintained in Compressed file format. You need to examine a log, two months old. What would you suggest without decompressing the compressed file?
> **Answer** : To check the contents of a compressed file without the need of decompressing it, we need to use zcat. The zcat utility makes it possible to view the contents of a compressed file.
# zcat ­f phpshell­2.4.tar.gz
2. You need to track events on your system. What will you do?
> **Answer** : For tracking the events on the system, we need a daemon called syslogd. The syslogd daemon is useful in tracking the information of system and then saving it to specified log files.
Running **syslogd** application in terminal generates log file at the location /var/log/syslog. The syslogd application is very useful in troubleshooting Linux sytems. A sample log file looks similar to below.
![syslongd](http://www.tecmint.com/wp-content/uploads/2014/02/syslongd.jpg)
3. How will you restrict IP so that the restricted IPs may not use the FTP Server?
> **Answer** : We can block suspicious IP by integrating tcp_wrapper. We need to enable the parameter “tcp_wrapper=YES” in the configuration file at /etc/vsftpd.conf. And then add the suspicious IP in the host.deny file at location /etc/host.deny.
#### Block IP Address ####
Open /etc/hosts.deny file.
# vi /etc/hosts.deny
Add the IP address that you want to block at the bottom of the file.
#
# hosts.deny This file contains access rules which are used to
# deny connections to network services that either use
# the tcp_wrappers library or that have been
# started through a tcp_wrappers-enabled xinetd.
#
# The rules in this file can also be set up in
# /etc/hosts.allow with a 'deny' option instead.
#
# See 'man 5 hosts_options' and 'man 5 hosts_access'
# for information on rule syntax.
# See 'man tcpd' for information on tcp_wrappers
#
vsftpd:172.16.16.1
4. Tell us the difference between Telnet and SSH?
> **Answer** : Telnet and SSH both are communication protocol which are used to manage remote system. SSH is Secured, which requires exchanging of key opposite of telnet which transmit data in plain text, which means telnet is less secure than SSH.
5. You need to stop your X server. When you tries to kill your X server, You got an error message that you cannot quit X server. What will you do?
> **Answer** : When killing a X server, it wont work normal way like doing /etc/init.d/gdm stop. We need to execute a special key combination Ctrl+ Alt+ Back Space which will force X server to restart.
6. What is the difference between command ping and ping6?
> **Answer** : Both the commands are same and used for the same purpose except that the fact that ping6 is used with ipv6 IP address.
7. You want to search for all the *.tar files in your Home directory and wants to delete all at once. How will you do it?
> **Answer** : We need to use find command with rm command to delete all “.tar” files.
# find /home/ ­name '*.tar' | xargs rm ­rf
8. What is the difference between locate and slocate command?
> **Answer** : The slocate looks for the files that user have access whereas locate will search for the file with updated result.
9. You need to search for the string “Tecmint” in all the “.txt” files in the current directory. How will you do it?
> **Answer** : We need to run the fine command to search for the text “Tecmint” in the current directory, recursively.
# find ­name “*.txt” | xargs grep “Tecmint”
10. You want to send a message to all connected users as “Server is going down for maintenance”, what will you do?
> **Answer** : This can be achieved using the wall command. The wall command sends a message to all connected users on the sever.
# echo please save your work, immediately. The server is going down for Maintenance at 12:30 Pm, sharply. | wall
![wall command](http://www.tecmint.com/wp-content/uploads/2014/02/wall.jpg)
--------------------------------------------------------------------------------
via: http://www.tecmint.com/useful-random-linux-interview-questions-and-answers/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,90 @@
10个在随机出现在面试中的Linux问题及答案
=========================================
为了给你们带来一些小惊喜,这次我们准备了一些在面试中随机出现的问题而不是专门关于某个领域的问题。这些问题肯定会在不深入学习新知识的前提下使你在面试中脱颖而出。
![](http://www.tecmint.com/wp-content/uploads/2014/02/Random-Interview-Questions.png)
1.假设你在为你工作的公司维护一份日常的备份。这份备份是以压缩后的格式而被维护着。现在你需要检查一份两个月之前的日志,你应该提出什么样的建议从而可以在不解压这份备份的前提下完成检查日志的任务?
> **答案** 在不解压文件的前提下检查文件内容,我们需要用到'zcat'。zcat这个工具可以轻松完成这个任务。
# zcat ­f phpshell­2.4.tar.gz
2.你需要追踪你系统中发生的事件,你应该怎么做?
> **答案** 为了追踪系统中发生的事件我们需要用到叫做syslogd的这个后台程序。syslogd这个后台程序可以追踪系统信息并将其保存到指定的日志文件中。
在命令行运行'syslogd'这个应用会在路径'/var/log/syslog'中生成一个日志文件。syslogd应用对解决Linux系统中的问题十分有用。标准生成的日志文件和下面这个例子很像。
![syslongd](http://www.tecmint.com/wp-content/uploads/2014/02/syslongd.jpg)
3.如何禁止特定IP访问FTP服务器
> **答案** 我们可以通过运用tcp_wrapper来禁止可疑的IP访问。首先在路径'/etc/vsftpd.conf'的配置文件中将tcp_wrapper这个参数设置为"tcp_wrapper=YES",然后在'/etc/host.deny'文件中加入可疑的IP地址。
###禁止访问的IP地址###
打开'/etc/hosts.deny'文件。
# vi /etc/hosts.deny
在文件底端加入拒绝访问的IP地址
#
# hosts.deny This file contains access rules which are used to
# deny connections to network services that either use
# the tcp_wrappers library or that have been
# started through a tcp_wrappers-enabled xinetd.
#
# The rules in this file can also be set up in
# /etc/hosts.allow with a 'deny' option instead.
#
# See 'man 5 hosts_options' and 'man 5 hosts_access'
# for information on rule syntax.
# See 'man tcpd' for information on tcp_wrappers
#
vsftpd:172.16.16.1
4.告诉我们Telnet和SSH之间的区别
> **答案** Telnet和SSH都是用来远程管理系统的协议。与Telnet直接传输数据正好相反安全的SSH通信协议需要通信中有密钥的交换这说明telnet相比较于SSH更加不安全。
5.你需要终止你的X server但当你尝试杀进程的时候你遇到了表示不能退出X server的错误信息。你准备怎么做
> **答案** 当你尝试杀X server的进程时系统不会让你像使用'/etc/init.d/gdm stop'一样正常的退出X server。我们需要执行一个使X server重启的特别的键位组合'Ctrl+ Alt+ Back Space'。
6.告诉我命令'ping'和'ping6'的区别?
> **答案** 这两个命令有同样的功能,但'ping6'命令可被用于ipv6的IP地址。
7.你想要在Home目录下寻找*.tar文件并一次性删除你会怎么做
> **答案** 我们要同时用到find和rm命令来删除所有*.tar文件
# find /home/ ­name '*.tar' | xargs rm ­rf
8.locate和slocate命令的区别
> **答案** slocate(secure locate)会寻找所有用户有权限访问的文件然而locate会搜索所有更新过的结果。
9.你要在当前目录中所有“.txt”文件中搜索“Tecmint”这个字符串你怎么做
> **答案** 用find命令在当前目录递归寻找文件中的“Tecmint”字符串。
# find ­name “*.txt” | xargs grep “Tecmint”
10.你要向所有已连接的用户发送“Server is going down for maintenance”这样一条信息你怎么做
> **答案** 运用wall命令就可以很容易地实现wall命令可以向所有已连接服务器的用户发送信息。
# echo please save your work, immediately. The server is going down for Maintenance at 12:30 Pm, sharply. | wall
![wall command](http://www.tecmint.com/wp-content/uploads/2014/02/wall.jpg)
--------------------------------------------------------------------------------
via: http://www.tecmint.com/useful-random-linux-interview-questions-and-answers/
译者ThomazL(https://github.com/ThomazL) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出