Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the commonly used linux operation commands for linux CVM

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

I believe many inexperienced people do not know what linux commands are commonly used on linux CVM. This article summarizes the causes and solutions of the problem. I hope you can solve this problem through this article.

How do I view the Linux server load?

You can view it by executing the wtop _ top.uptime _ procinfo command, or by visiting the / proc/loadavg file.

How do I view server memory usage?

You can view it by executing free,top (memory can be sorted through shift+m after execution), the vmstat,procinfo command, or by accessing the / proc/meminfo file.

How do I see the amount of memory consumed by a single process?

You can view it by executing the top-p PID,pmap-x PID,ps aux | grep PID command, or by visiting the / proc/$process_id (process's PID) / status file, such as the / proc/7159/status file.

How do I view the services and ports in use?

You can view it by executing the netstat-tunlp,netstat-antup,lsof-i:PORT command.

How do I view server process information?

You can view it by executing the ps auxww | grep PID,ps-ef,lsof-p PID,top-p PID command.

How do I stop the process?

You can stop the process by executing kill-9 PID (PID represents the process number) and the killall program name (for example, killall cron). If you need to stop the zombie process, you need to kill the parent process of the process, and execute the command: kill-9 ppid (ppid is the parent process ID number, which can be found through the ps-o ppid PID command, for example, ps-o ppid 32535).

How do I find zombie processes?

You can view the total number of zombie processes (zombie) by executing the top command, and find information about specific zombie processes by executing ps-ef | grep defunct | grep-v grep.

How do I view the Linux system log?

The system-level log file storage path is / var/log. The commonly used system log is / var/log/messages.

How do I view the server operating system version?

You can view the system version by executing the following command:

Uname-a

Cat / proc/version

Cat / etc/issue

How do I find large files in the file system?

You can find it by performing the following steps:

Execute the df command to view disk partition usage, such as df-m.

Execute the du command to see the size of the specific folder. For example, du-sh. / *, du-h-max-depth=1 | head-10.

Execute the ls command to list the file and file size, such as ls-lSh.

You can also view the file sizes in a specific directory directly through the find command, such as find /-type f-size + 10m-exec ls-lrt {}\.

How do I delete files on a Linux server?

Files can be deleted through the rm command, but files deleted by this command cannot be recovered, so use it with caution. The rm command format is rm (option) (parameter).

Options:

-d: delete the hard connection data of the directory to be deleted directly to 0, and then delete the directory.

-f: force deletion of files or directories.

-I: ask the user before deleting an existing file or directory.

-r or-R: recursive processing that processes all files under the specified directory with subdirectories.

-preserve-root: no recursion is performed on the root directory.

-v: displays the detailed execution of the instruction.

Parameter: file, which specifies the list of files to be deleted. If the parameter contains a directory, add the-r or-R option.

Example:

To delete the file test.txt, please execute rm test.txt.

To delete the directory test, execute rm-r test.

To delete all files and subdirectories under the current directory, execute rm-r *.

Here are some common Linux server performance check commands:

Other commonly used commands and files: free-m _ rec _ r _ r

After reading the above, have you mastered the common linux operation commands of linux CVM? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report