网站搜索

10 个有用的随机 Linux 面试问题和答案


令人有点惊讶的是,这次我们不会提出任何特定主题的面试问题,而是随机主题。这些问题除了增加你的知识之外,肯定会帮助你破解面试。

1. 假设您定期为您所在的公司维护备份。备份以压缩文件格式维护。您需要检查两个月前的日志。如果不解压压缩文件,您会建议什么?
zcat ­f phpshell­2.4.tar.gz
2. 您需要跟踪系统上的事件。你会怎么做?

在终端中运行“syslogd”应用程序会在“/var/log/syslog”位置生成日志文件。 syslogd 应用程序对于 Linux 系统故障排除非常有用。示例日志文件如下所示。

3. 如何限制IP,使受限制的IP不能使用FTP服务器?
阻止 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的区别?
6. 您需要停止您的 X 服务器。当您尝试终止 X 服务器时,您收到一条错误消息,指出您无法退出 X 服务器。你会怎么做?
6.命令‘ping’和‘ping6’有什么区别?
7. 您想要搜索主目录中的所有 *.tar 文件并希望一次性删除所有文件。你会怎么做?
find /home/ ­name '*.tar' | xargs rm ­rf
8.locate和slocate命令有什么区别?
9. 您需要在当前目录下的所有“.txt”文件中搜索字符串“Tecmint”。你会怎么做?
find -­name “*.txt” | xargs grep “Tecmint”
10. 您想向所有连接的用户发送一条消息“服务器正在停机维护”,您会怎么做?
echo please save your work, immediately. The server is going down for Maintenance at 12:30 Pm, sharply. | wall

目前为止就这样了。我很快就会再次来到这里,并发表一篇有趣的文章。在此之前,请继续关注并连接到 Tecmint。不要忘记在下面的评论部分提供您宝贵的反馈。