{"id":7,"date":"2026-08-17T20:01:11","date_gmt":"2026-08-17T20:01:11","guid":{"rendered":"https:\/\/nodeguard.io\/blog\/?p=7"},"modified":"2026-09-06T17:41:05","modified_gmt":"2026-09-06T15:41:05","slug":"linux-commands-system-administrators","status":"publish","type":"post","link":"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/","title":{"rendered":"20 Essential Linux Commands Every System Administrator Should Know"},"content":{"rendered":"\n<h2 id=\"linux-commands-for-system-administrators-what-you-need-to-know\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Linux_Commands_for_System_Administrators_What_You_Need_to_Know\"><\/span>Linux Commands for System Administrators: What You Need to Know<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Linux system administration happens largely from the command line.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whether you&#8217;re troubleshooting a production server, checking disk usage, investigating an application failure, or diagnosing a network problem, knowing the right <strong>Linux commands for system administrators<\/strong> can save significant time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But being a good Linux administrator isn&#8217;t simply about memorizing hundreds of commands. It&#8217;s about knowing a smaller set of powerful tools well enough to combine them when troubleshooting real systems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we&#8217;ll cover <strong>20 essential Linux commands every system administrator should know<\/strong>, with practical examples you can use on real servers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The examples are suitable for both major Linux distribution families:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Ubuntu and Debian<\/strong><\/li>\n\n\n\n<li><strong>RHEL, AlmaLinux, and Rocky Linux<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Most commands work identically across both families. Where package management differs, we&#8217;ll show examples for each.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Some commands require root privileges. Use <code>sudo<\/code> where appropriate, and be especially careful with commands that modify permissions, ownership, processes, or files on production systems.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">In This Guide<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#Linux_Commands_for_System_Administrators_What_You_Need_to_Know\" >Linux Commands for System Administrators: What You Need to Know<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#1_ls_%E2%80%94_List_Files_and_Directories\" >1. ls \u2014 List Files and Directories<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#2_cp_%E2%80%94_Copy_Files_and_Directories\" >2. cp \u2014 Copy Files and Directories<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#3_mv_%E2%80%94_Move_or_Rename_Files\" >3. mv \u2014 Move or Rename Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#4_rm_%E2%80%94_Remove_Files_and_Directories\" >4. rm \u2014 Remove Files and Directories<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#5_find_%E2%80%94_Locate_Files\" >5. find \u2014 Locate Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#6_grep_%E2%80%94_Search_Inside_Files_and_Command_Output\" >6. grep \u2014 Search Inside Files and Command Output<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#7_tail_%E2%80%94_Monitor_the_End_of_Files\" >7. tail \u2014 Monitor the End of Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#8_chmod_%E2%80%94_Change_File_Permissions\" >8. chmod \u2014 Change File Permissions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#9_chown_%E2%80%94_Change_File_Ownership\" >9. chown \u2014 Change File Ownership<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#10_df_%E2%80%94_Check_Filesystem_Disk_Usage\" >10. df \u2014 Check Filesystem Disk Usage<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#11_du_%E2%80%94_Find_Whats_Consuming_Disk_Space\" >11. du \u2014 Find What&#8217;s Consuming Disk Space<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#12_free_%E2%80%94_Check_Memory_Usage\" >12. free \u2014 Check Memory Usage<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#13_ps_%E2%80%94_Inspect_Running_Processes\" >13. ps \u2014 Inspect Running Processes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#14_top_%E2%80%94_Monitor_System_Activity_in_Real_Time\" >14. top \u2014 Monitor System Activity in Real Time<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#15_kill_%E2%80%94_Send_Signals_to_Processes\" >15. kill \u2014 Send Signals to Processes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#16_systemctl_%E2%80%94_Manage_Linux_Services\" >16. systemctl \u2014 Manage Linux Services<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#17_journalctl_%E2%80%94_Investigate_System_and_Service_Logs\" >17. journalctl \u2014 Investigate System and Service Logs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#18_ip_%E2%80%94_Inspect_and_Manage_Linux_Networking\" >18. ip \u2014 Inspect and Manage Linux Networking<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#19_ss_%E2%80%94_Inspect_Network_Connections_and_Listening_Ports\" >19. ss \u2014 Inspect Network Connections and Listening Ports<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#20_apt_and_dnf_%E2%80%94_Manage_Linux_Packages\" >20. apt and dnf \u2014 Manage Linux Packages<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#Ubuntu_and_Debian_apt\" >Ubuntu and Debian: apt<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#RHEL_AlmaLinux_and_Rocky_Linux_dnf\" >RHEL, AlmaLinux and Rocky Linux: dnf<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#Quick_Comparison\" >Quick Comparison<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#Step_1_Check_the_service\" >Step 1: Check the service<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#Step_2_Check_whether_it_is_listening\" >Step 2: Check whether it is listening<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#Step_3_Check_the_logs\" >Step 3: Check the logs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#Step_4_Check_available_disk_space\" >Step 4: Check available disk space<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#Step_5_Find_whats_consuming_it\" >Step 5: Find what&#8217;s consuming it<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#Step_6_Examine_them\" >Step 6: Examine them<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#What_Linux_commands_should_every_system_administrator_know\" >What Linux commands should every system administrator know?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#Are_Linux_commands_the_same_on_Ubuntu_and_RHEL\" >Are Linux commands the same on Ubuntu and RHEL?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#What_is_the_best_way_to_learn_Linux_commands\" >What is the best way to learn Linux commands?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-34\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#Which_command_shows_running_processes_in_Linux\" >Which command shows running processes in Linux?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-35\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#How_do_I_check_which_ports_are_open_on_a_Linux_server\" >How do I check which ports are open on a Linux server?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-36\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#How_do_I_check_disk_space_on_Linux\" >How do I check disk space on Linux?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-37\" href=\"https:\/\/nodeguard.io\/blog\/linux-commands-system-administrators\/#Build_Your_Next_Linux_Server_with_NodeGuard\" >Build Your Next Linux Server with NodeGuard<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"1-ls-list-files-and-directories\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_ls_%E2%80%94_List_Files_and_Directories\"><\/span>1. <code>ls<\/code> \u2014 List Files and Directories<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>ls<\/code> command displays files and directories and is one of the commands you&#8217;ll use most frequently when navigating a Linux server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A basic directory listing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For system administration, however, you&#8217;ll usually want more information:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -lah\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>-l<\/code> displays detailed information.<\/li>\n\n\n\n<li><code>-a<\/code> includes hidden files.<\/li>\n\n\n\n<li><code>-h<\/code> displays file sizes in human-readable units.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -lah \/var\/log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also sort files by modification time:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -lht \/var\/log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is particularly useful when you&#8217;re trying to identify recently modified log files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">GNU <code>ls<\/code> supports detailed listings, hidden-file visibility, sorting and numerous other options that make it useful for server investigation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Admin tip:<\/strong> When troubleshooting an application, <code>ls -lah<\/code> is often one of the first commands worth running. It can immediately reveal incorrect ownership, permissions, unexpectedly large files, or missing configuration files.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"966\" height=\"786\" src=\"https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/ls-var-log.png\" alt=\"Linux commands for system administrators shown in a Linux terminal\" class=\"wp-image-27\" srcset=\"https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/ls-var-log.png 966w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/ls-var-log-300x244.png 300w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/ls-var-log-768x625.png 768w\" sizes=\"auto, (max-width: 966px) 100vw, 966px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"2-cp-copy-files-and-directories\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_cp_%E2%80%94_Copy_Files_and_Directories\"><\/span>2. <code>cp<\/code> \u2014 Copy Files and Directories<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>cp<\/code> copies files or directories.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To copy a configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp nginx.conf nginx.conf.backup\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For directories, use recursive mode:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp -r \/etc\/nginx \/root\/nginx-backup\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When working with important server configuration files, preserving attributes can be useful:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp -a \/etc\/nginx \/root\/nginx-backup\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The archive option preserves important file attributes while recursively copying directory contents.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A common administration habit is creating a backup before modifying configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp \/etc\/ssh\/sshd_config \/etc\/ssh\/sshd_config.bak\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then edit the original file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.gnu.org\/software\/coreutils\/manual\/?utm_source=chatgpt.com\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.gnu.org\/software\/coreutils\/manual\/?utm_source=chatgpt.com\" rel=\"noreferrer noopener\">GNU Coreutils<\/a> defines <code>cp<\/code> as the standard file and directory copying utility.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Admin tip:<\/strong> Before changing an important configuration file manually, create a timestamped backup:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp sshd_config sshd_config.$(date +%F-%H%M).bak\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"3-mv-move-or-rename-files\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_mv_%E2%80%94_Move_or_Rename_Files\"><\/span>3. <code>mv<\/code> \u2014 Move or Rename Files<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>mv<\/code> command performs two closely related tasks:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Moving files or directories<\/li>\n\n\n\n<li>Renaming files or directories<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Rename a file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv old-config.conf new-config.conf\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Move a file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv application.log \/var\/log\/myapp\/\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Move several files into another directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv *.log \/var\/log\/archive\/\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Because <code>mv<\/code> can overwrite an existing destination, administrators should be careful when moving important configuration or data files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>mv<\/code> is part of GNU Coreutils&#8217; standard file-manipulation utilities.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"4-rm-remove-files-and-directories\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_rm_%E2%80%94_Remove_Files_and_Directories\"><\/span>4. <code>rm<\/code> \u2014 Remove Files and Directories<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>rm<\/code> deletes files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rm old.log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To delete a directory and its contents recursively:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rm -r old-directory\/\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For interactive confirmation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rm -i important-file.conf\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">One command deserves particular caution:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rm -rf directory\/\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>-r<\/code> recursively removes directory contents, while <code>-f<\/code> suppresses normal confirmation behavior.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There is generally no convenient &#8220;undo&#8221; after deleting server files with <code>rm<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Admin tip:<\/strong> Before recursively deleting anything important, verify your current location and target:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pwd\nls -lah directory\/\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then run the deletion command only after confirming the path.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"5-find-locate-files\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_find_%E2%80%94_Locate_Files\"><\/span>5. <code>find<\/code> \u2014 Locate Files<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Linux servers can contain hundreds of thousands of files. <code>find<\/code> allows you to locate files according to attributes such as name, type, ownership, size, or modification time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Find a configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/etc -name \"nginx.conf\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Perform a case-insensitive search:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/etc -iname \"*nginx*\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Find files larger than 1 GB:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/ -type f -size +1G 2&gt;\/dev\/null\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Find files modified during the last 24 hours:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/var\/log -type f -mtime -1\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Find files owned by a particular user:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/home -user nodeguard\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This becomes extremely valuable when troubleshooting disk usage, abandoned application data, old backups, or unexpected files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Admin tip:<\/strong> Combine <code>find<\/code> with other commands for powerful troubleshooting workflows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/var\/log -type f -size +500M -exec ls -lh {} \\;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This finds large log files and displays their sizes.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"6-grep-search-inside-files-and-command-output\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_grep_%E2%80%94_Search_Inside_Files_and_Command_Output\"><\/span>6. <code>grep<\/code> \u2014 Search Inside Files and Command Output<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If <code>find<\/code> locates files, <code>grep<\/code> helps you find information <strong>inside<\/strong> them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Search a configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep \"PermitRootLogin\" \/etc\/ssh\/sshd_config\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Perform a case-insensitive search:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -i \"error\" application.log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Search recursively:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -R \"database.example.com\" \/etc\/\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Show matching line numbers:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -n \"ERROR\" application.log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">One of grep&#8217;s greatest strengths is combining it with pipes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps aux | grep nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx | grep -i error\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>grep<\/code> searches input for matching patterns and prints matching lines, making it particularly powerful when combined with command pipelines.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Admin tip:<\/strong> When investigating logs, try:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -Ei \"error|failed|critical|warning\" application.log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This searches several common problem indicators simultaneously.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"7-tail-monitor-the-end-of-files\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7_tail_%E2%80%94_Monitor_the_End_of_Files\"><\/span>7. <code>tail<\/code> \u2014 Monitor the End of Files<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>tail<\/code> displays the last portion of a file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By default:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail application.log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">displays its final 10 lines.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Specify the number of lines:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail -n 50 application.log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For administrators, the most useful option is often:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail -f application.log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>-f<\/code> option follows the file and displays new entries as they&#8217;re written.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail -f \/var\/log\/nginx\/error.log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can then reproduce a website problem while watching errors appear in real time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The current GNU implementation of <code>tail<\/code> supports both selecting the number of lines and continuously following files as they change.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Admin tip:<\/strong> Combine <code>tail<\/code> and <code>grep<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail -f application.log | grep -i error\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This gives you a live stream containing only matching log entries.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"8-chmod-change-file-permissions\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"8_chmod_%E2%80%94_Change_File_Permissions\"><\/span>8. <code>chmod<\/code> \u2014 Change File Permissions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Linux file permissions determine who can read, write, or execute a file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -l script.sh\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You might see:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-rwxr-xr-x\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Permissions can be changed numerically:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod 755 script.sh\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or symbolically:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod u+x script.sh\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common permission values include:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Permission<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td><code>644<\/code><\/td><td>Owner read\/write; everyone else read<\/td><\/tr><tr><td><code>600<\/code><\/td><td>Owner read\/write only<\/td><\/tr><tr><td><code>755<\/code><\/td><td>Owner full access; others read\/execute<\/td><\/tr><tr><td><code>700<\/code><\/td><td>Owner full access only<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod 600 private-key\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">is commonly appropriate for files that shouldn&#8217;t be accessible to other users.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">GNU <code>chmod<\/code> changes file access permissions and supports both symbolic and numeric permission modes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Admin tip:<\/strong> Avoid solving application problems by blindly running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod -R 777\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It often masks the actual ownership or application configuration problem while creating unnecessary security exposure.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"9-chown-change-file-ownership\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"9_chown_%E2%80%94_Change_File_Ownership\"><\/span>9. <code>chown<\/code> \u2014 Change File Ownership<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Where <code>chmod<\/code> controls permissions, <code>chown<\/code> controls ownership.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Change the owner:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chown nodeguard file.txt\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change both owner and group:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chown nodeguard:nodeguard file.txt\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change ownership recursively:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chown -R www-data:www-data \/var\/www\/example.com\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On RHEL-family systems, a web application might instead use a user such as <code>apache<\/code>, depending on how the service is configured.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Incorrect ownership is a common cause of:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Web application errors<\/li>\n\n\n\n<li>Upload failures<\/li>\n\n\n\n<li>Permission-denied messages<\/li>\n\n\n\n<li>Backup failures<\/li>\n\n\n\n<li>Web server access problems<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">GNU <code>chown<\/code> can change user ownership, group ownership, or both, including recursive operation.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"10-df-check-filesystem-disk-usage\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"10_df_%E2%80%94_Check_Filesystem_Disk_Usage\"><\/span>10. <code>df<\/code> \u2014 Check Filesystem Disk Usage<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When a Linux server unexpectedly stops writing logs, databases fail, or applications behave strangely, disk space should be one of your first checks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>df -h\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>-h<\/code> option displays human-readable sizes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For filesystem types as well:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>df -hT\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Example output may include:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Filesystem     Type  Size  Used Avail Use% Mounted on\n\/dev\/sda2      xfs    80G   61G   19G  77% \/\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Pay particular attention to filesystems approaching 100% utilization.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can inspect a specific mount point:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>df -h \/var\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>df<\/code> reports filesystem space usage and is part of GNU Coreutils&#8217; filesystem-space utilities.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Important:<\/strong> <code>df<\/code> tells you <strong>which filesystem is full<\/strong>. The next command, <code>du<\/code>, helps identify <strong>what is consuming the space<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"329\" src=\"https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/df-hT-1024x329.png\" alt=\"Checking Linux disk usage with the df command\" class=\"wp-image-28\" srcset=\"https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/df-hT-1024x329.png 1024w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/df-hT-300x96.png 300w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/df-hT-768x247.png 768w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/df-hT.png 1057w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"11-du-find-whats-consuming-disk-space\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"11_du_%E2%80%94_Find_Whats_Consuming_Disk_Space\"><\/span>11. <code>du<\/code> \u2014 Find What&#8217;s Consuming Disk Space<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once <code>df<\/code> tells you that a filesystem is running out of space, use <code>du<\/code> to investigate directories.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check total size:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>du -sh \/var\/log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check individual directories:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>du -sh \/var\/*\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sort them by size:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>du -sh \/var\/* | sort -h\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Another useful command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>du -xh \/var | sort -h | tail -20\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This can help identify large directories beneath <code>\/var<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">GNU <code>du<\/code> estimates filesystem space consumed by files and directories.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Admin workflow:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>df -h\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">shows <code>\/var<\/code> is full.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>du -sh \/var\/* | sort -h\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">might show <code>\/var\/log<\/code> consuming most of the space.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You now know where to investigate.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"12-free-check-memory-usage\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"12_free_%E2%80%94_Check_Memory_Usage\"><\/span>12. <code>free<\/code> \u2014 Check Memory Usage<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>free<\/code> for a quick overview of system memory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>free -h\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It displays information about physical memory and swap.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A typical output includes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>               total        used        free      shared  buff\/cache   available\nMem:            15Gi        5Gi        1Gi        500Mi        9Gi         9Gi\nSwap:            2Gi        0Gi        2Gi\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Administrators should pay attention to the <strong>available<\/strong> memory figure rather than judging Linux memory usage only by the <code>free<\/code> column. Linux intentionally uses otherwise-unused RAM for caching.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>free<\/code> utility reads memory information from <code>\/proc\/meminfo<\/code> and reports physical and swap memory together with kernel cache information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Admin tip:<\/strong> For an easy-to-read snapshot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>free -h\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For repeated updates:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>free -h -s 2\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"13-ps-inspect-running-processes\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"13_ps_%E2%80%94_Inspect_Running_Processes\"><\/span>13. <code>ps<\/code> \u2014 Inspect Running Processes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>ps<\/code> gives you a snapshot of processes running on the server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A commonly used form is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps aux\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Search for a particular service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps aux | grep nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A more targeted example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps -ef | grep sshd\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also sort processes according to CPU usage:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps aux --sort=-%cpu | head\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or memory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps aux --sort=-%mem | head\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>ps<\/code> provides a snapshot of active processes; unlike <code>top<\/code>, it doesn&#8217;t continuously refresh the display.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This makes <code>ps<\/code> particularly useful in scripts and command pipelines.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"14-top-monitor-system-activity-in-real-time\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"14_top_%E2%80%94_Monitor_System_Activity_in_Real_Time\"><\/span>14. <code>top<\/code> \u2014 Monitor System Activity in Real Time<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">While <code>ps<\/code> provides a snapshot, <code>top<\/code> continuously updates process and system information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>top\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll see information including:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Load average<\/li>\n\n\n\n<li>CPU usage<\/li>\n\n\n\n<li>Memory usage<\/li>\n\n\n\n<li>Running processes<\/li>\n\n\n\n<li>Process IDs<\/li>\n\n\n\n<li>Per-process CPU consumption<\/li>\n\n\n\n<li>Per-process memory consumption<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Useful interactive keys include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>P<\/code> \u2014 sort by CPU<\/li>\n\n\n\n<li><code>M<\/code> \u2014 sort by memory<\/li>\n\n\n\n<li><code>1<\/code> \u2014 show individual CPU cores<\/li>\n\n\n\n<li><code>k<\/code> \u2014 send a signal to a process<\/li>\n\n\n\n<li><code>q<\/code> \u2014 quit<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><code>top<\/code> provides a dynamic view of Linux processes along with system summary information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Admin tip:<\/strong> High load doesn&#8217;t automatically mean high CPU usage. Check CPU utilization, I\/O behavior, process states, memory pressure, and workload together before drawing conclusions.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"703\" src=\"https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/top-1024x703.png\" alt=\"Screenshot for checking server resources with &quot;top&quot; command\" class=\"wp-image-29\" srcset=\"https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/top-1024x703.png 1024w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/top-300x206.png 300w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/top-768x527.png 768w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/top.png 1215w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"15-kill-send-signals-to-processes\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"15_kill_%E2%80%94_Send_Signals_to_Processes\"><\/span>15. <code>kill<\/code> \u2014 Send Signals to Processes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When a process stops responding, you may need to terminate or signal it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First identify its PID:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps aux | grep application\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kill 1234\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Without specifying another signal, <code>kill<\/code> normally sends <code>SIGTERM<\/code>, giving the application an opportunity to shut down cleanly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the process refuses to terminate:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kill -9 1234\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">sends <code>SIGKILL<\/code>, which forces termination.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, <code>kill -9<\/code> should not be your default response.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kill PID\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and escalate only if the process doesn&#8217;t terminate.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can list available signals with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kill -l\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Admin tip:<\/strong> Before killing a production process, determine what started it. If it&#8217;s managed by systemd, restarting the service through <code>systemctl<\/code> is often more appropriate than manually killing its processes.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"16-systemctl-manage-linux-services\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"16_systemctl_%E2%80%94_Manage_Linux_Services\"><\/span>16. <code>systemctl<\/code> \u2014 Manage Linux Services<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Most modern Linux server distributions use systemd to manage services.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check the status of a service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Start it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Stop it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl stop nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Reload configuration without a full restart when supported:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl reload nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enable a service at boot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check whether it&#8217;s enabled:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl is-enabled nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For Apache, the service name usually differs between the two distribution families:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Ubuntu\/Debian:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status apache2\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>RHEL\/AlmaLinux\/Rocky Linux:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status httpd\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>systemctl<\/code> is the primary interface used to inspect and control systemd-managed units and services on systemd-based Linux systems.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"526\" src=\"https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/systemctl-status-nginx-1024x526.png\" alt=\"Checking nginx status with systemctl service\" class=\"wp-image-30\" srcset=\"https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/systemctl-status-nginx-1024x526.png 1024w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/systemctl-status-nginx-300x154.png 300w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/systemctl-status-nginx-768x394.png 768w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/systemctl-status-nginx.png 1213w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"17-journalctl-investigate-system-and-service-logs\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"17_journalctl_%E2%80%94_Investigate_System_and_Service_Logs\"><\/span>17. <code>journalctl<\/code> \u2014 Investigate System and Service Logs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If <code>systemctl status<\/code> tells you a service failed, <code><a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/255\/journalctl.html?utm_source=chatgpt.com\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/255\/journalctl.html?utm_source=chatgpt.com\" rel=\"noreferrer noopener\">journalctl<\/a><\/code> is often your next command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">View system logs:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">View logs for a particular service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Display recent entries:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx -n 100\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Follow logs in real time:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx -f\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Show logs from the current boot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -b\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Show kernel messages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -k\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Show errors since the current boot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -p err -b\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>journalctl<\/code> reads logs collected by <code>systemd-journald<\/code> and supports filtering by units, boots, kernel messages and other journal fields. For additional filtering and output options, see the <strong><a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/255\/journalctl.html?utm_source=chatgpt.com\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/255\/journalctl.html?utm_source=chatgpt.com\" rel=\"noreferrer noopener\">official journalctl documentation<\/a><\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A very useful troubleshooting combination is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status nginx\njournalctl -u nginx --since \"30 minutes ago\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This lets you first determine the service state and then investigate what happened around the time of failure.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"18-ip-inspect-and-manage-linux-networking\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"18_ip_%E2%80%94_Inspect_and_Manage_Linux_Networking\"><\/span>18. <code>ip<\/code> \u2014 Inspect and Manage Linux Networking<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>ip<\/code> command is one of the most important Linux networking tools.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Display IP addresses:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip addr\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A shorter form is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip a\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Display interfaces:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip link\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Display the routing table:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip route\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Show a concise interface summary:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip -br addr\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You may see something like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lo       UNKNOWN   127.0.0.1\/8\neth0     UP        192.168.1.20\/24\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the route Linux would use to reach an IP:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip route get 8.8.8.8\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>ip<\/code> utility can display and manipulate routing, network devices, interfaces, addresses, neighbors and other networking objects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Admin tip:<\/strong> When troubleshooting connectivity, begin with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip -br addr\nip route\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Before assuming a firewall or remote service is broken, confirm that the server has the expected IP configuration and routing.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"19-ss-inspect-network-connections-and-listening-ports\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"19_ss_%E2%80%94_Inspect_Network_Connections_and_Listening_Ports\"><\/span>19. <code>ss<\/code> \u2014 Inspect Network Connections and Listening Ports<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code><a href=\"https:\/\/man7.org\/linux\/man-pages\/man8\/ss.8.html?utm_source=chatgpt.com\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/man7.org\/linux\/man-pages\/man8\/ss.8.html?utm_source=chatgpt.com\" rel=\"noreferrer noopener\">ss<\/a><\/code> is invaluable when investigating network services.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Show listening TCP and UDP sockets:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -tulpn\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>-t<\/code> \u2014 TCP<\/li>\n\n\n\n<li><code>-u<\/code> \u2014 UDP<\/li>\n\n\n\n<li><code>-l<\/code> \u2014 listening sockets<\/li>\n\n\n\n<li><code>-p<\/code> \u2014 process information<\/li>\n\n\n\n<li><code>-n<\/code> \u2014 don&#8217;t resolve service names<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Check whether anything is listening on port 443:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -ltnp | grep :443\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Display established TCP connections:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -tn state established\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Count established connections:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -tn state established | wc -l\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>ss<\/code> displays socket statistics and can filter sockets according to protocol and TCP state. You can find the complete list of options in the <strong><a href=\"https:\/\/man7.org\/linux\/man-pages\/man8\/ss.8.html?utm_source=chatgpt.com\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/man7.org\/linux\/man-pages\/man8\/ss.8.html?utm_source=chatgpt.com\" rel=\"noreferrer noopener\">ss Linux manual page<\/a><\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This command answers one of the most common server troubleshooting questions:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&#8220;Is my application actually listening on the expected port?&#8221;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -ltnp | grep :8080\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If nothing appears, the application may not be listening at all.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"444\" src=\"https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/ss-tulpn-1024x444.png\" alt=\"Checking port numbers and service number with ss command\" class=\"wp-image-31\" srcset=\"https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/ss-tulpn-1024x444.png 1024w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/ss-tulpn-300x130.png 300w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/ss-tulpn-768x333.png 768w, https:\/\/nodeguard.io\/blog\/wp-content\/uploads\/2026\/08\/ss-tulpn.png 1196w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"20-apt-and-dnf-manage-linux-packages\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"20_apt_and_dnf_%E2%80%94_Manage_Linux_Packages\"><\/span>20. <code>apt<\/code> and <code>dnf<\/code> \u2014 Manage Linux Packages<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Package management is one of the areas where Debian-based and RHEL-based systems differ.<\/p>\n\n\n\n<h3 id=\"ubuntu-and-debian-apt\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Ubuntu_and_Debian_apt\"><\/span>Ubuntu and Debian: <code><a href=\"https:\/\/manpages.debian.org\/testing\/apt\/apt.8.en.html?utm_source=chatgpt.com\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/manpages.debian.org\/testing\/apt\/apt.8.en.html?utm_source=chatgpt.com\" rel=\"noreferrer noopener\">apt<\/a><\/code><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Update repository metadata:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Install a package:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Upgrade packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt upgrade\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Remove a package:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt remove nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Search for packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt search nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>apt<\/code> provides a high-level command-line interface to Debian&#8217;s package management system.<\/p>\n\n\n\n<h3 id=\"rhel-alma-linux-and-rocky-linux-dnf\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"RHEL_AlmaLinux_and_Rocky_Linux_dnf\"><\/span>RHEL, AlmaLinux and Rocky Linux: <code><a href=\"https:\/\/docs.redhat.com\/en\/documentation\/red_hat_enterprise_linux\/9\/html\/managing_software_with_the_dnf_tool\/index?utm_source=chatgpt.com\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/docs.redhat.com\/en\/documentation\/red_hat_enterprise_linux\/9\/html\/managing_software_with_the_dnf_tool\/index?utm_source=chatgpt.com\" rel=\"noreferrer noopener\">dnf<\/a><\/code><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Update packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf upgrade\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Install a package:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Remove a package:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf remove nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Search:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnf search nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Display package information:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnf info nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">RHEL uses DNF for managing content available through RPM repositories, including installing, updating and removing packages.<\/p>\n\n\n\n<h3 id=\"quick-comparison\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Quick_Comparison\"><\/span>Quick Comparison<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Task<\/th><th>Ubuntu\/Debian<\/th><th>RHEL\/Alma\/Rocky<\/th><\/tr><\/thead><tbody><tr><td>Refresh package metadata<\/td><td><code>apt update<\/code><\/td><td><code>dnf check-update<\/code><\/td><\/tr><tr><td>Install package<\/td><td><code>apt install nginx<\/code><\/td><td><code>dnf install nginx<\/code><\/td><\/tr><tr><td>Upgrade packages<\/td><td><code>apt upgrade<\/code><\/td><td><code>dnf upgrade<\/code><\/td><\/tr><tr><td>Remove package<\/td><td><code>apt remove nginx<\/code><\/td><td><code>dnf remove nginx<\/code><\/td><\/tr><tr><td>Search packages<\/td><td><code>apt search nginx<\/code><\/td><td><code>dnf search nginx<\/code><\/td><\/tr><tr><td>Package information<\/td><td><code>apt show nginx<\/code><\/td><td><code>dnf info nginx<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Knowing both package managers is valuable for administrators who work across mixed Linux environments.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 id=\"putting-the-commands-together-a-real-troubleshooting-example\" class=\"wp-block-heading\">Putting the Commands Together: A Real Troubleshooting Example<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The real power of Linux administration comes from <strong>combining commands<\/strong>, rather than running each one in isolation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Imagine users report that a website hosted on your Linux server has stopped responding.<\/p>\n\n\n\n<h3 id=\"step-1-check-the-service\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Check_the_service\"><\/span>Step 1: Check the service<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status nginx\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Suppose Nginx shows as running.<\/p>\n\n\n\n<h3 id=\"step-2-check-whether-it-is-listening\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Check_whether_it_is_listening\"><\/span>Step 2: Check whether it is listening<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -ltnp | grep :443\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Nothing appears.<\/p>\n\n\n\n<h3 id=\"step-3-check-the-logs\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Check_the_logs\"><\/span>Step 3: Check the logs<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u nginx -n 100\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You discover a configuration error.<\/p>\n\n\n\n<h3 id=\"step-4-check-available-disk-space\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Check_available_disk_space\"><\/span>Step 4: Check available disk space<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>df -h\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Perhaps <code>\/var<\/code> is 100% full.<\/p>\n\n\n\n<h3 id=\"step-5-find-whats-consuming-it\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_5_Find_whats_consuming_it\"><\/span>Step 5: Find what&#8217;s consuming it<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>du -sh \/var\/* | sort -h\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You discover several gigabytes of application logs.<\/p>\n\n\n\n<h3 id=\"step-6-examine-them\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_6_Examine_them\"><\/span>Step 6: Examine them<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>tail -n 100 \/var\/log\/application.log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -i error \/var\/log\/application.log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is what effective Linux administration looks like.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You aren&#8217;t simply memorizing commands. You&#8217;re using each tool to answer a specific troubleshooting question and progressively narrowing down the root cause.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 id=\"linux-command-cheat-sheet-for-system-administrators\" class=\"wp-block-heading\">Linux Command Cheat Sheet for System Administrators<\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>Primary Use<\/th><\/tr><\/thead><tbody><tr><td><code>ls<\/code><\/td><td>List files and directories<\/td><\/tr><tr><td><code>cp<\/code><\/td><td>Copy files and directories<\/td><\/tr><tr><td><code>mv<\/code><\/td><td>Move or rename files<\/td><\/tr><tr><td><code>rm<\/code><\/td><td>Remove files and directories<\/td><\/tr><tr><td><code>find<\/code><\/td><td>Locate files<\/td><\/tr><tr><td><code>grep<\/code><\/td><td>Search text and command output<\/td><\/tr><tr><td><code>tail<\/code><\/td><td>View and follow log files<\/td><\/tr><tr><td><code>chmod<\/code><\/td><td>Change permissions<\/td><\/tr><tr><td><code>chown<\/code><\/td><td>Change ownership<\/td><\/tr><tr><td><code>df<\/code><\/td><td>Check filesystem usage<\/td><\/tr><tr><td><code>du<\/code><\/td><td>Find disk-space consumers<\/td><\/tr><tr><td><code>free<\/code><\/td><td>Check memory<\/td><\/tr><tr><td><code>ps<\/code><\/td><td>Inspect processes<\/td><\/tr><tr><td><code>top<\/code><\/td><td>Monitor system activity<\/td><\/tr><tr><td><code>kill<\/code><\/td><td>Signal or terminate processes<\/td><\/tr><tr><td><code>systemctl<\/code><\/td><td>Manage services<\/td><\/tr><tr><td><code>journalctl<\/code><\/td><td>Read systemd logs<\/td><\/tr><tr><td><code>ip<\/code><\/td><td>Inspect networking and routes<\/td><\/tr><tr><td><code>ss<\/code><\/td><td>Inspect sockets and ports<\/td><\/tr><tr><td><code>apt<\/code> \/ <code>dnf<\/code><\/td><td>Manage software packages<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Bookmarking a table like this is useful, but the fastest way to learn Linux administration is to practice the commands until you understand not only <strong>what they do<\/strong>, but <strong>when to use them<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 id=\"frequently-asked-questions\" class=\"wp-block-heading\">Frequently Asked Questions<\/h1>\n\n\n\n<h2 id=\"what-linux-commands-should-every-system-administrator-know\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Linux_commands_should_every_system_administrator_know\"><\/span>What Linux commands should every system administrator know?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">At minimum, Linux administrators should be comfortable navigating files, searching data, inspecting processes, checking system resources, reading logs, managing services, troubleshooting networks, and managing packages.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Commands such as <code>grep<\/code>, <code>find<\/code>, <code>df<\/code>, <code>du<\/code>, <code>ps<\/code>, <code>top<\/code>, <code>systemctl<\/code>, <code>journalctl<\/code>, <code>ip<\/code>, and <code>ss<\/code> are particularly valuable during real server troubleshooting.<\/p>\n\n\n\n<h2 id=\"are-linux-commands-the-same-on-ubuntu-and-rhel\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Are_Linux_commands_the_same_on_Ubuntu_and_RHEL\"><\/span>Are Linux commands the same on Ubuntu and RHEL?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Many fundamental Linux commands work the same way across distributions, including <code>ls<\/code>, <code>grep<\/code>, <code>find<\/code>, <code>df<\/code>, <code>du<\/code>, <code>ps<\/code>, <code>ip<\/code>, and <code>systemctl<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One important difference is package management.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ubuntu and Debian normally use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">while RHEL, AlmaLinux and Rocky Linux use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnf\n<\/code><\/pre>\n\n\n\n<h2 id=\"what-is-the-best-way-to-learn-linux-commands\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_the_best_way_to_learn_Linux_commands\"><\/span>What is the best way to learn Linux commands?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Practice them on a Linux virtual machine or VPS rather than relying entirely on memorization.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Try realistic tasks such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Finding large files<\/li>\n\n\n\n<li>Checking memory usage<\/li>\n\n\n\n<li>Finding a failed service<\/li>\n\n\n\n<li>Reading its logs<\/li>\n\n\n\n<li>Checking open ports<\/li>\n\n\n\n<li>Searching configuration files<\/li>\n\n\n\n<li>Investigating high CPU usage<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Learning Linux through troubleshooting scenarios builds much stronger administration skills than memorizing isolated commands.<\/p>\n\n\n\n<h2 id=\"which-command-shows-running-processes-in-linux\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Which_command_shows_running_processes_in_Linux\"><\/span>Which command shows running processes in Linux?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">for a process snapshot or:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>top\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">for an interactive, continuously updating view.<\/p>\n\n\n\n<h2 id=\"how-do-i-check-which-ports-are-open-on-a-linux-server\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_do_I_check_which_ports_are_open_on_a_Linux_server\"><\/span>How do I check which ports are open on a Linux server?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -tulpn\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This displays listening TCP and UDP sockets and, when permissions allow, the processes associated with them.<\/p>\n\n\n\n<h2 id=\"how-do-i-check-disk-space-on-linux\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_do_I_check_disk_space_on_Linux\"><\/span>How do I check disk space on Linux?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Start with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>df -h\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">to check filesystem utilization.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If a filesystem is running low on space, use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>du -sh \/path\/*\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">to identify which directories are consuming the storage.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 id=\"final-thoughts\" class=\"wp-block-heading\">Final Thoughts<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#8217;t need to memorize every Linux command available to become an effective system administrator.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead, master the commands that help you answer the questions administrators face every day:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What is running?<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps\ntop\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Why did the service fail?<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl\njournalctl\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Where did my disk space go?<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>df\ndu\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What&#8217;s happening on the network?<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip\nss\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Where is the problem in the logs?<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep\ntail\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once these tools become second nature, troubleshooting Linux servers becomes significantly faster and more systematic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Mastering these <strong>Linux commands for system administrators<\/strong> will make everyday troubleshooting and server management faster and more systematic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And remember: the best Linux administrators don&#8217;t simply know commands \u2014 they understand <strong>which question each command can answer<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 id=\"build-your-next-linux-server-with-node-guard\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Build_Your_Next_Linux_Server_with_NodeGuard\"><\/span>Build Your Next Linux Server with NodeGuard<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Want a clean Linux environment to put these commands into practice?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Deploy a <strong><a href=\"\/cloud-vps\" data-type=\"link\" data-id=\"\/cloud-vps\">NodeGuard Cloud VPS<\/a><\/strong> and get full root access, fast NVMe storage, modern virtualization, and the freedom to build and manage your server your way.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><a href=\"\/cloud-vps\" data-type=\"link\" data-id=\"\/cloud-vps\">[Explore NodeGuard VPS Hosting \u2192]<\/a><\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n<\/p>","protected":false},"excerpt":{"rendered":"<p>Linux Commands for System Administrators: What You Need to Know Linux system administration happens largely from the command line. Whether you&#8217;re troubleshooting\u2026<\/p>\n","protected":false},"author":1,"featured_media":83,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[9,8,3,6,10,11,5,4,7],"class_list":["post-7","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-almalinux","tag-debian","tag-linux-commands","tag-linux-server","tag-rhel","tag-rocky-linux","tag-sysadmin","tag-system-administration","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/nodeguard.io\/blog\/wp-json\/wp\/v2\/posts\/7","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nodeguard.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nodeguard.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nodeguard.io\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nodeguard.io\/blog\/wp-json\/wp\/v2\/comments?post=7"}],"version-history":[{"count":20,"href":"https:\/\/nodeguard.io\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":88,"href":"https:\/\/nodeguard.io\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions\/88"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nodeguard.io\/blog\/wp-json\/wp\/v2\/media\/83"}],"wp:attachment":[{"href":"https:\/\/nodeguard.io\/blog\/wp-json\/wp\/v2\/media?parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nodeguard.io\/blog\/wp-json\/wp\/v2\/categories?post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nodeguard.io\/blog\/wp-json\/wp\/v2\/tags?post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}