{"id":18297,"date":"2019-05-28T12:03:37","date_gmt":"2019-05-28T12:03:37","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=18297"},"modified":"2026-09-03T13:36:11","modified_gmt":"2026-09-03T13:36:11","slug":"linux-commands","status":"publish","type":"post","link":"\/tutorials\/linux-commands\/","title":{"rendered":"Top 60 Linux commands"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A Linux command is a text instruction entered in the terminal to make the operating system perform a specific task, such as listing files, managing users, monitoring processes, or configuring network settings. Linux commands provide direct control over the system, enabling faster execution, automation, and more precise resource management than graphical interfaces.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Linux commands fall into six main categories:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Filesystem navigation commands that move between directories and paths<\/li>\n\n\n\n<li>File and directory management commands that create, modify, and organize files<\/li>\n\n\n\n<li>User and permission commands that control access and ownership<\/li>\n\n\n\n<li>Process and system monitoring commands that track performance and running services<\/li>\n\n\n\n<li>System operation commands that manage shutdowns, reboots, and configurations<\/li>\n\n\n\n<li>Network commands that configure connections and diagnose connectivity<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Each category below includes essential commands with their syntax, commonly used options, and real-world examples, allowing quick lookup and practical application for learning, server management, or daily terminal use.<\/p>\n\n\n\n<h2 id=\"h-linux-commands-cheat-sheet\" class=\"wp-block-heading h-t-title-2\">Linux commands cheat sheet<\/h2>\n\n\n\n<figure tabindex=\"0\" class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>What it does<\/th><\/tr><\/thead><tbody><tr><td>ls<\/td><td>List directory contents<\/td><\/tr><tr><td>pwd<\/td><td>Show current directory path<\/td><\/tr><tr><td>cd<\/td><td>Change directory<\/td><\/tr><tr><td>locate<\/td><td>Search files by name<\/td><\/tr><tr><td>find<\/td><td>Search files and directories<\/td><\/tr><tr><td>mkdir<\/td><td>Create a directory<\/td><\/tr><tr><td>rmdir<\/td><td>Remove an empty directory<\/td><\/tr><tr><td>rm<\/td><td>Delete files or directories<\/td><\/tr><tr><td>cp<\/td><td>Copy files or directories<\/td><\/tr><tr><td>mv<\/td><td>Move or rename files<\/td><\/tr><tr><td>touch<\/td><td>Create an empty file<\/td><\/tr><tr><td>file<\/td><td>Show file type<\/td><\/tr><tr><td>zip<\/td><td>Compress files into ZIP archive<\/td><\/tr><tr><td>unzip<\/td><td>Extract ZIP archive<\/td><\/tr><tr><td>tar<\/td><td>Archive files and directories<\/td><\/tr><tr><td>nano<\/td><td>Edit files with Nano<\/td><\/tr><tr><td>vi<\/td><td>Edit files with Vi<\/td><\/tr><tr><td>jed<\/td><td>Edit files with Jed<\/td><\/tr><tr><td>cat<\/td><td>Display file content<\/td><\/tr><tr><td>grep<\/td><td>Search text patterns in files<\/td><\/tr><tr><td>sed<\/td><td>Replace or modify text patterns<\/td><\/tr><tr><td>head<\/td><td>Show first lines of a file<\/td><\/tr><tr><td>tail<\/td><td>Show last lines of a file<\/td><\/tr><tr><td>awk<\/td><td>Process and analyze text<\/td><\/tr><tr><td>sort<\/td><td>Sort file content<\/td><\/tr><tr><td>cut<\/td><td>Extract sections of text<\/td><\/tr><tr><td>diff<\/td><td>Compare two files<\/td><\/tr><tr><td>tee<\/td><td>Output to terminal and file<\/td><\/tr><tr><td>sudo<\/td><td>Run command as administrator<\/td><\/tr><tr><td>su<\/td><td>Switch user account<\/td><\/tr><tr><td>whoami<\/td><td>Show current user<\/td><\/tr><tr><td>chmod<\/td><td>Change file permissions<\/td><\/tr><tr><td>chown<\/td><td>Change file ownership<\/td><\/tr><tr><td>useradd<\/td><td>Create new user<\/td><\/tr><tr><td>userdel<\/td><td>Delete user account<\/td><\/tr><tr><td>passwd<\/td><td>Set or change password<\/td><\/tr><tr><td>df<\/td><td>Show disk space usage<\/td><\/tr><tr><td>du<\/td><td>Show directory size<\/td><\/tr><tr><td>top<\/td><td>Display running processes<\/td><\/tr><tr><td>htop<\/td><td>Interactive process viewer<\/td><\/tr><tr><td>ps<\/td><td>Show process snapshot<\/td><\/tr><tr><td>uname<\/td><td>Show system information<\/td><\/tr><tr><td>hostname<\/td><td>Show or set hostname<\/td><\/tr><tr><td>time<\/td><td>Measure command execution time<\/td><\/tr><tr><td>systemctl<\/td><td>Manage system services<\/td><\/tr><tr><td>watch<\/td><td>Run command repeatedly<\/td><\/tr><tr><td>jobs<\/td><td>List shell background jobs<\/td><\/tr><tr><td>kill<\/td><td>Terminate a process<\/td><\/tr><tr><td>shutdown<\/td><td>Shut down or restart system<\/td><\/tr><tr><td>ping<\/td><td>Test network connectivity<\/td><\/tr><tr><td>wget<\/td><td>Download files from the web<\/td><\/tr><tr><td>curl<\/td><td>Transfer data via URL<\/td><\/tr><tr><td>scp<\/td><td>Copy files over SSH<\/td><\/tr><tr><td>rsync<\/td><td>Sync files between systems<\/td><\/tr><tr><td>ip<\/td><td>Manage network settings<\/td><\/tr><tr><td>netstat<\/td><td>Show network connections<\/td><\/tr><tr><td>traceroute<\/td><td>Trace network packet path<\/td><\/tr><tr><td>nslookup<\/td><td>Query DNS records<\/td><\/tr><tr><td>dig<\/td><td>Detailed DNS lookup<\/td><\/tr><tr><td>history<\/td><td>Show command history<\/td><\/tr><tr><td>man<\/td><td>Show command manual<\/td><\/tr><tr><td>echo<\/td><td>Print text to terminal<\/td><\/tr><tr><td>ln<\/td><td>Create file links<\/td><\/tr><tr><td>alias<\/td><td>Create command shortcut<\/td><\/tr><tr><td>unalias<\/td><td>Remove command shortcut<\/td><\/tr><tr><td>cal<\/td><td>Display calendar<\/td><\/tr><tr><td>apt<\/td><td>Manage packages (Debian-based)<\/td><\/tr><tr><td>dnf<\/td><td>Manage packages (RHEL-based)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a data-click-id=\"hgr-post-content-link-vps-hosting\" aria-label=\"Vps hosting\" class=\"hgr-tutorials-cta hgr-tutorials-cta-vps-hosting\" href=\"\/vps-hosting\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h2 id=\"ls-command\" class=\"wp-block-heading h-t-title-2\">1. ls command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-ls-command\" href=\"\/tutorials\/ls-command\/\"><code>ls<\/code> command<\/a> displays files and directories within a specified location.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ls [options] [directory_or_path]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-a<\/code> \u2192 shows hidden files, including those starting with a dot (<code>.<\/code>)<br>\u2022 <code>-l<\/code> \u2192 displays a detailed list with permissions, ownership, size, and timestamps<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ls -Ra \/path\/to\/dir<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Lists all files and subdirectories recursively inside <code>\/path\/to\/dir<\/code>, including hidden files, allowing you to inspect the full directory structure.<\/p>\n\n\n\n<h2 id=\"pwd-command\" class=\"wp-block-heading h-t-title-2\">2. pwd command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>pwd<\/code> command prints the full path of the current working directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pwd [options]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-L<\/code> \u2192 prints the logical path using symbolic links or environment shortcuts<br>\u2022 <code>-P<\/code> \u2192 prints the physical path by resolving all symbolic links<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pwd -P<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays the exact directory path without symbolic links, helping verify the actual location of the current working directory.<\/p>\n\n\n\n<h2 id=\"cd-command\" class=\"wp-block-heading h-t-title-2\">3. cd command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>cd<\/code> command changes the current working directory to a specified location.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd [path_or_directory]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options: <em>(no options available for this command)<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Common shortcuts:<br>\u2022 <code>cd<\/code> \u2192 moves to the current user\u2019s home directory<br>\u2022 <code>cd ..<\/code> \u2192 moves one directory up<br>\u2022 <code>cd -<\/code> \u2192 returns to the previous directory<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/var\/www\/html<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Changes the current directory to <code>\/var\/www\/html<\/code>, allowing you to access and manage files in that location.<\/p>\n\n\n\n<h2 id=\"mkdir-command\" class=\"wp-block-heading h-t-title-2\">4. mkdir command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>mkdir<\/code> command creates one or more directories at a specified location.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir [options] directory_name1 directory_name2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-m<\/code> \u2192 sets custom permissions for the new directory (e.g., <code>-m 755<\/code>)<br>\u2022 <code>-p<\/code> \u2192 creates parent directories as needed and avoids errors if they already exist<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir -p \/path\/to\/target_folder\/new_folder<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Creates the directory <code>\/path\/to\/target_folder\/new_folder<\/code>, including any missing parent directories, allowing you to build nested folder structures in one command.<\/p>\n\n\n\n<h2 id=\"rmdir-command\" class=\"wp-block-heading h-t-title-2\">5. rmdir command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>mkdir<\/code> command creates one or more directories at a specified location.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir [options] directory_name1 directory_name2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-m<\/code> \u2192 sets custom permissions for the new directory (e.g., <code>-m 755<\/code>)<br>\u2022 <code>-p<\/code> \u2192 creates parent directories as needed and avoids errors if they already exist<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir -p \/path\/to\/target_folder\/new_folder<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Creates the directory <code>\/path\/to\/target_folder\/new_folder<\/code>, including any missing parent directories, allowing you to build nested folder structures in one command.<\/p>\n\n\n\n<h2 id=\"rm-command\" class=\"wp-block-heading h-t-title-2\">6. rm command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>rm<\/code> command removes files or directories from the file system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rm [options] file1 file2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-r<\/code> \u2192 removes directories and their contents recursively<br>\u2022 <code>-f<\/code> \u2192 forces deletion without confirmation prompts<br>\u2022 <code>-i<\/code> \u2192 prompts for confirmation before each removal<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rm -rf folder-name<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Deletes the directory <code>folder-name<\/code> and all its contents recursively without confirmation, which is useful for cleanup tasks but requires caution to avoid accidental data loss.<\/p>\n\n\n\n<h2 id=\"cp-command\" class=\"wp-block-heading h-t-title-2\">7. cp command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>cp<\/code> command copies files or directories from one location to another.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cp [options] source_file target_path<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-R<\/code> \u2192 copies directories and their contents recursively<br>\u2022 <code>-i<\/code> \u2192 prompts before overwriting existing files<br>\u2022 <code>-v<\/code> \u2192 displays detailed output of the copy process<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cp -R \/path\/to\/folder \/target\/path\/to\/folder_copy<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copies the directory <code>\/path\/to\/folder<\/code> and all its contents to <code>\/target\/path\/to\/folder_copy<\/code>, preserving the structure for backup or duplication tasks.<\/p>\n\n\n\n<h2 id=\"mv-command\" class=\"wp-block-heading h-t-title-2\">8. mv command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>mv<\/code> command moves or <a data-click-id=\"hgr-post-content-link-renames-files-and-directories\" href=\"\/tutorials\/how-to-rename-files-in-linux\/\">renames files and directories<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mv [options] source target<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-i<\/code> \u2192 prompts before overwriting existing files<br>\u2022 <code>-v<\/code> \u2192 displays detailed output of the move operation<br>\u2022 <code>-n<\/code> \u2192 prevents overwriting existing files<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mv \/original\/path\/file1.txt \/new\/file\/directory\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Moves <code>file1.txt<\/code> from <code>\/original\/path\/<\/code> to <code>\/new\/file\/directory\/<\/code>, allowing you to reorganize files or relocate them to a different folder.<\/p>\n\n\n\n<h2 id=\"touch-command\" class=\"wp-block-heading h-t-title-2\">9. touch command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-touch-command\" href=\"\/tutorials\/linux-touch-command\/\"><code>touch<\/code> command<\/a> creates a new empty file or updates the timestamp of an existing file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">touch [options] [path_and_file_name]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-c<\/code> \u2192 avoids creating a file if it does not exist<br>\u2022 <code>-t<\/code> \u2192 sets a specific timestamp for the file<br>\u2022 <code>-a<\/code> \u2192 updates only the access time<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">touch file.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Creates an empty file named <code>file.txt<\/code> in the current directory, allowing you to quickly generate placeholder or configuration files.<\/p>\n\n\n\n<h2 id=\"file-command\" class=\"wp-block-heading h-t-title-2\">10. file command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-file-command\" href=\"\/tutorials\/linux-file-command\/\"><code>file<\/code> command<\/a> identifies the type of a file based on its content.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">file [file_name]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-k<\/code> \u2192 displays additional information about the file type<br>\u2022 <code>-i<\/code> \u2192 shows the MIME type of the file<br>\u2022 <code>-L<\/code> \u2192 follows <a data-click-id=\"hgr-post-content-link-symbolic-links\" href=\"\/tutorials\/how-to-create-symbolic-links-in-linux\/\">symbolic links<\/a> and reports the actual file type<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">file hostinger_sym.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays the actual file type that <code>hostinger_sym.txt<\/code> points to, which helps verify symbolic links or detect unknown file formats.<\/p>\n\n\n\n<h2 id=\"zip-unzip-command\" class=\"wp-block-heading h-t-title-2\">11. zip and unzip commands<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>zip<\/code> command compresses files or directories into a ZIP archive, while the <code>unzip<\/code> command <a data-click-id=\"hgr-post-content-link-extracts-files-from-a-zip-archive\" href=\"\/tutorials\/how-to-unzip-files-linux\/\">extracts files from a ZIP archive<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">zip [options] zip_file_name file1 file2<br>unzip [options] zip_file_name<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-r<\/code> (zip) \u2192 compresses directories recursively<br>\u2022 <code>-e<\/code> (zip) \u2192 encrypts the archive with a password<br>\u2022 <code>-l<\/code> (unzip) \u2192 lists contents of the archive without extracting<br>\u2022 <code>-d<\/code> (unzip) \u2192 extracts files to a specified directory<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">zip -r archive.zip \/path\/to\/folder &amp;&amp; unzip archive.zip<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Creates a compressed archive <code>archive.zip<\/code> from <code>\/path\/to\/folder<\/code> and then extracts its contents into the current directory, allowing you to bundle and restore files efficiently.<\/p>\n\n\n\n<h2 id=\"tar-command\" class=\"wp-block-heading h-t-title-2\">12. tar command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-tar-command\" href=\"\/tutorials\/linux-tar-command-with-examples\/\"><code>tar<\/code> command<\/a> creates, extracts, and manages archive files that bundle multiple files or directories.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">tar [options] tar_file_name file1 file2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-c<\/code> \u2192 creates a new archive<br>\u2022 <code>-x<\/code> \u2192 extracts files from an archive<br>\u2022 <code>-f<\/code> \u2192 specifies the archive file name<br>\u2022 <code>-z<\/code> \u2192 compresses or decompresses using gzip<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">tar -czf archive.tar.gz file1.txt file2.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Creates a compressed archive <code>archive.tar.gz<\/code> containing <code>file1.txt<\/code> and <code>file2.txt<\/code>, allowing you to bundle and reduce file size in a single command.<\/p>\n\n\n\n<h2 id=\"nano-vi-jed-command\" class=\"wp-block-heading h-t-title-2\">13. nano, vi, and jed command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code><a data-click-id=\"hgr-post-content-link-nano\" href=\"\/tutorials\/how-to-install-and-use-nano-text-editor\/\">nano<\/a><\/code>, <code>vi<\/code>, and <code>jed<\/code> commands open and edit text files directly in the terminal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nano file_name<br>vi file_name<br>jed file_name<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options: <em>(no commonly used options required for basic file editing)<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nano file.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Opens <code>file.txt<\/code> in the Nano text editor, allowing you to create or modify file content directly from the terminal.<\/p>\n\n\n\n<h2 id=\"cat-command\" class=\"wp-block-heading h-t-title-2\">14. cat command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-cat-command\" href=\"\/tutorials\/linux-cat-command\/\"><code>cat<\/code> command<\/a> displays, combines, or creates files by reading and writing file content.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cat [options] file_name<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-n<\/code> \u2192 displays line numbers alongside file content<br>\u2022 <code>-b<\/code> \u2192 displays line numbers for non-empty lines only<br>\u2022 <code>-s<\/code> \u2192 suppresses repeated empty lines<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cat file1.txt file2.txt &gt; target.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Combines the contents of <code>file1.txt<\/code> and <code>file2.txt<\/code> into <code>target.txt<\/code>, allowing you to merge multiple files into a single output file.<\/p>\n\n\n\n<h2 id=\"grep-command\" class=\"wp-block-heading h-t-title-2\">15. grep command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-grep-command\" href=\"\/tutorials\/grep-command-in-linux\/\"><code>grep<\/code> command<\/a> searches for specific patterns or keywords within files or command output.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">grep [options] keyword [file]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-i<\/code> \u2192 performs a case-insensitive search<br>\u2022 <code>-r<\/code> \u2192 searches recursively through directories<br>\u2022 <code>-n<\/code> \u2192 displays line numbers with matching results<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ls | grep \"file.txt\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Filters the output of the <code>ls<\/code> command to show only entries that match <code>file.txt<\/code>, allowing you to quickly locate specific items in a list.<\/p>\n\n\n\n<h2 id=\"sed-command\" class=\"wp-block-heading h-t-title-2\">16. sed command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-sed-command\" href=\"\/tutorials\/linux-sed-command\/\"><code>sed<\/code> command<\/a> searches, replaces, and transforms text within files or input streams.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sed [options] 's\/pattern\/replacement\/' file<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-i<\/code> \u2192 edits files in place without creating a new output<br>\u2022 <code>-n<\/code> \u2192 suppresses automatic output (used with explicit print commands)<br>\u2022 <code>-e<\/code> \u2192 allows multiple editing expressions<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sed 's\/red\/blue\/' colors.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replaces the first occurrence of <code>red<\/code> with <code>blue<\/code> in each line of <code>colors.txt<\/code>, allowing quick text modifications without opening a file manually.<\/p>\n\n\n\n<h2 id=\"head-command\" class=\"wp-block-heading h-t-title-2\">17. head command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>head<\/code> command displays the first lines or bytes of a file or command output.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">head [options] file_name<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-n<\/code> \u2192 specifies the number of lines to display<br>\u2022 <code>-c<\/code> \u2192 specifies the number of bytes to display<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">head -n 5 file.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays the first five lines of <code>file.txt<\/code>, allowing you to quickly preview the beginning of a file without opening it fully.<\/p>\n\n\n\n<h2 id=\"tail-command\" class=\"wp-block-heading h-t-title-2\">18. tail command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-tail-command\" href=\"\/tutorials\/how-to-use-tail-command\/\"><code>tail<\/code> command<\/a> displays the last lines or bytes of a file or command output.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">tail [options] file_name<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-n<\/code> \u2192 specifies the number of lines to display<br>\u2022 <code>-c<\/code> \u2192 specifies the number of bytes to display<br>\u2022 <code>-f<\/code> \u2192 follows the file in real time as new lines are added<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ping -c 10 8.8.8.8 | tail -n 5<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays the last five lines of the <code>ping<\/code> command output, allowing you to focus on the most recent results or summaries.<\/p>\n\n\n\n<h2 id=\"awk-command\" class=\"wp-block-heading h-t-title-2\">19. awk command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-awk-command\" href=\"\/tutorials\/awk-command\/\"><code>awk<\/code> command<\/a> processes and analyzes text by applying patterns and actions to structured data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">awk 'pattern {action}' input_file<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-F<\/code> \u2192 specifies a custom field separator<br>\u2022 <code>-v<\/code> \u2192 assigns variables for use within the command<br>\u2022 <code>-f<\/code> \u2192 reads the <code>awk<\/code> program from a file<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">awk -F':' '{ total += $2; students[$1] = $2 } END { average = total \/ length(students); for (student in students) if (students[student] &gt; average) print student }' score.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Calculates the average value from <code>score.txt<\/code> and prints the names of entries with values above the average, allowing you to perform data analysis directly in the terminal.<\/p>\n\n\n\n<h2 id=\"sort-command\" class=\"wp-block-heading h-t-title-2\">20. sort command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>sort<\/code> command arranges lines of text in a file or input stream in a specified order.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sort [options] [file_name]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-r<\/code> \u2192 sorts in reverse order<br>\u2022 <code>-n<\/code> \u2192 sorts numerically instead of alphabetically<br>\u2022 <code>-k<\/code> \u2192 sorts based on a specific column or field<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sort -n file.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sorts the contents of <code>file.txt<\/code> numerically and prints the result to the terminal without modifying the original file.<\/p>\n\n\n\n<h2 id=\"cut-command\" class=\"wp-block-heading h-t-title-2\">21. cut command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-cut-command\" href=\"\/tutorials\/linux-cut-command\/\"><code>cut<\/code> command<\/a> extracts specific sections of text from each line of a file or input stream.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cut [options] file<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-f<\/code> \u2192 selects specific fields (columns)<br>\u2022 <code>-d<\/code> \u2192 specifies a delimiter to separate fields<br>\u2022 <code>-c<\/code> \u2192 extracts specific character positions<br>\u2022 <code>-b<\/code> \u2192 extracts specific byte ranges<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cut -d',' -f3-5 list.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Extracts the third to fifth fields from each line in <code>list.txt<\/code> using a comma as the delimiter, allowing you to isolate structured data from files like CSVs.<\/p>\n\n\n\n<h2 id=\"diff-command\" class=\"wp-block-heading h-t-title-2\">22. diff command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>diff<\/code> command compares two files and displays the differences between them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">diff [options] file_name1 file_name2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-c<\/code> \u2192 displays differences in context format with surrounding lines<br>\u2022 <code>-u<\/code> \u2192 shows unified output format (commonly used for patches)<br>\u2022 <code>-i<\/code> \u2192 ignores differences in letter case<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">diff -c 1.txt 2.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays the differences between <code>1.txt<\/code> and <code>2.txt<\/code> with surrounding context, making it easier to understand changes between file versions.<\/p>\n\n\n\n<h2 id=\"tee-command\" class=\"wp-block-heading h-t-title-2\">23. tee command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-tee-command\" href=\"\/tutorials\/linux-tee-command-with-examples\/\"><code>tee<\/code> command<\/a> writes command output to both the terminal and a file simultaneously.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">command | tee [options] file_name<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-a<\/code> \u2192 appends output to the file instead of overwriting it<br>\u2022 <code>-i<\/code> \u2192 ignores interrupt signals (useful in pipelines)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ping 8.8.8.8 | tee -a test_network.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Appends the output of the <code>ping<\/code> command to <code>test_network.txt<\/code> while displaying it in the terminal, allowing you to monitor and save results at the same time.<\/p>\n\n\n\n<h2 id=\"locate-command\" class=\"wp-block-heading h-t-title-2\">24. locate command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-locate-command\" href=\"\/tutorials\/how-to-use-find-and-locate-commands-in-linux\/\"><code>locate<\/code> command<\/a> searches for files by name using a prebuilt system database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">locate [options] keyword<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-i<\/code> \u2192 performs a case-insensitive search<br>\u2022 <code>-r<\/code> \u2192 searches using a regular expression<br>\u2022 <code>-n<\/code> \u2192 limits the number of results displayed<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">locate -i filename.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Searches for all files matching <code>filename.txt<\/code> regardless of case, returning results quickly based on the system\u2019s file index.<\/p>\n\n\n\n<h2 id=\"find-command\" class=\"wp-block-heading h-t-title-2\">25. find command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>find<\/code> command searches for files and directories in a specified path based on conditions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">find [path] [options] expression<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-name<\/code> \u2192 searches for items by name<br>\u2022 <code>-type f<\/code> \u2192 limits results to files<br>\u2022 <code>-type d<\/code> \u2192 limits results to directories<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">find \/path\/to\/folder -type f -name \"file.txt\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Searches for a file named <code>file.txt<\/code> within <code>\/path\/to\/folder<\/code>, returning matches in real time based on the specified criteria.<\/p>\n\n\n\n<h2 id=\"sudo-command\" class=\"wp-block-heading h-t-title-2\">26. sudo command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-sudo-command\" href=\"\/tutorials\/sudo-and-the-sudoers-file\/\"><code>sudo<\/code> command<\/a> runs a command with elevated (administrator) privileges.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo [options] command<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-u<\/code> \u2192 runs the command as a specified user<br>\u2022 <code>-i<\/code> \u2192 starts a shell with root privileges<br>\u2022 <code>-l<\/code> \u2192 lists allowed commands for the current user<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo nano file.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Opens <code>file.txt<\/code> in the Nano editor with administrator privileges, allowing you to modify system-level files that require elevated access.<\/p>\n\n\n\n<h2 id=\"su-whoami-command\" class=\"wp-block-heading h-t-title-2\">27. su and whoami commands<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>su<\/code> command switches the current user to another user account, while the <code>whoami<\/code> command displays the currently logged-in user.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">su [options] [username]<br>whoami<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-<\/code> \u2192 starts a login shell for the target user<br>\u2022 <code>-c<\/code> \u2192 runs a single command as the specified user<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">su - root<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"block-153b747b-1ee1-481f-ae5a-05c0cfc3c973\">Switches to the root user and starts a login shell, allowing you to execute commands with full system privileges.<\/p>\n\n\n\n<h2 id=\"chmod-command\" class=\"wp-block-heading h-t-title-2\">28. chmod command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-chmod-command\" href=\"\/tutorials\/how-to-change-linux-permissions-and-owners\/\"><code>chmod<\/code> command<\/a> changes file and directory permissions for users, groups, and others.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">chmod [options] permissions file_or_directory<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-R<\/code> \u2192 applies changes recursively to directories and their contents<br>\u2022 <code>-v<\/code> \u2192 displays a message for each processed file<br>\u2022 <code>-c<\/code> \u2192 reports only when a change is made<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">chmod 744 file1.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sets permissions for <code>file1.txt<\/code> so the owner can read, write, and execute, while others can only read, allowing controlled access to the file.<\/p>\n\n\n\n<h2 id=\"chown-command\" class=\"wp-block-heading h-t-title-2\">29. chown command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-chown-command\" href=\"\/tutorials\/linux-chown-command\/\"><code>chown<\/code> command<\/a> changes the ownership of files and directories.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">chown [options] owner:group file1 file2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-R<\/code> \u2192 applies ownership changes recursively<br>\u2022 <code>-v<\/code> \u2192 displays a message for each processed file<br>\u2022 <code>-c<\/code> \u2192 reports only when a change is made<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">chown admin-vps:developers file1.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sets <code>admin-vps<\/code> as the owner and <code>developers<\/code> as the group for <code>file1.txt<\/code>, allowing proper access control and file management.<\/p>\n\n\n\n<h2 id=\"useradd-passwd-userdel-command\" class=\"wp-block-heading h-t-title-2\">30. useradd, passwd, and userdel command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>useradd<\/code> command creates a new user account, the <a data-click-id=\"hgr-post-content-link-passwd-command\" href=\"\/tutorials\/how-to-change-password-in-linux\/\"><code>passwd<\/code> command<\/a> sets or updates a user\u2019s password, and the <code>userdel<\/code> command removes a user account.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">useradd [options] username<br>passwd username<br>userdel [options] username<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-m<\/code> (useradd) \u2192 creates a home directory for the user<br>\u2022 <code>-r<\/code> (userdel) \u2192 removes the user\u2019s home directory and files<br>\u2022 <code>-l<\/code> (passwd) \u2192 locks a user account<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo useradd -m newuser &amp;&amp; sudo passwd newuser<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Creates a new user <code>newuser<\/code> with a home directory and sets a password, allowing the account to log in and use the system.<\/p>\n\n\n\n<h2 id=\"df-command\" class=\"wp-block-heading h-t-title-2\">31. df command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-df-command\" href=\"\/tutorials\/how-to-check-disk-space-in-linux\/\"><code>df<\/code> command<\/a> displays disk space usage for file systems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df [options] [file_system]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-h<\/code> \u2192 shows output in human-readable format (KB, MB, GB)<br>\u2022 <code>-T<\/code> \u2192 displays the file system type<br>\u2022 <code>-a<\/code> \u2192 includes all file systems, including empty ones<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">df -h<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays disk usage for all mounted file systems in a human-readable format, helping you quickly assess available and used storage space.<\/p>\n\n\n\n<h2 id=\"du-command\" class=\"wp-block-heading h-t-title-2\">32. du command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>du<\/strong> command checks the size of a directory and its content. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">du [directory]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The command will check your working directory if you don\u2019t specify a path or folder. By default, it breaks down each subfolder\u2019s disk usage, but you can add the <strong>-s<\/strong> option to summarize the total usage in one output.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also use the <strong>-M<\/strong> option to change the information from <strong>KB<\/strong> to <strong>MB<\/strong>.<\/p>\n\n\n\n<h2 id=\"top--command\" class=\"wp-block-heading h-t-title-2\">33. top command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>top<\/code> command displays real-time information about running processes and system resource usage.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">top [options]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-p<\/code> \u2192 monitors a specific process by its ID (PID)<br>\u2022 <code>-d<\/code> \u2192 sets the delay between screen updates<br>\u2022 <code>-u<\/code> \u2192 shows processes for a specific user<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">top -u root<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays real-time resource usage for processes owned by the <code>root<\/code> user, helping you monitor system performance and identify resource-heavy tasks.<\/p>\n\n\n\n<h2 id=\"htop-command\" class=\"wp-block-heading h-t-title-2\">34. htop command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-htop-command\" href=\"\/tutorials\/how-to-list-processes-in-linux\/\"><code>htop<\/code> command<\/a> displays and manages running processes in an interactive interface.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">htop [options]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-d<\/code> \u2192 sets the update interval<br>\u2022 <code>-u<\/code> \u2192 shows processes for a specific user<br>\u2022 <code>--tree<\/code> \u2192 displays processes in a hierarchical tree view<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">htop<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Opens an interactive process viewer that shows CPU and memory usage, allowing you to navigate, filter, and manage processes in real time.<\/p>\n\n\n\n<h2 id=\"ps-command\" class=\"wp-block-heading h-t-title-2\">35. ps command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>ps<\/code> command displays a snapshot of currently running processes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ps [options]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-A<\/code> \u2192 shows all running processes<br>\u2022 <code>-u<\/code> \u2192 displays processes for a specific user<br>\u2022 <code>-r<\/code> \u2192 lists only running processes<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ps -A<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays all active processes on the system at a specific moment, allowing you to inspect process IDs, statuses, and resource usage.<\/p>\n\n\n\n<h2 id=\"uname-command\" class=\"wp-block-heading h-t-title-2\">36. uname command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>uname<\/code> command displays system information such as the kernel, architecture, and operating system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">uname [options]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-a<\/code> \u2192 displays all available system information<br>\u2022 <code>-r<\/code> \u2192 shows the kernel release version<br>\u2022 <code>-m<\/code> \u2192 displays the machine hardware architecture<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">uname -a<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays complete system information, including kernel version and architecture, helping you identify your Linux environment.<\/p>\n\n\n\n<h2 id=\"hostname-command\" class=\"wp-block-heading h-t-title-2\">37. hostname command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>hostname<\/code> command displays or sets the system\u2019s hostname.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">hostname [options]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-i<\/code> \u2192 displays the IP address of the host<br>\u2022 <code>-a<\/code> \u2192 shows the hostname alias<br>\u2022 <code>-A<\/code> \u2192 displays the fully qualified domain name (FQDN)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">hostname -A<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays the system\u2019s fully qualified domain name, helping identify the server within a network or domain.<\/p>\n\n\n\n<h2 id=\"time-command\" class=\"wp-block-heading h-t-title-2\">38. time command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-time-command\" href=\"\/tutorials\/linux-time-command\/\"><code>time<\/code> command<\/a> measures how long a command or script takes to execute.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">time command<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options: <em>(no commonly used options required for basic usage)<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">time ls -la<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Measures how long the <code>ls -la<\/code> command takes to run, providing execution time details such as real, user, and system time.<\/p>\n\n\n\n<h2 id=\"systemctl-command\" class=\"wp-block-heading h-t-title-2\">39. systemctl command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The<strong> systemctl<\/strong> command manages services in your Linux system. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl subcommand [service_name][options]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The subcommands represent your task, like listing, restarting, terminating, or enabling the services. For example, we will <a data-click-id=\"hgr-post-content-link-list-linux-services\" href=\"\/tutorials\/manage-and-list-services-in-linux\/\">list Linux services<\/a> using this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl list-unit-files --type service --all<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note that this command might not work with older distributions since they use another service manager.<\/p>\n\n\n\n<h2 id=\"watch-command\" class=\"wp-block-heading h-t-title-2\">40. watch command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-watch-command\" href=\"\/tutorials\/linux-watch-command\/\"><code>watch<\/code> command<\/a> runs a command repeatedly at specified intervals and displays the updated output.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">watch [options] command<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-n<\/code> \u2192 sets the interval in seconds between executions<br>\u2022 <code>-d<\/code> \u2192 highlights changes between updates<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">watch -n 5 netstat<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Runs the <code>netstat<\/code> command every five seconds and updates the output, allowing you to monitor changes in network activity over time.<\/p>\n\n\n\n<h2 id=\"jobs-command\" class=\"wp-block-heading h-t-title-2\">41. jobs command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>jobs<\/code> command lists background and suspended jobs in the current shell session.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">jobs [options] [job_id]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-l<\/code> \u2192 displays job IDs along with process IDs<br>\u2022 <code>-n<\/code> \u2192 shows only jobs that have changed status<br>\u2022 <code>-p<\/code> \u2192 lists only process IDs<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">jobs -l<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays all jobs in the current shell with their process IDs, allowing you to monitor and manage background tasks.<\/p>\n\n\n\n<h2 id=\"kill-command\" class=\"wp-block-heading h-t-title-2\">42. kill command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-kill-command\" href=\"\/tutorials\/how-to-kill-a-process-in-linux\/\"><code>kill<\/code> command<\/a> sends a signal to terminate or control a process by its process ID (PID).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">kill [signal] process_id<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-15<\/code> \u2192 sends the default SIGTERM signal for graceful termination<br>\u2022 <code>-9<\/code> \u2192 sends SIGKILL to forcefully terminate a process<br>\u2022 <code>-l<\/code> \u2192 lists all available signals<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">kill -9 1234<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Forcefully terminates the process with ID <code>1234<\/code>, which is useful when a program becomes unresponsive.<\/p>\n\n\n\n<h2 id=\"shutdown-command\" class=\"wp-block-heading h-t-title-2\">43. shutdown command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-shutdown-command\" href=\"\/tutorials\/linux-shutdown-command\/\"><code>shutdown<\/code> command<\/a> powers off or restarts the system at a specified time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">shutdown [options] [time] [message]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-r<\/code> \u2192 restarts the system instead of shutting it down<br>\u2022 <code>-h<\/code> \u2192 halts or powers off the system<br>\u2022 <code>-c<\/code> \u2192 cancels a scheduled shutdown<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">shutdown -r +5<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Schedules a system restart in five minutes, allowing users to prepare before the system goes offline.<\/p>\n\n\n\n<h2 id=\"ping-command\" class=\"wp-block-heading h-t-title-2\">44. ping command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-ping-command\" href=\"\/tutorials\/linux-ping-command-with-examples\/\"><code>ping<\/code> command<\/a> sends network packets to a target host and measures the response time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ping [options] [hostname_or_ip]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-c<\/code> \u2192 specifies the number of packets to send<br>\u2022 <code>-i<\/code> \u2192 sets the interval between packets<br>\u2022 <code>-s<\/code> \u2192 defines the packet size<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ping -c 15 -i 2 google.com<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sends 15 packets to <code>google.com<\/code> at two-second intervals, allowing you to test connectivity and measure network latency.<\/p>\n\n\n\n<h2 id=\"wget-command\" class=\"wp-block-heading h-t-title-2\">45. wget command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-wget-command\" href=\"\/tutorials\/wget-command-examples\/\"><code>wget<\/code> command<\/a> downloads files from the internet using HTTP, HTTPS, or FTP protocols.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wget [options] [url]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-O<\/code> \u2192 saves the file with a custom name<br>\u2022 <code>-c<\/code> \u2192 resumes a partially downloaded file<br>\u2022 <code>-q<\/code> \u2192 runs in quiet mode without output<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wget https:\/\/wordpress.org\/latest.zip<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Downloads the file from the specified URL to the current directory, allowing you to retrieve remote resources directly from the terminal.<\/p>\n\n\n\n<h2 id=\"curl-command\" class=\"wp-block-heading h-t-title-2\">46. cURL command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-curl-command\" href=\"\/tutorials\/curl-command\/\"><code>curl<\/code> command<\/a> transfers data to or from a server using a specified URL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl [options] url<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-O<\/code> \u2192 downloads a file and saves it with its original name<br>\u2022 <code>-o<\/code> \u2192 saves the file with a custom name<br>\u2022 <code>-X<\/code> \u2192 specifies the HTTP method (GET, POST, PUT, DELETE)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -X GET https:\/\/api.example.com\/endpoint<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sends a GET request to the specified API endpoint and returns the response, allowing you to test APIs or retrieve remote data directly from the terminal.<\/p>\n\n\n\n<h2 id=\"scp-command\" class=\"wp-block-heading h-t-title-2\">47. scp command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-scp-command\" href=\"\/tutorials\/linux-scp-command\/\"><code>scp<\/code> command<\/a> securely copies files and directories between local and remote systems over SSH.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">scp [options] source destination<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-P<\/code> \u2192 specifies a custom SSH port<br>\u2022 <code>-r<\/code> \u2192 copies directories recursively<br>\u2022 <code>-C<\/code> \u2192 enables compression during transfer<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">scp file1.txt root@185.185.185.185:\/path\/to\/folder<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copies <code>file1.txt<\/code> from the local machine to the remote server at <code>\/path\/to\/folder<\/code>, allowing secure file transfer between systems.<\/p>\n\n\n\n<h2 id=\"rsync-command\" class=\"wp-block-heading h-t-title-2\">48. rsync command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-rsync-command\" href=\"\/tutorials\/how-to-use-rsync\/\"><code>rsync<\/code> command<\/a> synchronizes files and directories between locations while minimizing data transfer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rsync [options] source destination<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-a<\/code> \u2192 preserves file attributes (permissions, timestamps, symbolic links)<br>\u2022 <code>-z<\/code> \u2192 compresses data during transfer<br>\u2022 <code>-v<\/code> \u2192 displays detailed transfer output<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rsync -avz \/path\/to\/local\/folder\/ vps-user@185.185.185.185:\/path\/to\/remote\/folder\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Synchronizes the local folder with the remote directory while preserving attributes and compressing data, resulting in faster, more efficient transfers.<\/p>\n\n\n\n<h2 id=\"ip-command\" class=\"wp-block-heading h-t-title-2\">49. ip command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>ip<\/code> command displays and manages network interfaces, addresses, and routing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ip [options] object command<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>address<\/code> \u2192 manages and displays IP addresses<br>\u2022 <code>link<\/code> \u2192 manages network interfaces<br>\u2022 <code>route<\/code> \u2192 displays or modifies routing tables<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ip address show<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays all network interfaces and their assigned IP addresses, helping you inspect and troubleshoot network configuration.<\/p>\n\n\n\n<h2 id=\"netstat-command\" class=\"wp-block-heading h-t-title-2\">50. netstat command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-netstat-command\" href=\"\/tutorials\/netstat-command\/\"><code>netstat<\/code> command<\/a> displays network connections, routing tables, and interface statistics.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">netstat [options]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-a<\/code> \u2192 shows all connections, including listening sockets<br>\u2022 <code>-t<\/code> \u2192 displays TCP connections<br>\u2022 <code>-u<\/code> \u2192 displays UDP connections<br>\u2022 <code>-r<\/code> \u2192 shows routing tables<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">netstat -tuln<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays all listening TCP and UDP ports, helping you identify active network services and open ports.<\/p>\n\n\n\n<h2 id=\"traceroute-command\" class=\"wp-block-heading h-t-title-2\">51. traceroute command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-traceroute-command\" href=\"\/tutorials\/traceroute-command\/\"><code>traceroute<\/code> command<\/a> tracks the path packets take to reach a destination host.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">traceroute [options] destination<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-m<\/code> \u2192 sets the maximum number of hops<br>\u2022 <code>-n<\/code> \u2192 disables DNS resolution for faster output<br>\u2022 <code>-w<\/code> \u2192 sets the timeout in seconds for each response<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">traceroute google.com<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays each hop between your system and <code>google.com<\/code>, helping you identify network delays or routing issues.<\/p>\n\n\n\n<h2 id=\"nslookup-command\" class=\"wp-block-heading h-t-title-2\">52. nslookup command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>nslookup<\/code> command queries <a data-click-id=\"hgr-post-content-link-dns\" href=\"\/tutorials\/what-is-dns\/\">DNS<\/a> servers to retrieve domain or IP address information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nslookup [options] domain_or_ip [dns_server]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-type=<\/code> \u2192 specifies the DNS record type (e.g., A, MX, TXT)<br>\u2022 <code>-retry=<\/code> \u2192 sets the number of query retries<br>\u2022 <code>-port=<\/code> \u2192 uses a specific DNS server port<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nslookup -type=MX example.com<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Retrieves the mail exchange (MX) records for <code>example.com<\/code>, helping you inspect DNS configuration and troubleshoot domain-related issues.<\/p>\n\n\n\n<h2 id=\"dig-command\" class=\"wp-block-heading h-t-title-2\">53. dig command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-dig-command\" href=\"\/tutorials\/linux-dig-command\/\"><code>dig<\/code> command<\/a> queries DNS records and provides detailed information about a domain or IP address.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dig [options] [server] [type] name_or_ip<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-x<\/code> \u2192 performs a reverse DNS lookup<br>\u2022 <code>+short<\/code> \u2192 displays a concise output<br>\u2022 <code>@server<\/code> \u2192 queries a specific DNS server<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dig MX domain.com<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Retrieves the mail exchange (MX) records for <code>domain.com<\/code>, helping you analyze DNS configuration and troubleshoot domain resolution issues.<\/p>\n\n\n\n<h2 id=\"history-command\" class=\"wp-block-heading h-t-title-2\">54. history command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>history<\/code> command displays a list of previously executed commands in the current shell session.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">history [options]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-c<\/code> \u2192 clears the command history<br>\u2022 <code>-r<\/code> \u2192 reads the history file and appends it to the current session<br>\u2022 <code>-d<\/code> \u2192 deletes a specific entry by its ID<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">!145<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Re-executes the command with ID <code>145<\/code> from the history list, allowing you to quickly repeat previously used commands.<\/p>\n\n\n\n<h2 id=\"man-command\" class=\"wp-block-heading h-t-title-2\">55. man command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>man<\/code> command displays the manual page for a specified command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">man [options] [section_number] command_name<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-k<\/code> \u2192 searches manuals for keywords<br>\u2022 <code>-f<\/code> \u2192 displays a short description of a command<br>\u2022 <code>-a<\/code> \u2192 shows all available manual pages for a command<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">man 3 ls<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays the section 3 manual page for <code>ls<\/code>, allowing you to access detailed documentation for specific command categories.<\/p>\n\n\n\n<h2 id=\"echo-command\" class=\"wp-block-heading h-t-title-2\">56. echo command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>echo<\/code> command outputs text or variables to the terminal or a file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo [options] [text]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-n<\/code> \u2192 removes the trailing newline from output<br>\u2022 <code>-e<\/code> \u2192 enables interpretation of escape sequences (e.g., <code>\\n<\/code>, <code>\\t<\/code>)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo \"Hello World\" &gt; file.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Writes <code>Hello World<\/code> to <code>file.txt<\/code>, allowing you to create or overwrite files with custom text output.<\/p>\n\n\n\n<h2 id=\"ln-command\" class=\"wp-block-heading h-t-title-2\">57. ln command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>ln<\/code> command creates links between files, including symbolic (soft) and hard links.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ln [options] source target<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-s<\/code> \u2192 creates a symbolic (soft) link<br>\u2022 <code>-f<\/code> \u2192 forces creation by overwriting existing files<br>\u2022 <code>-v<\/code> \u2192 displays detailed output of the operation<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ln -s target.txt shortcut.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Creates a symbolic link named <code>shortcut.txt<\/code> that points to <code>target.txt<\/code>, allowing you to access the file using an alternative path.<\/p>\n\n\n\n<h2 id=\"alias-unalias-command\" class=\"wp-block-heading h-t-title-2\">58. alias and unalias commands<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a data-click-id=\"hgr-post-content-link-alias-command\" href=\"\/tutorials\/linux-alias-command\/\"><code>alias<\/code> command<\/a> creates a shortcut for a command, while the <code>unalias<\/code> command removes an existing alias.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">alias name='command'<br>unalias name<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <em>(no commonly used options required for basic usage)<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">alias k='kill'<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Creates an alias <code>k<\/code> for the <code>kill<\/code> command, allowing you to run <code>kill<\/code> using a shorter keyword.<\/p>\n\n\n\n<h2 id=\"cal-command\" class=\"wp-block-heading h-t-title-2\">59. cal command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>cal<\/code> command displays a calendar for a specified month or year.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cal [options] [month] 2026<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>-3<\/code> \u2192 displays the previous, current, and next month<br>\u2022 <code>-y<\/code> \u2192 shows the entire year<br>\u2022 <code>-m<\/code> \u2192 displays Monday as the first day of the week<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cal -3<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Displays the previous, current, and next month, allowing you to view nearby dates at a glance.<\/p>\n\n\n\n<h2 id=\"apt-dnf-command\" class=\"wp-block-heading h-t-title-2\">60. apt and dnf command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>apt<\/code> command manages packages on Debian-based systems, while the <code>dnf<\/code> command manages packages on Red Hat-based systems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt [options] subcommand<br>dnf [options] subcommand<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common options:<br>\u2022 <code>install<\/code> \u2192 installs a package<br>\u2022 <code>remove<\/code> \u2192 removes a package<br>\u2022 <code>update<\/code> \u2192 updates package lists<br>\u2022 <code>upgrade<\/code> \u2192 upgrades installed packages<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install vim<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Installs the <code>vim<\/code> text editor using the APT package manager, allowing you to add new software to the system.<\/p>\n\n\n\n<h2 id=\"h-common-errors-when-running-linux-commands-and-how-to-fix-them\" class=\"wp-block-heading h-t-title-2\">Common errors when running Linux commands (and how to fix them)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When running Linux commands, errors often occur due to incorrect syntax, missing permissions, or invalid file paths. Understanding these common issues helps you quickly identify the cause and apply the correct fix without interrupting your workflow.<\/p>\n\n\n\n<h3 class=\"wp-block-heading h-t-title-3\">&#8220;command not found&#8221;<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This error means the shell cannot locate the command you entered. It usually occurs for one of three reasons:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The package is not installed. Install it using your package manager (for example, <code>sudo apt install &lt;package&gt;<\/code> on Debian\/Ubuntu or <code>sudo dnf install &lt;package&gt;<\/code> on RHEL-based systems).<\/li>\n\n\n\n<li>The command is not in your PATH. Check its location with <code>which &lt;command&gt;<\/code>. If it exists outside your PATH, add its directory:<br><code>export PATH=$PATH:\/path\/to\/dir<\/code><\/li>\n\n\n\n<li>The command contains a typo. Linux is case-sensitive, so <code>LS<\/code> and <code>ls<\/code> are treated as different commands. Verify spelling and capitalization.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading h-t-title-3\">&#8220;Permission denied&#8221;<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This error indicates that your user account lacks the required permissions to run a command or access a file.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Run the command with elevated privileges:<br><code>sudo &lt;command&gt;<\/code><\/li>\n\n\n\n<li>Modify file permissions if needed:<br><code>chmod +x file.sh<\/code> \u2192 makes a script executable<br><code>chmod 644 file.txt<\/code> \u2192 sets read\/write for owner and read-only for others<\/li>\n\n\n\n<li>If ownership is the issue, update it:<br><code>chown &lt;user&gt;:&lt;group&gt; &lt;file&gt;<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading h-t-title-3\">&#8220;No such file or directory&#8221;<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This error means the specified file or path does not exist from your current location.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check your current directory:<br><code>pwd<\/code><\/li>\n\n\n\n<li>List available files:<br><code>ls<\/code><\/li>\n\n\n\n<li>Verify the path and filename for typos. Linux uses forward slashes (<code>\/<\/code>) and is case-sensitive, so even small differences will break the command.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading h-t-title-3\">Command runs but does nothing visible<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Some Linux commands do not produce output when they succeed. This behavior is intentional.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Commands like <code>touch<\/code>, <code>cp<\/code>, or <code>mv<\/code> return silently if successful<\/li>\n\n\n\n<li>Verify the result manually using:<br><code>ls<\/code>, <code>cat<\/code>, or similar commands<\/li>\n\n\n\n<li>To see detailed output, use verbose flags where available:<br><code>cp -v<\/code>, <code>rm -v<\/code><\/li>\n<\/ul>\n\n\n\n<h2 id=\"h-what-should-you-learn-next-after-mastering-linux-commands\" class=\"wp-block-heading h-t-title-2\">What should you learn next after mastering Linux commands?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Mastering Linux commands enables you to efficiently manage a remote virtual private server from the terminal. If you regularly connect to and manage servers remotely, learning <a data-click-id=\"hgr-post-content-link-basic-ssh-commands\" href=\"\/tutorials\/basic-ssh-commands\/\">basic SSH commands<\/a> will help you handle connections, SSH keys, file transfers, tunneling, and common connection issues. You can then build on these skills by learning how to write Bash scripts to automate repetitive tasks.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Automation and efficiency<\/strong>. A Bash script combines multiple commands into a single executable file, allowing you to automate multi-step tasks using a single execution.&nbsp;<\/li>\n\n\n\n<li><strong>Consistency and reduced human error. <\/strong>Commands in a Bash script always run and behave consistently across executions, which significantly reduces human error.<\/li>\n\n\n\n<li><strong>Reusability<\/strong>. Developers can easily copy and transport Bash scripts to different UNIX operating systems, making it easy to replicate tasks in other environments.&nbsp;&nbsp;<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Given its importance, learning how to create a Bash script is the natural next step for aspiring system administrators after mastering various Linux commands.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Linux command is a text instruction entered in the terminal to make the operating system perform a specific task, [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/tutorials\/linux-commands\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":337,"featured_media":81831,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"60 essential Linux commands with syntax &amp; examples","rank_math_description":"Master 60 essential Linux commands with syntax, options, examples, and troubleshooting tips. Covers file operations, networking, system monitoring, and more.","rank_math_focus_keyword":"linux commands","_content_updated_date":"2025-12-16","footnotes":""},"categories":[22644,22648],"tags":[],"class_list":["post-18297","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps","category-managing-monitoring-and-security"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/linux-commands","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/comandos-linux\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/commandes-linux\/","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/linux-comandos\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/perintah-dasar-linux\/","default":0},{"locale":"de-DE","link":"https:\/\/www.hostinger.com\/de\/tutorials\/linux-befehle\/","default":0},{"locale":"it-IT","link":"https:\/\/www.hostinger.com\/it\/tutorial\/comandi-linux\/","default":0},{"locale":"nl-NL","link":"https:\/\/www.hostinger.com\/nl\/tutorials\/linux-commands\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/linux-commands","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/linux-commands","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/linux-commands","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/linux-commands","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/linux-commands","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/linux-commands","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/linux-commands","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/linux-comandos\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/linux-comandos\/","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/linux-comandos\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/comandos-linux\/","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/18297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/users\/337"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/comments?post=18297"}],"version-history":[{"count":122,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/18297\/revisions"}],"predecessor-version":[{"id":155995,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/18297\/revisions\/155995"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/media\/81831"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/media?parent=18297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/categories?post=18297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/tags?post=18297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}