{"id":159217,"date":"2023-05-10T13:38:22","date_gmt":"2023-05-10T13:38:22","guid":{"rendered":"https:\/\/ded9.com\/?p=159217"},"modified":"2025-12-15T12:45:08","modified_gmt":"2025-12-15T12:45:08","slug":"10-linux-function-commands","status":"publish","type":"post","link":"https:\/\/ded9.com\/de\/10-linux-function-commands\/","title":{"rendered":"10 Essential Linux Function Commands Every User Should Know"},"content":{"rendered":"<p>We introduce you to 10 Linux performance commands that every system administrator should know. With these tools at your disposal, you&#8217;ll be well-equipped to tackle any performance-related challenges that come your way.<\/p>\n<p><a href=\"https:\/\/ded9.com\/what-is-the-difference-between-windows-and-linux-server\/\">Linux<\/a> system administrators need robust tools to monitor and optimize their systems effectively. A deep understanding of function commands can help you quickly identify and resolve problems and ensure smooth operation. In this article, we look at the top 10 Linux performance commands for system administrators and provide an overview of each command&#8217;s functionality and uses.<\/p>\n<p>As a system administrator, over the years, I&#8217;ve compiled a list of my top 10 Linux performance commands I use daily. In this blog post, I&#8217;ll share my favorites and explain why they&#8217;re essential. So, without further ado, let&#8217;s dive in!<\/p>\n<h2><span id=\"top\">top<\/span><\/h2>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-159218 size-full\" src=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/1-768x511-1.webp\" alt=\"The &quot;above&quot; command is my favorite; I'm sure many of you will agree. It provides a live and dynamic view of system processes, memory usage, and CPU load. Frankly, I love the simplicity and ease of identifying resource-hungry processes.\" width=\"768\" height=\"511\" srcset=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/1-768x511-1.webp 768w, https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/1-768x511-1-300x200.webp 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>The &#8220;above&#8221; command is my favorite; I&#8217;m sure many of you will agree. It provides a live and dynamic view of system processes, memory usage, and CPU load. Frankly, I love the simplicity and ease of identifying resource-hungry processes.<\/p>\n<p>Although some people prefer &#8220;htop&#8221; for its colorized output and extra features, I&#8217;m a big fan of the classic &#8220;top&#8221; command.<\/p>\n<h2><span id=\"iostat\">iostat<\/span><\/h2>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-159221 size-full\" src=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/2-768x446-1.webp\" alt=\"10 Linux Performance Commands Continued. I have always considered disk performance an essential aspect of system performance. This is where iostat comes in. It's great for monitoring disk I\/O and helps me identify potential bottlenecks.\" width=\"768\" height=\"446\" srcset=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/2-768x446-1.webp 768w, https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/2-768x446-1-300x174.webp 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>10 Linux Performance Commands Continued. I have always considered disk performance an essential aspect of system performance. This is where iostat comes in. It&#8217;s great for monitoring disk I\/O and helps me identify potential bottlenecks.<\/p>\n<p>The &#8216;iostat&#8217; command is part of the &#8216;sysstat&#8217; package, which is not always pre-installed on Linux distributions. Here&#8217;s how to install sysstat on some popular Linux distributions:<\/p>\n<p>Debian and Ubuntu:<\/p>\n<p>To install sysstat on Debian and Ubuntu, open a terminal and run the following command:<\/p>\n<p><code>sudo apt-get install sysstat<\/code><\/p>\n<p>Red Hat, CentOS, and Fedora:<\/p>\n<p>To install sysstat on Red Hat-based systems, open a terminal and run the following command:<\/p>\n<p><code>sudo yum install system<\/code><\/p>\n<p>Arch Linux:<\/p>\n<p>To install sysstat on Arch Linux, open a terminal and run the following command:<\/p>\n<p><code>sudo pacman -S sysstat<\/code><\/p>\n<p>SUSE and openSUSE:<\/p>\n<p>To install sysstat on SUSE and openSUSE, open a terminal and run the following command:<\/p>\n<p><code>sudo zypper install system<\/code><\/p>\n<p>After installing sysstat, you can use the iostat command to monitor disk I\/O statistics. If you need higher privileges to run the command, use &#8216;sudo&#8217; or switch to the root user. However, I wish the default output were a bit more user-friendly. But hey, it gets the job done, and that&#8217;s what counts.<\/p>\n<p>The following command displays disk I\/O statistics for all devices every 5 seconds. It helps you monitor disk performance and identify bottlenecks.<\/p>\n<h2><span id=\"vmstat\">vmstat<\/span><\/h2>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-159225 size-full\" src=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/3-768x347-1.webp\" alt=\"VMstat is another command that I rely heavily on. It reports virtual memory statistics, which help me understand how the system uses memory and swap space. I find it especially useful when dealing with memory-intensive applications.\" width=\"768\" height=\"347\" srcset=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/3-768x347-1.webp 768w, https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/3-768x347-1-300x136.webp 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>VMstat is another command that I rely heavily on. It reports virtual memory statistics, which help me understand how the system uses memory and swap space. I find it especially useful when dealing with memory-intensive applications.<\/p>\n<p>The only thing I&#8217;m not a fan of is the somewhat cryptic output. But once you get the hang of it, it&#8217;s a powerful tool. Use the following command to display virtual memory statistics every 3 seconds. This helps you understand how the system uses memory and swap space, which is useful when working with memory-intensive applications.<\/p>\n<p><code>vmstat 3<\/code><\/p>\n<h2><span id=\"free\">free<\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-159228 size-full\" src=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/3-768x347-2.webp\" alt=\"The &quot;free&quot; command is great for a quick overview of system memory usage. It's simple, easy to read, and straight to the point. I like to use it to check if my servers have enough free memory.\" width=\"768\" height=\"347\" srcset=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/3-768x347-2.webp 768w, https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/3-768x347-2-300x136.webp 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>The &#8220;free&#8221; command is great for a quick overview of system memory usage. It&#8217;s simple, easy to read, and straight to the point. I like to use it to check if my servers have enough free memory.<\/p>\n<p>My only issue with &#8220;Free&#8221; is the lack of customization options, but given its purpose, that&#8217;s a minor issue. Use the following command to display memory usage in a human-readable format. It gives you an overview of total, used, and available memory and swap space.<\/p>\n<h2><span id=\"sar\">sar<\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-159231 size-full\" src=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/5-768x256-1.webp\" alt=\"Sar is the Swiss Army knife of performance monitoring. It can provide information on almost every aspect of system performance, from CPU usage to network activity. I appreciate its versatility and historical data collection, allowing me to analyze trends and identify past issues.\" width=\"768\" height=\"256\" srcset=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/5-768x256-1.webp 768w, https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/5-768x256-1-300x100.webp 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>Sar is the Swiss Army knife of performance monitoring. It can provide information on almost every aspect of system performance, from CPU usage to network activity. I appreciate its versatility and historical data collection, allowing me to analyze trends and identify past issues.<\/p>\n<p>On the downside, the sheer number of options can be overwhelming. It&#8217;s a powerful tool, but it takes patience to master. Use the following command to display the average CPU usage for the current day. Collecting historical data helps you analyze CPU usage trends and identify past problems.<\/p>\n<p>Sar is also part of the system package. Please refer to the &#8220;iostat&#8221; section before running the next command to install iostat on your Linux system.<\/p>\n<p><code>sar-u<\/code><\/p>\n<p>Are you getting this error after running the sar -u command?<\/p>\n<p>Cannot open \/var\/log\/sysstat\/sa28: No such file or directory<br \/>\nPlease check if data collection is enabled<\/p>\n<p>This error message indicates that the required system activity data for &#8220;sar&#8221; is not being collected or stored. To fix this problem, we must enable data collection and configure the sysstat package correctly.<\/p>\n<h2><span id=\"mpstat\">mpstat<\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-159234 size-full\" src=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/1-768x511-2.webp\" alt=\"As a system administrator managing multi-core servers, &quot;mpstat&quot; is a lifesaver. It shows the usage of each processor core, which helps me understand the system load distribution. I find it especially useful for tuning applications that must be optimized for multi-core systems.\" width=\"768\" height=\"511\" srcset=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/1-768x511-2.webp 768w, https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/1-768x511-2-300x200.webp 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>As a system administrator managing multi-core servers, &#8220;mpstat&#8221; is a lifesaver. It shows the usage of each processor core, which helps me understand the system load distribution. I find it especially useful for tuning applications that must be optimized for multi-core systems.<\/p>\n<p>I can&#8217;t find any fault with this\u2014it does exactly what I need it to do! Use the following command to display the CPU usage for each processor core. This helps you understand the distribution of the system load, which is especially useful for setting up applications optimized for multi-core systems.<\/p>\n<h2><span id=\"netstat\">netstat<\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-159237 size-full\" src=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/7-768x316-1.webp\" alt=\"Network problems can be a real pain, and that's where netstat comes in handy. This is my go-to command for monitoring network connections, routing tables, and interface statistics. I have to admit, I have a soft spot for this one \u2013 it saved me countless hours of troubleshooting.\" width=\"768\" height=\"316\" srcset=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/7-768x316-1.webp 768w, https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/7-768x316-1-300x123.webp 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>Network problems can be a real pain, and that&#8217;s where netstat comes in handy. This is my go-to command for monitoring network connections, routing tables, and interface statistics. I have to admit, I have a soft spot for this one \u2013 it saved me countless hours of troubleshooting.<\/p>\n<p>The only downside is that it has been deprecated in favor of &#8216;ss&#8217;, but old habits die hard, and I still prefer using &#8216;netstat&#8217;.<\/p>\n<p>Use the following command to display all active network connections and their status. It helps you monitor network connections and identify potential problems.<\/p>\n<p>The &#8220;netstat&#8221; command is part of the &#8220;net-tools&#8221; package, which is not always pre-installed on Linux distributions. Here&#8217;s how to install net-tools on some popular Linux distributions:<\/p>\n<p>Debian and Ubuntu:<\/p>\n<p>To install net-tools on Debian and Ubuntu, open a terminal and run the following command:<\/p>\n<p><code>sudo apt-get install net tools<\/code><\/p>\n<p>Red Hat, CentOS, and Fedora:<\/p>\n<p>To install net-tools on <a href=\"https:\/\/en.wikipedia.org\/wiki\/Red_Hat\" target=\"_blank\" rel=\"noopener\">Red Hat-based systems<\/a>, open a terminal and run the following command:<\/p>\n<p><code>sudo yum Install network tools<\/code><\/p>\n<p>Arch Linux:<\/p>\n<p>To install net-tools on Arch Linux, open a terminal and run the following command:<\/p>\n<p><code>sudo pacman -S net-tools<\/code><\/p>\n<p>SUSE and openSUSE:<\/p>\n<p>To install net-tools on SUSE and openSUSE, open a terminal and run the following command:<br \/>\nAlso read<\/p>\n<p><code>sudo zypper Install network tools<\/code><\/p>\n<p>After installing net-tools, you can use the netstat command to display the active network connections and their status. Use &#8216;sudo&#8217; or switch to the root user if you need higher privileges to run the command.<\/p>\n<p><code>netstat -tunap<\/code><\/p>\n<h2>ss<\/h2>\n<p>Speaking of &#8216;ss&#8217;, it is a worthy replacement for &#8216;netstat&#8217;. It is faster and more powerful, and provides detailed information about sockets and network connections. I&#8217;m slowly warming up to it, and I admit it has grown on me over time.<\/p>\n<p>It&#8217;s just a matter of getting used to the new way, and once you do, &#8216;ss&#8217; can be a valuable addition to your toolbox.<\/p>\n<p>Use the following command to display detailed information about sockets and network connections. It is similar to netstat but faster and more powerful.<\/p>\n<h2><span id=\"lsof\">lsof<\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-159240 size-full\" src=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/9-768x224-1.webp\" alt=\"Lsof is an underrated gem. It stands for &quot;Open List Movies,&quot; but it does much more than that. It can help you track which processes are using specific files, directories, or sockets, which is very useful when debugging complex issues.\" width=\"768\" height=\"224\" srcset=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/9-768x224-1.webp 768w, https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/9-768x224-1-300x88.webp 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>Lsof is an underrated gem. It stands for &#8220;Open List Movies,&#8221; but it does much more than that. It can help you track which processes are using specific files, directories, or sockets, which is very useful when debugging complex issues.<\/p>\n<p>The only downside is that the output can be quite wordy, and it can take a while to find the necessary information. But overall, it&#8217;s a powerful command I wouldn&#8217;t want to be without.<\/p>\n<p>The following command displays a list of open files and the processes using them. This is useful when debugging file usage issues, such as identifying processes that have locked certain files.<\/p>\n<h2><span id=\"strace\">strace<\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-159243 size-full\" src=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/11-768x314-1.webp\" alt=\"10 Linux Performance Commands Last but not least, strace is a lifesaver when debugging application problems. It tracks system calls and signals, allowing you to see exactly what a process is doing. The number of times this command has failed me when all other debugging methods have failed.\" width=\"768\" height=\"314\" srcset=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/11-768x314-1.webp 768w, https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/11-768x314-1-300x123.webp 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>10 Linux Performance Commands Last but not least, strace is a lifesaver when debugging application problems. It tracks system calls and signals, allowing you to see exactly what a process is doing. The number of times this command has failed me when all other debugging methods have failed.<\/p>\n<p>However, &#8220;trace&#8221; is not without flaws. It may be slow and difficult to decode the output. But when you need it, its insights cannot be substituted.<\/p>\n<p>Use the following command to trace the system calls and signals of a specific process. This helps you understand what the process is doing, which can be invaluable when debugging application problems.<\/p>\n<p>strace -p [PID] Replace [PID] with the process ID of the process you want to trace.<\/p>\n<p>There are several ways to view a process&#8217;s PID. For quick output, I suggest you use the ps command.<\/p>\n<h2><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-159249 size-full\" src=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/12-768x341-1.webp\" alt=\"There are several ways to view a process's PID. For quick output, I suggest you use the ps command.\" width=\"768\" height=\"341\" srcset=\"https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/12-768x341-1.webp 768w, https:\/\/ded9.com\/wp-content\/uploads\/2023\/05\/12-768x341-1-300x133.webp 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/>FAQ<\/h2>\n<div id=\"rank-math-rich-snippet-wrapper\"><div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-1\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">What are Linux function commands?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>They are built-in commands in Linux used to perform common tasks like file management, system queries, and process control.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-2\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">Which Linux commands are commonly included?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Examples often include ls, cd, cp, mv, grep, chmod, ps, top, cat, and echo.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-3\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">Why learn essential Linux commands?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Knowing these commands helps users navigate and control Linux systems more efficiently.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We introduce you to 10 Linux performance commands that every system administrator should know. With these tools at your disposal, you&#8217;ll be well-equipped to tackle any performance-related challenges that come your way. Linux system administrators need robust tools to monitor and optimize their systems effectively. A deep understanding of function commands can help you quickly [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":159253,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[69],"tags":[32,33],"class_list":["post-159217","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-linux","tag-os"],"acf":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/posts\/159217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/comments?post=159217"}],"version-history":[{"count":4,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/posts\/159217\/revisions"}],"predecessor-version":[{"id":266194,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/posts\/159217\/revisions\/266194"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/media\/159253"}],"wp:attachment":[{"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/media?parent=159217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/categories?post=159217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/tags?post=159217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}