Preface If you are going to interview for a Linux system operation and maintenance engineer position, you must be able to answer the following ten most common questions, otherwise your interview may be in danger. These are relatively basic questions, and everyone needs to understand them instead of just memorizing them. 1. How to check the system kernel version There are two ways to do this: 1) uname -a The uname command is used to print system information. -a can print all system information, including the kernel version. For example, my version number is 3.10.0-957.21.3.el7.X86_64. 2) cat /proc/version Here are some additional information on the meanings of the numbers and letters:
2. How to view the current IP address of the system There are also two methods: 1) ifconfig -a ifconfig is a command used to configure network interfaces. -a can display all current interfaces. 2) ip addr show 3. How to check how much free space is left on the disk Here you can mainly use the df -ah command to view it. df is a command used to view the disk space usage of the file system. -a displays all file systems, and -h displays them in a human-readable format. As you can see above, my disk /dev/vda1 has 40 GB, 1.7 GB has been used, and there is 36 GB of free space. 4. How to manage services in the system Here someone may ask you how to check whether a service is running, how to start, stop, or reload the configuration file. There are also two answers here. 1) Use the service command View service status service [servicename] status Start/Stop/Restart Services service [servicename] [start|stop|restart] Reload the service configuration file (without restarting the service) service [servicename] [reload] For example, I want to check whether the sshd service is enabled. 2) Use systemctl command Newer systems have already adopted systemd. systemctl is a tool of systemd, which is mainly responsible for controlling the systemd system and service manager. View service status systemctl status [servicename] Start/Stop/Restart Services systemctl [start|stop|restart] [servicename] Reload the service configuration file (without restarting the service) systemctl [reload] [servicename] 5. How to view the size of a directory You can use du -sh [directory] command, du is used to calculate the file/directory size command, -s displays the size of the file or the entire directory, -h is in readable format. For example, I checked the size of the tmp directory in my home directory above, and it is 80K in total. 6. How to check the open port numbers in your system 1) Use the netstat command The netstat command is used to display network status, including network connections, routing tables, interface statistics, and other information. Commonly used parameters are as follows: -a (all) displays all options. By default, LISTEN-related options are not displayed. -t (tcp) Display only tcp related options. -u (udp) Display only udp related options. -n refuses to display aliases and converts all displayed numbers into numbers. -l only lists the services in Listen state. -p Display the name of the program that creates the relevant link -r Display routing information, routing table -e Display extended information, such as uid, etc. -s Statistics by protocol -c Execute the netstat command at a fixed time interval. Below I used the netstat -tulpn command and can see that port 22 is being listened on. 2) Use the ss command Many people now use the ss command, which is generally used to dump socket statistics. It can also display all types of socket statistics, including PACKET, TCP, UDP, DCCP, RAW, Unix domain, etc. Here you can use ss -lntpd 7. How to view the CPU usage of a process 1) You can use the top command The top command is a commonly used performance analysis tool under Linux. It can display the resource usage of each process in the system in real time, similar to the Windows Task Manager. 2) Use the ps command ps aux can display the processes of all users. The most common method is to use ps aux, and then use a pipe symbol to direct to grep to find a specific process. For example, you can use the following command to view the nginx process: ps aux | grep nginx 8. How to mount in Linux The main test here is the mount command, which is used to mount files outside the Linux system. Just enter the mount command to view all files that have been mounted on the system. If you want to mount a new file, such as /dev/hda1 under /mnt, you can use mount /dev/hda1 /mnt 9. How to view some commands you are not familiar with What we want to test you here is the use of man command. If you are not familiar with a Linux command, you can use man <command> and the system will return a very detailed manual for the command to help you use it. 10. What if you still can’t find the answer after using the man command? Baidu, or seek help from experts in forums and communities... Of course, mastering only the above ten basic questions is far from enough. Everyone should focus on accumulation in daily work and study; sort out and fully prepare their own experiences and important knowledge points before the interview; adjust their mentality during the interview, answer questions calmly, with clear logic and clear expression. Finally, I wish everyone can find their ideal job. Summarize This concludes this article about the 10 most frequently asked questions in Linux interviews. For more information about the most frequently asked questions in Linux interviews, please search 123WORDPRESS.COM’s previous articles or continue browsing the related articles below. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: JavaScript Canvas implements Tic-Tac-Toe game
>>: MySQL database optimization: index implementation principle and usage analysis
Table of contents 1. Introduction to NFS 2. NFS C...
Query the current date SELECT CURRENT_DATE(); SEL...
This question originated from a message on Nugget...
1. First enter the server's mysql to modify p...
Table of contents 1. Introduction 2. Initial Vue ...
Let me show you the effect picture first. Persona...
Use Docker to build a flexible online PHP environ...
What you learn from books is always shallow, and ...
This article shares the specific code of the WeCh...
Method 1: INSERT INTO t1(field1,field2) VALUE(v00...
This article example shares the specific code of ...
The difference between := and = = Only when setti...
Docker is a management tool that uses processes a...
<br />When we design web pages, we always en...
Download and install JDK Step 1: First download t...