In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains what is most often asked in the Linux interview, the content is clear, interested friends can learn, I believe it will be helpful after reading it.
Preface
If you are going to interview for a position as an Linux system operation and maintenance engineer, the following 10 most common questions must be met, otherwise your interview may be dangerous. These are all relatively basic questions, and we should understand them and not just memorize them.
1. How to check the version of the system kernel
There are two ways:
1) uname-a
Uname this command is used to print system information,-a can print all system information, including the kernel version, such as my version number is 3.10.0-957.21.3.el7.X86_64.
2) cat / proc/version
The following is to add the meaning of each number and letter:
3 indicates the major version number, and the latest one is 5) 10 means the minor version number, and the new features will only change. The general cardinal number indicates the beta version, and the even number indicates the stable version. On March 30, 2020, Linus Torvalds released the latest Linux kernel version 5.60. the number of revisions or patch packs 957 represents the number of compilations. each compilation can optimize or modify the special information used by el7 to express the version for a small number of programs, which is more arbitrary; el stands for enterprise version, pp for beta version, fc for candidate version X86 for 64 bits
2. How to check the current IP address of the system
There are also two ways:
1) ifconfig-a
Ifconfig is a command used to configure network interfaces, and-a displays all current interfaces.
2) ip addr show
3. How to check how much space is left on the disk
This can be viewed mainly with the df-ah command, df is a command used to view file system disk space usage,-a shows all file systems, and-h displays in a human-readable way.
As you can see above, my disk / dev/vda1 has 40G, has used 1.7G, and has 36G of free space.
4. How to manage services in the system
Here others may ask you how to see if 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 the service
Service [servicename] [start | stop | restart]
Reload the service profile (do not restart the service)
Service [servicename] [reload]
For example, I want to check whether the sshd service is enabled.
2) use the systemctl command
Newer systems have adopted systemd,systemctl, 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 the service
Systemctl [start | stop | restart] [servicename]
Reload the service profile (do not restart the service)
Systemctl [reload] [servicename]
5. How to check the size of a directory
You can use the du-sh [directory] command, the command used by du to calculate the file / directory size,-s displays the size of the file or the entire directory, and-h is in a readable format.
For example, above I checked the size of the tmp directory under my home directory, which is 80K altogether.
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 connection, routing table, interface statistics, and so on. The common parameters are as follows:
-a (all) shows all options, and LISTEN correlation is not displayed by default.
-t (tcp) displays only tcp-related options.
-u (udp) displays only udp-related options.
-n refuses to display aliases and can show that all numbers are converted into numbers.
-l lists only the service status in Listen (monitoring).
-p displays the name of the program that established the relevant link
-r displays routing information, routing table
-e displays extended information, such as uid, etc.
-s statistics based on each protocol
-c execute the netstat command at regular intervals.
Now I use the netstat-tulpn command, and I can see that port 22 is listening.
2) use the ss command
There are also a lot of people using the ss command, and ss is generally used to dump socket statistics. It can also display socket statistics of all types, including PACKET, TCP, UDP, DCCP, RAW, Unix fields, and so on. You can use ss-lntpd here.
7. How to check the use of CPU by a process
1) you can use the top command
Top command is a commonly used performance analysis tool under Linux, which can display the resource consumption of each process in the system in real time, similar to the task manager of Windows.
2) use the ps command
Ps aux can display the processes of all users, the most common method is ps aux, and then use a pipe symbol to direct to grep to find a specific process. For example, to view the nginx process, you can use
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 the 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 the
Mount / dev/hda1 / mnt
9. How to check some commands that you are not familiar with
What we are going to test here is to use the man command. If you are not familiar with a Linux command, you can use man, and the system will return a very detailed manual of the command to help you use it.
10. What if you use the man command and still can't find the answer
Baidu, or in the forum, the community to help the god.
Of course, it is far from enough to master the above ten basic questions. Everyone should pay attention to accumulation in their usual work and study; sort out and fully prepare their own experience and important knowledge points before the interview; adjust their mindset during the interview, answer questions calmly, make the logic clear and express clearly. Finally, I wish everyone can find their ideal job.
After reading the above content, do you have a better understanding of what is most frequently asked in the Linux interview? if you want to learn more, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.