10 Linux Interview Questions and Answers in different application scenarios

Source: Internet
Author: User

This time, we will not discuss the Linux interview questions for a specific topic, but will randomly choose some. These questions not only extend your Linux knowledge system, but also make you feel overwhelmed during the interview.

1. Assume that regular maintenance and file backup are one of your daily tasks. The backup files are saved as compressed files. Now you need to view a log file backed up two months ago. So how can I view the content of this file without any pressure?

A: run the zcat command.

$ Zcat f phpshe112.4.tar.gz

2. How do I track system events?

A: Use the syslogd daemon. Syslogd is useful in tracking system events and can be saved to log files.
When syslogd is run on the terminal, the log file is saved to the "var/log/syslog" folder. Syslogd is particularly useful for detecting Linux system faults. Displays a log file generated by syslogd.

3. How to restrict an IP address to access the FTP server?

A: You can use tcp_wrapper to blacklist an IP address. First, in the configuration file "/etc/vsftpd. enable the tcp_wrapper parameter in conf, that is, "tcp_wrapper = YES". Then add the IP address to be blacklisted to the file "/etc/host. deny.

Open the "/etc/hosts. deny" file.

$ Vi/etc/hosts. deny

Add the IP address to be blacklisted to the end of the file.

#
# Hosts. deny This file contains access rules which are used
# 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. What is the difference between Telnet and SSH?

A: Telnet and SSH are both communication protocols used for remote control. The difference is that SSH is encrypted and the key needs to be exchanged; Telnet is in plaintext and transmitted is in plaintext. Therefore, SSH is safer than Telnet.

5. When trying to kill the X server process, an error occurs saying that the X server process cannot be exited. So what will you do?

A: Normally, for example, "/etc/init. d/gestation stop" cannot kill the X server process. However, you can press Ctrl + Alt + Back Space to force the X server to restart.

6. What is the difference between command ping and ping6?

A: The two commands have the same effect. The only difference is that ping6 is used for IPv6 IP addresses.

7. How do I search all tar files in the Home folder and delete them all at once?

A: Use the find and rm commands.

$ Find/home name '*. tar' | xargs rm rf

8. What is the difference between the command Locate and slocate?

A: locate can search for all files, while slocate can only search for files with access permissions of the current user.

9. How can I find the string "Tecmint" in all txt files in the current directory "?

A: use the file and grep commands.

$ Find-name "*. txt" | xargs grep "Tecmint"

10. How can I send the "server is about to shut down" message to all login users?

A: Use the wall command.

$ Echo please save your work, immediately. The server is going down for Maintenance at, sharply. | wall

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.