Last update at :2024-05-04,Edit by888u
Source: https://www.linux.com/blog/first-5-commands-when-i-connect-linux-server
After working as a sysadmin/SRE for 5 years, I know what I should do first when I connect to a Linux server. Here's a list of things you need to know about your server so that you can (most of the time) debug it better.
The first minute of connecting to the Linux server
These commands will be very familiar to experienced software engineers, but I realized that this is not the case for a novice who is new to Linux systems, such as the students I teach at Holberton School. That’s why I decided to share the top 5 commands I run first when connecting to a Linux server.
w
history
top
df
netstat
These 5 commands are available in every Linux distribution, so you can use them directly without additional installation steps.
w
There is a lot of useful information listed here. First, you can see the server uptime, which is how long the server has been running. You can then see which users are connected to the server, which is useful when you want to make sure you're not disrupting your colleagues' work. Finally, load average is a great way to show you the health of your server.
history
history can tell you what commands the currently connected user has run previously. You can see a lot of information about what types of tasks the machine has been performing before, what errors may have occurred, and where you can start debugging work.
top
The next thing you want to know is what work the server is currently doing. Using the top command you can see all executing processes, and then sort them by CPU and memory usage, and find the processes taking up resources.
df
The next important resource your server needs to function properly is disk space. Running out of disk space is a very typical problem.
netstat (centos7 if not installed: yum install net-tools)
Computers have become an important part of our world because of their ability to communicate with each other through networks. It is important for you to know what ports your server is listening on, what IP addresses it is, and what processes are using them.
Recommended site search: network server, legendary server rental, app server rental, domain name query official website, US multi-IP station group vps, game high defense server, telecommunications IP address query, domain name registration number query, all-round virtualization Host, registration number,
发表评论