{"id":6589,"date":"2020-12-17T08:21:40","date_gmt":"2020-12-17T08:21:40","guid":{"rendered":"https:\/\/www.temok.com\/blog\/?p=6589"},"modified":"2026-04-20T15:05:36","modified_gmt":"2026-04-20T11:05:36","slug":"400-linux-basic-commands-you-should-know","status":"publish","type":"post","link":"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/","title":{"rendered":"400+ Linux Basic Commands You Should Know"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> 18<\/span> <span class=\"rt-label rt-postfix\">min read<\/span><\/span>\r\n<p>When people hear the word \u201cLinux\u201d they think it is a complicated OS (Operating System) that is only used by hackers or programmers. But it is not as scary as it seems. Linux is a family of open-source Unix operating systems based on the Linux kernel such as Ubuntu, Fedora, Mint, Debian, and others. Moreover, you can also call them <a class=\"aioseop-link\" href=\"https:\/\/blog.temok.com\/linux-distros\/\" target=\"_blank\" rel=\"noopener\">Linux distributions or distros<\/a>. If you are using a Linux-based OS, you should know the Linux basic commands to operate and manage different operations.<\/p>\r\n\r\n\r\n\r\n<p>Linux was initially released in 1991, it has continued to gain popularity because of its open-source nature. Anyone can redistribute or modify under their name.<\/p>\r\n\r\n\r\n\r\n<p>If you are a Linux user, you have to use a shell (an interface that allows you to access the services of the operating system). Nowadays, most of the Linux operating systems come with a graphical user interface (GUI) as their shell to provide simple and easy access to their users.<\/p>\r\n\r\n\r\n\r\n<p>It is highly recommended to use a CLI (Command Line Interface) because of its effectiveness. You can do multi-step processes by typing commands within a second.<\/p>\r\n\r\n\r\n\r\n<p>In this article, I am going to discuss 400+ Linux basic commands that will undoubtedly help you navigate through Linux as a newbie.<\/p>\r\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69fabfdd0b12b\" class=\"ez-toc-cssicon-toggle-label\"><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><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69fabfdd0b12b\"  aria-label=\"Toggle\" \/><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:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#400_Linux_Basic_Commands\" >400+ Linux Basic Commands<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#System_Information_Commands\" >System Information Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Shutdown_Reboot_System_or_Log_Out_Commands\" >Shutdown (Reboot System or Log Out) Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Files_And_Directories_Commands\" >Files And Directories Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Find_Files_Commands\" >Find Files Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Mounting_a_Filesystem_Commands\" >Mounting a Filesystem Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Disk_Space_Commands\" >Disk Space Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Users_and_Groups_Command\" >Users and Groups Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Permissions_in_Files_Use_%E2%80%9C%E2%80%9D_to_place_permissions_and_%E2%80%9C-%E2%80%9D_to_remove_Commands\" >Permissions in Files (Use &#8220;+&#8221; to place permissions and &#8220;-&#8221; to remove) Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Special_Attributes_in_files_Use_%E2%80%9C%E2%80%9D_to_set_permissions_and_%E2%80%9C-%E2%80%9D_to_remove_Commands\" >Special Attributes in files (Use &#8220;+&#8221; to set permissions and &#8220;-&#8221; to remove) Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Archives_And_compressed_Files_Commands\" >Archives And compressed Files Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#RPM_packages_Red_Hat_Fedora_and_similar_Commands\" >RPM packages (Red Hat, Fedora, and similar) Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#YUM_Package_Updater_Red_Hat_Fedora_and_similar_Commands\" >YUM Package Updater (Red Hat, Fedora, and similar) Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Deb_packages_Debian_Ubuntu_and_derivatives_Commands\" >Deb packages (Debian, Ubuntu, and derivatives) Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#APT_Package_Updater_Debian_Ubuntu_and_derivatives_Commands\" >APT Package Updater (Debian, Ubuntu, and derivatives) Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#View_The_Content_of_a_File_Commands\" >View The Content of a File Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Text_Manipulation_Commands\" >Text Manipulation Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Set_Character_And_File_Conversion_Commands\" >Set Character And File Conversion Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#File_System_Analysis_Commands\" >File System Analysis Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Format_a_filesystem_Commands\" >Format a filesystem Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Working_With_the_SWAP_Commands\" >Working With the SWAP Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Salvas_Backup_Commands\" >Salvas (Backup) Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#CD_ROM_Commands\" >CD ROM Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Work_With_The_NETWORK_LAN_and_Wi-Fi_Commands\" >Work With The NETWORK ( LAN and Wi-Fi) Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Microsoft_Windows_Networks_SAMBA_Commands\" >Microsoft Windows Networks (SAMBA) Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#IP_Tables_FIREWALL_Commands\" >IP Tables (FIREWALL) Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/www.temok.com\/blog\/400-linux-basic-commands-you-should-know\/#Monitoring_And_Debugging_Commands\" >Monitoring And Debugging Commands<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"400_Linux_Basic_Commands\"><\/span>400+ Linux Basic Commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"1\"><span class=\"ez-toc-section\" id=\"System_Information_Commands\"><\/span><strong>System Information Commands <\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6591\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/1-3.jpg?resize=750%2C250&#038;ssl=1\" alt=\"System Information Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/1-3.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/1-3.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\" start=\"1\">\r\n<li><strong>arch<\/strong>: used to print the computer architecture (shows the architecture of the machine 1).<\/li>\r\n<li><strong>uname -m<\/strong>: command is used to print the machine hardware name (shows the machine 2 architecture).<\/li>\r\n<li><strong>uname -a: <\/strong>This Linux command is used to show all the system information in the following order: Kernal name, network node hostname, kernel release date, kernel version, machine hardware name, platform, and OS.<\/li>\r\n<li><strong>uname -s: <\/strong>shows the kernel name.<\/li>\r\n<li><strong>uname -n: <\/strong>shows the hostname of the network node.<\/li>\r\n<li><strong>uname -v: <\/strong>shows the current version of the kernel.<\/li>\r\n<li><strong>uname -p: <\/strong>shows the type of processor.<\/li>\r\n<li><strong>uname -i: <\/strong>shows the platform of hardware (i.e., x86_64)<\/li>\r\n<li><strong>uname -o: <\/strong>shows the name of the operating system.<\/li>\r\n<li><strong>uname -r<\/strong>: shows the kernel release date.<\/li>\r\n<li><strong>dmidecode -q<\/strong>: shows the components (hardware) of the system.<\/li>\r\n<li><strong>hdparm -i \/dev\/hda<\/strong>: command is used to show a hard disk&#8217;s characteristics.<\/li>\r\n<li><strong>hdparm -tT \/dev\/sda<\/strong>: Linux command is used to perform a read test on a hard drive.<\/li>\r\n<li><strong>cat \/proc\/cpuinfo<\/strong>: shows CPU information.<\/li>\r\n<li><strong>cat \/proc\/interrupts<\/strong>: shows interrupts.<\/li>\r\n<li><strong>cat \/proc\/meminfo<\/strong>: checks memory usage.<\/li>\r\n<li><strong>cat \/proc\/swaps<\/strong>: shows the total and used swap size.<\/li>\r\n<li><strong>cat \/proc\/version<\/strong>: shows the kernel version.<\/li>\r\n<li><strong>cat \/proc\/net\/dev<\/strong>: shows network adapters and statistics.<\/li>\r\n<li><strong>cat \/proc\/mounts<\/strong>: shows mounted filesystem.<\/li>\r\n<li><strong>lspci -tv<\/strong>: shows PCI devices.<\/li>\r\n<li><strong>lsusb -tv<\/strong>: shows USB devices.<\/li>\r\n<li><strong>date<\/strong>: shows the system date.<\/li>\r\n<li><strong>cal 2020<\/strong>: shows the almanac for 2020.<\/li>\r\n<li><strong>cal 07 2020<\/strong>: shows the almanac for July 2020.<\/li>\r\n<li><strong>date 041217002020.00<\/strong>: sets (declare, set) date and time.<\/li>\r\n<li><strong>clock -w<\/strong>: saves date changes in BIOS.<\/li>\r\n<\/ol>\r\n<p><strong>Also Read:<\/strong> <a href=\"https:\/\/blog.temok.com\/debian-vs-ubuntu\/\" target=\"_blank\" rel=\"noopener\">Debian vs Ubuntu: Which Linux Distribution Is Right For You?<\/a><\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"2\"><span class=\"ez-toc-section\" id=\"Shutdown_Reboot_System_or_Log_Out_Commands\"><\/span><strong>Shutdown (Reboot System or Log Out) Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6592\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/2-3.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Shutdown (Reboot System or Log Out) Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/2-3.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/2-3.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>shutdown -h now<\/strong>: shutdowns the system (1).<\/li>\r\n<li><strong>init 0<\/strong>: shutdowns system (2).<\/li>\r\n<li><strong>telinit 0<\/strong>: shutdowns the system (3).<\/li>\r\n<li><strong>halt<\/strong>: shutdowns the system (4).<\/li>\r\n<li><strong>shutdown -h hours: minutes &amp;<\/strong>: scheduled system shutdown.<\/li>\r\n<li><strong>shutdown -c<\/strong>: cancels a scheduled system shutdown.<\/li>\r\n<li><strong>shutdown -r now<\/strong>: restart (1).<\/li>\r\n<li><strong>reboot<\/strong>: reboot (2).<\/li>\r\n<li><strong>logout<\/strong>: log out.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"3\"><span class=\"ez-toc-section\" id=\"Files_And_Directories_Commands\"><\/span><strong>Files And Directories Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6593\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/3-3.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Files and Directories Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/3-3.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/3-3.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>cd \/home<\/strong>: enter the &#8220;home&#8221; directory.<\/li>\r\n<li><strong>cd ..<\/strong>: used for going back one level.<\/li>\r\n<li><strong>cd ..\/ ..<\/strong>: used for going back 2 levels.<\/li>\r\n<li><strong>cd:<\/strong> used for going to the root directory.<\/li>\r\n<li><strong>cd ~ user1<\/strong>: used for going to the user1 directory.<\/li>\r\n<li><strong>cd &#8211;<\/strong>: used for going (return) to the previous directory.<\/li>\r\n<li><strong>pwd<\/strong>: shows the path of the working directory.<\/li>\r\n<li><strong>ls<\/strong>: is used to view the files in a directory.<\/li>\r\n<li><strong>ls -F<\/strong>: is used to view files in a directory.<\/li>\r\n<li><strong>ls -l<\/strong>: shows the details of files and folders in a directory.<\/li>\r\n<li><strong>ls -a<\/strong>: shows hidden files.<\/li>\r\n<li><strong>ls * [0-9]<\/strong> *: shows files and folders that contain numbers.<\/li>\r\n<li><strong>tree<\/strong>: shows files and folders in tree form starting from the root. (1)<\/li>\r\n<li><strong>lstree<\/strong>: shows files and folders as a tree starting from the root. (2)<\/li>\r\n<li><strong>mkdir dir1<\/strong>: creates a folder or directory named &#8216;dir1&#8217;.<\/li>\r\n<li><strong>mkdir dir1 dir2<\/strong>: creates two folders or directories simultaneously (Create two directories at the same time).<\/li>\r\n<li><strong>mkdir -p \/tmp\/dir1\/dir2<\/strong>: creates a directory tree.<\/li>\r\n<li><strong>rm -f file1<\/strong>: is used to delete the file named &#8216;file1&#8217;.<\/li>\r\n<li><strong>rmdir dir1<\/strong>: is used to delete the folder named &#8216;dir1&#8217;.<\/li>\r\n<li><strong>rm -rf dir1<\/strong>: is used to delete a folder named &#8216;dir1&#8217; with its contents recursively. (If I delete it recursively, I am saying that it is with its content).<\/li>\r\n<li><strong>rm -rf dir1 dir2<\/strong>: is used to delete two folders (directories) with their content recursively.<\/li>\r\n<li><strong>mv dir1 new_dir<\/strong>: is used to rename or move a file or folder (directory).<\/li>\r\n<li><strong>cp file1<\/strong>: is used to copy a file.<\/li>\r\n<li><strong>cp file1 file2<\/strong>: is used to copy two files in unison.<\/li>\r\n<li><strong>cp dir \/ *.:<\/strong> is used to copy all files from a directory into the current working directory.<\/li>\r\n<li><strong>cp -a \/tmp\/dir1.:<\/strong> is used to copy a directory within the current working directory.<\/li>\r\n<li><strong>cp -a dir1<\/strong>: is used to copy a directory.<\/li>\r\n<li><strong>cp -a dir1 dir2<\/strong>: is used to copy two directories in unison.<\/li>\r\n<li><strong>ln -s file1 lnk1<\/strong>: creates a symbolic link to the file or directory.<\/li>\r\n<li><strong>ln file1 lnk1<\/strong>: creates a hard link to the file or directory.<\/li>\r\n<li><strong>touch -t 0712250000 file1<\/strong>: is used to modify the real-time (creation time) of a file or directory.<\/li>\r\n<li><strong>file file1<\/strong>: is used to output (dump on screen) the mime type of a text file.<\/li>\r\n<li><strong>iconv -l<\/strong>: used to show the lists of known ciphers.<\/li>\r\n<li><strong>iconv -f fromEncoding -t toEncoding inputFile&gt; outputFile<\/strong>: the given command creates a new form of the input file suppose it is encoded in fromEncoding and converted it to ToEncoding.<\/li>\r\n<li><strong>find. -maxdepth 1 -name * .jpg -print -exec convert &#8220;{}&#8221; -resize 80 \u00d7 60 &#8220;thumbs \/ {}&#8221; \\;:<\/strong> group resized files in the current directory and send them to directories in thumbnail views (requires converting from ImagemagicK).<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"4\"><span class=\"ez-toc-section\" id=\"Find_Files_Commands\"><\/span><strong>Find Files Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6594\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/4-3.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Find files Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/4-3.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/4-3.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>find \/ -name file1<\/strong>: find file and directory starting from system root.<\/li>\r\n<li><strong>find \/ -user user1<\/strong>: this command is used to find files and directories belonging to user&#8217; user1&#8242;.<\/li>\r\n<li><strong>find\/home\/user1 -name\\*.bin<\/strong>: find files with extension &#8216;. bin &#8216;inside the directory&#8217; \/ home \/ user1 &#8216;.<\/li>\r\n<li><strong>find \/usr\/bin -type f -atime +100<\/strong>: find binary files not used in the last 100 days.<\/li>\r\n<li><strong>find \/usr\/bin -type f -mtime -10<\/strong>: find files created or changed within the last 10 days.<\/li>\r\n<li><strong>find \/ -name \\ *. rpm -exec chmod 755 &#8216;{}&#8217; \\;:<\/strong> search for files with the &#8216;.rpm&#8217; extension and modify permissions.<\/li>\r\n<li><strong>find \/ -xdev -name \\ *. rpm<\/strong>: Search for files with &#8216;.rpm&#8217; extension ignoring removable devices like cdrom, pen-drive, etc. &#8230;<\/li>\r\n<li><strong>locate \\ *. ps<\/strong>: find files with the &#8216;.ps&#8217; extension first executed with the &#8216;updatedb&#8217; command.<\/li>\r\n<li><strong>whereis halt<\/strong>: show the location of a binary, help, or source file. In this case, it asks where the &#8216;halt&#8217; command is.<\/li>\r\n<li><strong>which halt<\/strong>: show the full path (the full path) to a binary\/executable.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"5\"><span class=\"ez-toc-section\" id=\"Mounting_a_Filesystem_Commands\"><\/span><strong>Mounting a Filesystem Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6595\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/5-2.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Mounting a Filesystem Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/5-2.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/5-2.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>mount \/dev\/hda2\/mnt\/hda2<\/strong>: Using this command, you can mount a disk named hda2. Check first the existence of the directory &#8216;\/ mnt \/ hda2&#8217;; if it is not, you must create it.<\/li>\r\n<li><strong>umount \/dev\/hda2<\/strong>: Using this command, you can unmount a disk named hda2. First exit from point &#8216;\/ mnt \/ hda2.<\/li>\r\n<li><strong>fuser -km\/mnt\/hda2<\/strong>: Using this command, you can force unmount when a device is busy.<\/li>\r\n<li><strong>umount -n \/mnt\/hda2<\/strong>: Using this command, you can run the unmount without reading the \/ etc \/ mtab. However, it is used when the file is read-only, or the hard drive is full.<\/li>\r\n<li><strong>mount \/dev\/fd0\/mnt\/floppy<\/strong>: You can mount a floppy disk.<\/li>\r\n<li><strong>mount \/dev\/cdrom\/mnt\/cdrom<\/strong>: run this command and mount a cdrom \/ dvdrom.<\/li>\r\n<li><strong>mount \/dev\/hdc\/mnt\/cdrecorder<\/strong>: Using this command, you can easily mount a rewritable cd or dvdrom.<\/li>\r\n<li><strong>mount \/dev\/hdb\/mnt\/cdrecorder<\/strong>: with the help of this command, you can mount a rewritable cd \/ dvdrom (a dvd).<\/li>\r\n<li><strong>mount -o loop file.iso \/mnt\/cdrom<\/strong>: If you want to mount an iso file or image, then run the given command.<\/li>\r\n<li><strong>mount -t vfat \/dev\/hda5\/mnt\/hda5<\/strong>: using this command, you can mount a <a href=\"https:\/\/en.wikipedia.org\/wiki\/File_Allocation_Table\" target=\"_blank\" rel=\"noopener\">FAT32 filesystem<\/a>.<\/li>\r\n<li><strong>mount \/ dev\/sda1\/mnt\/usbdisk<\/strong>: using this command, you can mount a USB pen drive or a memory (without specifying the type of filesystem).<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"6\"><span class=\"ez-toc-section\" id=\"Disk_Space_Commands\"><\/span><strong>Disk Space Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6596\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/6-2.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Disk Space Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/6-2.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/6-2.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>df -h<\/strong>: displays a list of mounted partitions.<\/li>\r\n<li><strong>ls -lSr | more<\/strong>: shows the size of the files and directories ordered by size.<\/li>\r\n<li><strong>du -sh dir1<\/strong>: Using this command, you can easily estimate the space used by the directory &#8216;dir1&#8217;.<\/li>\r\n<li><strong>du -sk * | sort -rn<\/strong>: shows the size of the files and directories ordered by size.<\/li>\r\n<li><strong>rpm -q -a \u2013qf &#8216;% 10 {SIZE} t% {NAME} n&#8217; | sort -k1,1n<\/strong>: shows the space used by the installed rpm packages organized by size (Fedora, Redhat, and others).<\/li>\r\n<li><strong>dpkg-query -W -f = &#8216;$ {Installed-Size; 10} t $ {Package} n&#8217; | sort -k1,1n<\/strong>: shows the space used by installed packages, organized by size (Ubuntu, Debian, and others).<\/li>\r\n<\/ol>\r\n<p><strong>Also Read:<\/strong> <a href=\"https:\/\/blog.temok.com\/linux-interview-questions\/\" target=\"_blank\" rel=\"noopener\">Top 80 Linux Interview Questions: Cracking the Code<\/a><\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"7\"><span class=\"ez-toc-section\" id=\"Users_and_Groups_Command\"><\/span><strong>Users and Groups Command<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6597\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/7.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Users and Groups Command\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/7.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/7.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>groupadd group_name<\/strong> \u2013 It is used to create a new group.<\/li>\r\n<li><strong>groupdel group_name<\/strong>: It is used to delete a group.<\/li>\r\n<li><strong>groupmod -n new_group_name old_group_name<\/strong>: It is used to rename a group.<\/li>\r\n<li><strong>useradd -c &#8220;Name Surname&#8221; -g admin -d \/home\/user1 -s \/bin\/bash user1<\/strong>: It is used to create a new user belonging to the group &#8220;admin&#8221;.<\/li>\r\n<li><strong>useradd user1<\/strong>: With the help of this command, you can create a new user.<\/li>\r\n<li><strong>userdel -r user1<\/strong>: to delete a user, you can use this command (&#8216;-r&#8217; removes the Home directory).<\/li>\r\n<li><strong>usermod -c &#8220;User FTP &#8221; -g system -d \/ftp\/user1 -s\/bin\/nologin user1<\/strong>: You can change the user attributes using the given command.<\/li>\r\n<li><strong>passwd<\/strong>: This command is used to change the password.<\/li>\r\n<li><strong>passwd user1<\/strong>: If you want to change a user&#8217;s password (only by root), you can proceed with this command.<\/li>\r\n<li><strong>chage -E 2020-12-31 user1<\/strong>: if you want to put a term for the user&#8217;s password, then use the given Linux command, and the key will expire on December 31, 2020.<\/li>\r\n<li><strong>pwck<\/strong>: is used to verify the integrity of the system authentication information, including correct syntax, the file format of &#8216;\/ etc \/ passwd&#8217;, and the existence of users.<\/li>\r\n<li><strong>grpck<\/strong>: command is used to check the correct syntax and format of the file &#8216;\/ etc \/ group&#8217; and groups&#8217; existence.<\/li>\r\n<li><strong>newgrp group_name<\/strong>: Run the given command to register a new group to change the newly created files&#8217; default group.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"8\"><span class=\"ez-toc-section\" id=\"Permissions_in_Files_Use_%E2%80%9C%E2%80%9D_to_place_permissions_and_%E2%80%9C-%E2%80%9D_to_remove_Commands\"><\/span><strong>Permissions in Files (Use &#8220;+&#8221; to place permissions and &#8220;-&#8221; to remove) Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6598\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/8-2.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Permissions in Files (Use &quot;+&quot; to place permissions and &quot;-&quot; to remove) Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/8-2.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/8-2.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>ls -lh<\/strong>: Shows permissions.<\/li>\r\n<li><strong>ls \/tmp | pr -T5 -W $ COLUMNS<\/strong>: divides the terminal into five columns.<\/li>\r\n<li><strong>chmod ugo + rwx directory1<\/strong>: It will set read (r), write (w), and execute (x) permissions to owner (u), group (g), and others (o) on directory &#8216;directory1&#8217;.<\/li>\r\n<li><strong>chmod go-rwx directory1<\/strong>: removes read permission (r), write (w) and (x) execute to group (g) and others (o) on directory &#8216;directory1&#8217;.<\/li>\r\n<li><strong>chown user1 file1<\/strong>: changes the owner of a file.<\/li>\r\n<li><strong>chown -R user1 directory1<\/strong>: changes the directory owner and all files and directories contained within.<\/li>\r\n<li><strong>chgrp group1 file1<\/strong>: changes group of files.<\/li>\r\n<li><strong>chown user1: group1 file1<\/strong>: changes user and group that owns a file.<\/li>\r\n<li><strong>find \/ -perm -u + s<\/strong>: use this command to view all files on the system with SUID configured.<\/li>\r\n<li><strong>chmod u + s \/bin\/file1<\/strong>: put the SUID (Set User ID) bit in a binary file. The user running that file acquires the same privileges as the owner.<\/li>\r\n<li><strong>chmod us \/bin\/file1<\/strong>: disable the SUID (Set User ID) bit in a binary file. 100<\/li>\r\n<li><strong>chmod g + s \/home\/public<\/strong>: put an SGID (Set User ID) bit in a directory \u2013similar to SUID but per directory.<\/li>\r\n<li><strong>chmod gs \/home\/public<\/strong>: disable an SGID (Set User ID) bit in a directory.<\/li>\r\n<li><strong>chmod o + t \/home\/public<\/strong>: put a STICKY bit in a directory. Allows file deletion only to legitimate owners.<\/li>\r\n<li><strong>chmod to\/home\/public<\/strong>: disable a STICKY bit in a directory.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"9\"><span class=\"ez-toc-section\" id=\"Special_Attributes_in_files_Use_%E2%80%9C%E2%80%9D_to_set_permissions_and_%E2%80%9C-%E2%80%9D_to_remove_Commands\"><\/span><strong>Special Attributes in files (Use &#8220;+&#8221; to set permissions and &#8220;-&#8221; to remove) Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6599\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/9-3.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Special Attributes in files (Use &quot;+&quot; to set permissions and &quot;-&quot; to remove) Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/9-3.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/9-3.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>chattr + a file1<\/strong>: allows writing by opening a file only append mode.<\/li>\r\n<li><strong>chattr + c file1<\/strong>: enable a file to be automatically compressed\/decompressed.<\/li>\r\n<li><strong>chattr + d file1<\/strong>: ensure that the program ignores deleting files during backup.<\/li>\r\n<li><strong>chattr + i file1<\/strong>: makes the file invariable, so it cannot be deleted, altered, renamed, or linked.<\/li>\r\n<li><strong>chattr + s file1<\/strong>: allows a file to be safely deleted.<\/li>\r\n<li><strong>chattr + S file1<\/strong>: this Linux command ensures that a file is modified and changes are written synchronously with sync.<\/li>\r\n<li><strong>chattr + u file1<\/strong>: allows you to retrieve a file&#8217;s content even if it is canceled.<\/li>\r\n<li><strong>lsattr<\/strong>: show special attributes.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"10\"><span class=\"ez-toc-section\" id=\"Archives_And_compressed_Files_Commands\"><\/span><strong>Archives And compressed Files Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6605\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/10-4.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Archives And compressed Files Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/10-4.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/10-4.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>bunzip2 file1.bz2<\/strong>: linux command is used to unzip a file named &#8216;file1.bz2&#8217;.<\/li>\r\n<li><strong>bzip2 file1<\/strong>: It will compress a file named &#8216;file1&#8217;.<\/li>\r\n<li><strong>gunzip file1.gz<\/strong>: using the given command, you can unzip a file called &#8216;file1.gz&#8217;.<\/li>\r\n<li><strong>gzip file1<\/strong>: It will compress a file named &#8216;file1&#8217;.<\/li>\r\n<li><strong>gzip -9 file1<\/strong>: the command is used to compress with maximum compression.<\/li>\r\n<li><strong>rar to file1.rar test_file<\/strong>: will create a rar file called &#8216;file1.rar&#8217;.<\/li>\r\n<li><strong>rar to file1.rar file1 file2 dir1<\/strong>: It will compress &#8216;file1&#8217;, &#8216;file2&#8217; and &#8216;dir1&#8217; simultaneously.<\/li>\r\n<li><strong>unrar x file1.rar<\/strong>: is used to unzip or extract the rar files in the full path.<\/li>\r\n<li><strong>tar -cvf archive.tar file1<\/strong>: with the help of this command, you can create an unzipped tarball.<\/li>\r\n<li><strong>tar -cvf archive.tar file1 file2 dir1<\/strong>: creates an archive containing &#8216;file1&#8217;, &#8216;file2 \u2032 and&#8217;dir1&#8217;.<\/li>\r\n<li><strong>tar -tf archive.tar<\/strong>: it is used to display the contents of an archive.<\/li>\r\n<li><strong>tar -xvf archive.tar<\/strong>: to extract a tarball.<\/li>\r\n<li><strong>tar -xvf archive.tar -C \/ tmp<\/strong>: extract a tarball in \/ tmp.<\/li>\r\n<li><strong>tar -cvfj archive.tar.bz2 dir1<\/strong>: create a compressed tarball inside bzip2.<\/li>\r\n<li><strong>tar -xvfj archive.tar.bz2<\/strong>: decompress a tar archive compressed in bzip2<\/li>\r\n<li><strong>tar -cvfz archive.tar.gz dir1<\/strong>: This command is used to create a <strong>gzipped<\/strong> tarball.<\/li>\r\n<li><strong>tar -xvfz archive.tar.gz<\/strong>: <strong>Unzip a gzipped tar<\/strong> archive.<\/li>\r\n<li><strong>zip file1.zip file1<\/strong> \u2013 You can create a compressed zip file.<\/li>\r\n<li><strong>zip -r file1.zip file1 file2 dir1<\/strong>: zip multiple files and directories simultaneously.<\/li>\r\n<li><strong>unzip file1.zip<\/strong>: unzip a zip file.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"11\"><span class=\"ez-toc-section\" id=\"RPM_packages_Red_Hat_Fedora_and_similar_Commands\"><\/span><strong>RPM packages (Red Hat, Fedora, and similar) Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6603\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/11-2.jpg?resize=750%2C250&#038;ssl=1\" alt=\"RPM packages (Red Hat, Fedora, and similar) Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/11-2.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/11-2.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>rpm -ivh package.rpm<\/strong>: install an rpm package.<\/li>\r\n<li><strong>rpm -ivh \u2013nodeeps package.rpm<\/strong>: install an rpm package ignoring dependency requests.<\/li>\r\n<li><strong>rpm -U package.rpm<\/strong>: update a rpm package without changing the configuration of the files.<\/li>\r\n<li><strong>rpm -F package.rpm<\/strong>: update an rpm package only if it is installed.<\/li>\r\n<li><strong>rpm -e package_name.rpm<\/strong>: remove a rpm package.<\/li>\r\n<li><strong>rpm -qa<\/strong>: show all rpm packages installed on the system.<\/li>\r\n<li><strong>rpm -qa | grep httpd<\/strong>: show all rpm packages with the name &#8220;httpd&#8221;.<\/li>\r\n<li><strong>rpm -qi package_name<\/strong>: get information on a specific installed package.<\/li>\r\n<li><strong>rpm -qg &#8220;System Environment\/Daemons&#8221;<\/strong>: show the rpm packages of a software group.<\/li>\r\n<li><strong>rpm -ql package_name<\/strong>: show the list of files given by an installed rpm package.<\/li>\r\n<li><strong>rpm -qc package_name<\/strong>: show configuration list of files given by an installed rpm package.<\/li>\r\n<li><strong>rpm -q package_name \u2013whatrequires<\/strong>: show requested a list of dependencies for an rpm package.<\/li>\r\n<li><strong>rpm -q package_name \u2013whatprovides<\/strong>: show the capacity given by an rpm package.<\/li>\r\n<li><strong>rpm -q package_name \u2013scripts<\/strong>: show scripts started during installation\/removal.<\/li>\r\n<li><strong>rpm -q package_name \u2013changelog<\/strong>: show the revision history of a rpm package.<\/li>\r\n<li><strong>rpm -qf \/etc\/httpd\/conf\/httpd.conf<\/strong>: check which rpm package belongs to a given file.<\/li>\r\n<li><strong>rpm -qp package.rpm -l<\/strong>: show a list of files given by an rpm package that has not yet been installed.<\/li>\r\n<li><strong>rpm \u2013import\/media\/cdrom\/RPM-GPG-KEY<\/strong>: import the digital signature of the public key.<\/li>\r\n<li><strong>rpm \u2013checksig package.rpm<\/strong>: check the integrity of an rpm package.<\/li>\r\n<li><strong>rpm -qa gpg-pubkey<\/strong>: verify the integrity of all installed rpm packages.<\/li>\r\n<li><strong>rpm -V package_name<\/strong>: check file size, licenses, types, owner, group, MD5 summary check, and last modification.<\/li>\r\n<li><strong>rpm -Va<\/strong>: check all rpm packages installed on the system. Use with care.<\/li>\r\n<li><strong>rpm -Vp package.rpm<\/strong>: check an rpm package not installed yet.<\/li>\r\n<li><strong>rpm2cpio package.rpm | cpio \u2013extract \u2013make-directories * bin<\/strong> *: extract executable file from rpm package.<\/li>\r\n<li><strong>rpm -ivh \/usr\/src\/redhat\/RPMS\/`arch`\/package.rpm<\/strong>: install a package built from a rpm source.<\/li>\r\n<li><strong>rpmbuild \u2013rebuild package_name.src.rpm<\/strong>: build an rpm package from an rpm source.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"12\"><span class=\"ez-toc-section\" id=\"YUM_Package_Updater_Red_Hat_Fedora_and_similar_Commands\"><\/span><strong>YUM Package Updater (Red Hat, Fedora, and similar) Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6606\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/12-2.jpg?resize=750%2C250&#038;ssl=1\" alt=\"YUM Package Updater (Red Hat, Fedora, and similar) Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/12-2.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/12-2.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>yum install package_name<\/strong>: download and install an rpm package.<\/li>\r\n<li><strong>yum localinstall package_name.rpm<\/strong>: this will install an RPM and try to resolve all dependencies for you, using your repositories.<\/li>\r\n<li><strong>yum update package_name.rpm<\/strong>: update all rpm packages installed on the system.<\/li>\r\n<li><strong>yum update package_name<\/strong>: update \/ update a rpm package.<\/li>\r\n<li><strong>yum remove package_name<\/strong>: remove an rpm package.<\/li>\r\n<li><strong>yum list<\/strong>: list all packages installed on the system.<\/li>\r\n<li><strong>yum search package_name<\/strong>: Find a package in the rpm repository.<\/li>\r\n<li><strong>yum clean packages<\/strong>: clean an RPM cache by deleting the downloaded packages.<\/li>\r\n<li><strong>yum clean headers<\/strong>: remove all header files that the system uses to resolve the dependency.<\/li>\r\n<li><strong>yum clean all<\/strong>: remove from cache packages and header files.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"13\"><span class=\"ez-toc-section\" id=\"Deb_packages_Debian_Ubuntu_and_derivatives_Commands\"><\/span><strong>Deb packages (Debian, Ubuntu, and derivatives) Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6607\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/13-1.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Deb packages (Debian, Ubuntu, and derivatives) Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/13-1.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/13-1.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>dpkg -i package.deb<\/strong>: install\/update a deb package.<\/li>\r\n<li><strong>dpkg -r package_name<\/strong>: remove a deb package from the system.<\/li>\r\n<li><strong>dpkg -l<\/strong>: show all deb packages installed on the system.<\/li>\r\n<li><strong>dpkg -l | grep httpd<\/strong>: show all deb packages with the name &#8220;httpd&#8221;<\/li>\r\n<li><strong>dpkg -s package_name<\/strong>: get information on a specific package installed on the system.<\/li>\r\n<li><strong>dpkg -L package_name<\/strong>: shows a list of files given by a package installed on the system.<\/li>\r\n<li><strong>dpkg \u2013contents package.deb<\/strong>: show a list of files given by a package not installed yet.<\/li>\r\n<li><strong>dpkg -S \/bin\/ping<\/strong>: check which package belongs to a given file.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"14\"><span class=\"ez-toc-section\" id=\"APT_Package_Updater_Debian_Ubuntu_and_derivatives_Commands\"><\/span><strong>APT Package Updater (Debian, Ubuntu, and derivatives) Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6608\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/14-1.jpg?resize=750%2C250&#038;ssl=1\" alt=\"APT Package Updater (Debian, Ubuntu, and derivatives) Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/14-1.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/14-1.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>apt-get install package_name<\/strong>: install\/update a deb package.<\/li>\r\n<li><strong>apt-cdrom install package_name<\/strong>: install\/update a deb package from a cdrom.<\/li>\r\n<li><strong>apt-get update<\/strong>: update the package list.<\/li>\r\n<li><strong>apt-get upgrade<\/strong>: upgrade all installed packages.<\/li>\r\n<li><strong>apt-get remove package_name<\/strong>: remove a deb package from the system.<\/li>\r\n<li><strong>apt-get check<\/strong>: verify the correct resolution of the dependencies.<\/li>\r\n<li><strong>apt-get clean<\/strong>: clear cache from downloaded packages.<\/li>\r\n<li><strong>apt-cache search searched-package<\/strong>: returns a list of packages that correspond to the series &#8220;searched packages&#8221;.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"156\"><span class=\"ez-toc-section\" id=\"View_The_Content_of_a_File_Commands\"><\/span><strong>View The Content of a File Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6609\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/15-1.jpg?resize=750%2C250&#038;ssl=1\" alt=\"View The Content of a File Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/15-1.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/15-1.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>cat file1<\/strong>: view a file&#8217;s contents starting from the first row.<\/li>\r\n<li><strong>tac file1<\/strong>: view the contents of a file starting from the last line.<\/li>\r\n<li><strong>more file1<\/strong>: view the content throughout a file.<\/li>\r\n<li><strong>less file1<\/strong>: similar to the &#8216;more&#8217; <strong>command<\/strong> but allows saving the movement in the file and the movement backward.<\/li>\r\n<li><strong>head -2 file1<\/strong>: see the first two lines of a file.<\/li>\r\n<li><strong>tail -2 file1<\/strong>: see the last two lines of a file.<\/li>\r\n<li><strong>tail -f \/var\/log\/messages<\/strong>: see what has been added to the file in real-time.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"16\"><span class=\"ez-toc-section\" id=\"Text_Manipulation_Commands\"><\/span><strong>Text Manipulation Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6610\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/16-2.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Text Manipulation Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/16-2.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/16-2.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>cat file1 file2 .. | command &lt;&gt; file1_in.txt_or_file1_out.txt<\/strong> &#8211; General syntax for manipulating text using PIPE, STDIN, and STDOUT.<\/li>\r\n<li><strong>cat file1 | command (sed, grep, awk, grep, etc &#8230;)&gt; result.txt<\/strong>: general syntax to manipulate a text in a file and write the result in a new file.<\/li>\r\n<li><strong>cat file1 | command (sed, grep, awk, grep, etc &#8230;) \u00bbresult.txt<\/strong>: general syntax to manipulate a text from a file and add results to an existing file.<\/li>\r\n<li><strong>grep Aug \/var\/log\/messages<\/strong>: search for the words &#8220;Aug&#8221; in the file &#8216;\/ var \/ log \/ messages&#8217;.<\/li>\r\n<li><strong>grep ^ Aug \/var\/log\/messages<\/strong>: find words starting with &#8220;Aug&#8221; in file &#8216;\/ var \/ log \/ messages&#8217;<\/li>\r\n<li><strong>grep [0-9] \/var\/log\/messages<\/strong>: select all lines in the file &#8216;\/ var \/ log \/ messages&#8217; that contain numbers.<\/li>\r\n<li><strong>grep Aug -R \/var\/log \/<\/strong> *: Find the string &#8220;Aug&#8221; in the directory &#8216;\/ var \/ log&#8217; and below.<\/li>\r\n<li><strong>sed &#8216;s \/stringa1\/stringa2\/g&#8217; example.txt<\/strong>: relocate &#8220;string1&#8221; with &#8220;string2&#8221; in example.txt<\/li>\r\n<li><strong>sed &#8216;\/ ^ $ \/ d&#8217; example.txt<\/strong>: remove all blank lines from example.txt<\/li>\r\n<li><strong>sed &#8216;\/ * # \/ d; \/ ^ $ \/ d &#8216;example.txt<\/strong>: remove comments and blank lines from example.txt<\/li>\r\n<li><strong>echo &#8216;esempio&#8217; | tr &#8216;[: lower:]&#8217; &#8216;[: upper:]&#8217;<\/strong>: Convert lowercase to uppercase.<\/li>\r\n<li><strong>sed -e &#8216;1d&#8217; result.txt<\/strong>: remove the first line from the file example.txt<\/li>\r\n<li><strong>sed -n &#8216;\/stringa1\/p&#8217;<\/strong>: display only the lines that contain the word &#8220;string1&#8221;.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"17\"><span class=\"ez-toc-section\" id=\"Set_Character_And_File_Conversion_Commands\"><\/span><strong>Set Character And File Conversion Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6611\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/17.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Set Character And File Conversion Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/17.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/17.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>dos2unix filedos.txt fileunix.txt<\/strong>: convert a text file format from MSDOS to UNIX.<\/li>\r\n<li><strong>unix2dos fileunix.txt filedos.txt<\/strong>: convert a text file format from UNIX to MSDOS.<\/li>\r\n<li><strong>recode .. HTML &lt;page.txt&gt; page.html<\/strong>: convert a text file into HTML.<\/li>\r\n<li><strong>recode -l | more<\/strong>: show all available format conversions.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"18\"><span class=\"ez-toc-section\" id=\"File_System_Analysis_Commands\"><\/span><strong>File System Analysis Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6612\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/18.jpg?resize=750%2C250&#038;ssl=1\" alt=\"File System Analysis Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/18.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/18.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>badblocks -v \/dev\/hda1<\/strong>: Check for bad blocks on disk hda1.<\/li>\r\n<li><strong>fsck \/dev\/hda1<\/strong>: repair \/ check the Linux system file&#8217;s integrity on disk hda1.<\/li>\r\n<li><strong>fsck.ext2 \/dev\/hda1<\/strong>: repair \/ check the integrity of the ext 2 system file on disk hda1.<\/li>\r\n<li><strong>e2fsck \/dev\/hda1<\/strong>: repair \/ check the integrity of the ext 2 system file on disk hda1.<\/li>\r\n<li><strong>e2fsck -j \/dev\/hda1<\/strong>: repair \/ check the integrity of the ext 3 system file on disk hda1.<\/li>\r\n<li><strong>fsck.ext3 \/dev\/hda1<\/strong>: repair \/ check the integrity of system file ext 3 on disk hda1.<\/li>\r\n<li><strong>fsck.vfat \/dev\/hda1<\/strong>: repair \/ check the integrity of the fat system file on disk hda1.<\/li>\r\n<li><strong>fsck.msdos \/dev\/hda1<\/strong>: repair \/ check the integrity of a system dos file on disk hda1.<\/li>\r\n<li><strong>dosfsck \/dev\/hda1<\/strong>: repair \/ check the integrity of a system dos file on disk hda1.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"19\"><span class=\"ez-toc-section\" id=\"Format_a_filesystem_Commands\"><\/span><strong>Format a filesystem Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6613\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/19.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Format a filesystem Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/19.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/19.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>mkfs \/dev\/hda1<\/strong>: create a Linux-like system file on partition hda1.<\/li>\r\n<li><strong>mke2fs \/dev\/hda1<\/strong>: create a Linux ext 2 system file on hda1.<\/li>\r\n<li><strong>mke2fs -j \/dev\/hda1<\/strong>: create a Linux ext3 (periodic) system file on partition hda1.<\/li>\r\n<li><strong>mkfs -t vfat32 -F \/dev\/hda1<\/strong>: create a FAT32 system file on hda1.<\/li>\r\n<li><strong>fdformat -n \/dev\/fd0<\/strong>: format a flooply disk.<\/li>\r\n<li><strong>mkswap \/dev\/hda3<\/strong>: create a swap system file.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"20\"><span class=\"ez-toc-section\" id=\"Working_With_the_SWAP_Commands\"><\/span><strong>Working With the SWAP Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6614\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/20.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Working With the SWAP Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/20.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/20.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>mkswap \/dev\/hda3<\/strong>: create a swap system file.<\/li>\r\n<li><strong>swapon \/dev\/hda3<\/strong>: activating a new swap partition.<\/li>\r\n<li><strong>swapon \/dev\/hda2\/dev\/hdb3<\/strong>: activate two swap partitions.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"21\"><span class=\"ez-toc-section\" id=\"Salvas_Backup_Commands\"><\/span><strong>Salvas (Backup) Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6615\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/21.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Salvas (Backup) Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/21.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/21.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>dump -0aj -f \/tmp\/home0.bak home<\/strong>: make a full save of the &#8216;\/ home&#8217; directory.<\/li>\r\n<li><strong>dump -1aj -f \/tmp\/home0.bak\/home<\/strong>: make an incremental save of the &#8216;\/ home&#8217; directory.<\/li>\r\n<li><strong>restore -if \/tmp\/home0.bak<\/strong>: restoring a salvo interactively.<\/li>\r\n<li><strong>rsync -rogpav \u2013delete \/home\/tmp<\/strong>: synchronization between directories.<\/li>\r\n<li><strong>rsync -rogpav -e ssh \u2013delete \/home ip_address: \/tmp<\/strong>: rsync through the SSH tunnel.<\/li>\r\n<li><strong>rsync -az -e ssh \u2013delete ip_addr: \/home\/public\/home\/local<\/strong>: synchronize a local directory with a remote directory via ssh and compression.<\/li>\r\n<li><strong>rsync -az -e ssh \u2013delete \/home\/local ip_addr: \/home\/public<\/strong>: synchronize a remote directory with a local directory via ssh and compression.<\/li>\r\n<li><strong>dd bs = 1M if = \/dev\/hda | gzip | ssh user @ ip_addr &#8216;dd of = hda.gz&#8217;<\/strong>: save a hard drive on a remote host via ssh.<\/li>\r\n<li><strong>dd if = \/dev\/sda of = \/tmp\/file1<\/strong>: save the contents of a hard disk to a file. (In this case, the hard disk is &#8220;sda&#8221; and the file is &#8220;file1&#8221;).<\/li>\r\n<li><strong>tar -Puf backup.tar \/ home\/user<\/strong>: make an incremental save of the directory &#8216;\/home\/user&#8217;.<\/li>\r\n<li><strong>(cd \/tmp\/local\/ &amp;&amp; tar c.) | ssh -C user @ ip_addr &#8216;cd \/home\/share \/ &amp;&amp; tar x -p&#8217;<\/strong>: copy the contents of a directory to a remote directory via ssh.<\/li>\r\n<li><strong>(tar c \/ home) | ssh -C user @ ip_addr &#8216;cd \/home\/backup-home &amp;&amp; tar x -p&#8217;<\/strong>: copy a local directory to a remote directory via ssh.<\/li>\r\n<li><strong>tar cf -. | (cd \/ tmp \/ backup; tar xf -)<\/strong>: local copy preserving licenses and links from one directory to another.<\/li>\r\n<li><strong>find \/home\/user1 -name &#8216;* .txt&#8217; | xargs cp -av \u2013target-directory = \/ home\/backup\/ \u2013parents<\/strong>: find and copy all files with extension &#8216;.txt&#8217; from one directory to another.<\/li>\r\n<li><strong>find \/var\/log -name &#8216;* .log&#8217; | tar cv \u2013files-from = &#8211; | bzip2&gt; log.tar.bz2<\/strong>: find all files with the extension &#8216;.log&#8217; and make a bzip archive.<\/li>\r\n<li><strong>dd if = \/dev\/hda of = \/dev\/fd0 bs = 512 count = 1<\/strong>: make a copy of the MRB (Master Boot Record) to a floppy disk.<\/li>\r\n<li><strong>dd if = \/dev\/fd0 of = \/dev\/hda bs = 512 count = 1<\/strong>: restore the copy of the MBR (Master Boot Record) saved on a floppy.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"22\"><span class=\"ez-toc-section\" id=\"CD_ROM_Commands\"><\/span><strong>CD ROM Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6616\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/22.jpg?resize=750%2C250&#038;ssl=1\" alt=\"CD ROM Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/22.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/22.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>cdrecord -v gracetime = 2 dev = \/dev\/cdrom -eject blank = fast -force<\/strong>: clean or erase a rewritable cd.<\/li>\r\n<li><strong>mkisofs \/dev\/cdrom&gt; cd.iso<\/strong>: create an iso image of cdrom on disk.<\/li>\r\n<li><strong>mkisofs \/dev\/cdrom | gzip&gt; cd_iso.gz<\/strong>: create a compressed iso image of cdrom on disk.<\/li>\r\n<li><strong>mkisofs -J -allow-leading-dots -R -V &#8220;Label CD&#8221; -iso-level 4 -o .\/cd.iso data_cd<\/strong>: create an iso image of a directory.<\/li>\r\n<li><strong>cdrecord -v dev = \/dev\/cdrom cd.iso<\/strong>: burn an iso image.<\/li>\r\n<li><strong>gzip -dc cd_iso.gz | cdrecord dev = \/dev\/cdrom &#8211;<\/strong>: burn a compressed iso image.<\/li>\r\n<li><strong>mount -o loop cd.iso \/mnt\/iso<\/strong>: mount an iso image.<\/li>\r\n<li><strong>cd-paranoia -B<\/strong>: take songs from a CD to WAV files.<\/li>\r\n<li><strong>cd-paranoia -&#8221; -3&#8243;<\/strong>: transfer the first 3 songs from a cd to wav files.<\/li>\r\n<li><strong>cdrecord \u2013scanbus<\/strong>: scan bus to identify SCSI channel.<\/li>\r\n<li><strong>dd if = \/dev\/hdc | md5sum<\/strong>: run a md5sum on a device, such as a CD.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"23\"><span class=\"ez-toc-section\" id=\"Work_With_The_NETWORK_LAN_and_Wi-Fi_Commands\"><\/span><strong>Work With The NETWORK ( LAN and Wi-Fi) Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6617\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/23.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Work With The NETWORK ( LAN and Wi-Fi) Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/23.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/23.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>ifconfig eth0<\/strong>: show the configuration of an Ethernet network card.<\/li>\r\n<li><strong>ifup eth0<\/strong>: activate an interface &#8216;eth0&#8217;.<\/li>\r\n<li><strong>ifdown eth0<\/strong>: disable an interface &#8216;eth0&#8217;.<\/li>\r\n<li><strong>ifconfig eth0 192.168.1.1 netmask 255.255.255.0<\/strong>: configure an IP address.<\/li>\r\n<li><strong>ifconfig eth0 promisc<\/strong>: configure &#8216;<strong>eth0<\/strong>&#8216; in common mode to obtain packets (sniffing).<\/li>\r\n<li><strong>dhclient eth0<\/strong>: activate interface &#8216;eth0&#8217; in dhcp mode.<\/li>\r\n<li><strong>route -n<\/strong>: show route table.<\/li>\r\n<li><strong>route add -net 0\/0 gw IP_Gateway<\/strong>: configure default entry.<\/li>\r\n<li><strong>route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1<\/strong>: configure static route to search for network &#8216;192.168.0.0\/16&#8217;.<\/li>\r\n<li><strong>route del 0\/0 gw IP_gateway<\/strong>: remove the static route.<\/li>\r\n<li><strong>echo &#8220;1&#8221;&gt; \/proc\/sys\/net\/ipv4\/ip_forward<\/strong>: activate ip traversal.<\/li>\r\n<li><strong>hostname<\/strong>: display the hostname of the system.<\/li>\r\n<li><strong>host www.example.com<\/strong>: find the hostname to resolve the name to an IP address (1).<\/li>\r\n<li><strong>nslookup www.example.com<\/strong>: look up the hostname to resolve the name to an IP address and vice versa (2).<\/li>\r\n<li><strong>ip link show<\/strong>: show the link status of all interfaces.<\/li>\r\n<li><strong>mii-tool eth0<\/strong>: show link status of &#8216;eth0&#8217;.<\/li>\r\n<li><strong>ethtool eth0<\/strong>: show network card &#8216;eth0&#8217; statistics.<\/li>\r\n<li><strong>netstat -tup<\/strong>: show all active network connections and their PIDs.<\/li>\r\n<li><strong>netstat -tupl<\/strong>: show all network listeners on the system and their PIDs.<\/li>\r\n<li><strong>tcpdump tcp port 80<\/strong>: show all HTTP traffic.<\/li>\r\n<li><strong>iwlist scan<\/strong>: show wireless networks.<\/li>\r\n<li><strong>iwconfig eth1<\/strong>: show the configuration of a wireless network card.<\/li>\r\n<li><strong>whois www.example.com<\/strong>: search the Whois database.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"24\"><span class=\"ez-toc-section\" id=\"Microsoft_Windows_Networks_SAMBA_Commands\"><\/span><strong>Microsoft Windows Networks (SAMBA) Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6618\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/24.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Microsoft Windows Networks (SAMBA) Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/24.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/24.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>nbtscan ip_addr<\/strong>: bios network name resolution.<\/li>\r\n<li><strong>nmblookup -A ip_addr<\/strong>: bios network name resolution.<\/li>\r\n<li><strong>smbclient -L ip_addr\/hostname<\/strong>: show remote actions of a host in Windows.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"25\"><span class=\"ez-toc-section\" id=\"IP_Tables_FIREWALL_Commands\"><\/span><strong>IP Tables (FIREWALL) Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6619\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/25.jpg?resize=750%2C250&#038;ssl=1\" alt=\"IP Tables (FIREWALL) Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/25.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/25.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>iptables -t filter -L<\/strong>: show all strings from the filter table.<\/li>\r\n<li><strong>iptables -t nat -L<\/strong>: show all strings from nat table.<\/li>\r\n<li><strong>iptables -t filter -F<\/strong>: clean all the rules from the filter table.<\/li>\r\n<li><strong>iptables -t nat -F<\/strong>: clear all rules from the nat table.<\/li>\r\n<li><strong>iptables -t filter -X<\/strong>: delete any string created by the user.<\/li>\r\n<li><strong>iptables -t filter -A INPUT -p tcp \u2013dport telnet -j ACCEPT<\/strong>: allow telnet connections to enter.<\/li>\r\n<li><strong>iptables -t filter -A OUTPUT -p tcp \u2013dport http -j DROP<\/strong>: block HTTP connections to exit.<\/li>\r\n<li><strong>iptables -t filter -A FORWARD -p tcp \u2013dport pop3 -j ACCEPT<\/strong>: allow POP connections to a forward chain.<\/li>\r\n<li><strong>iptables -t filter -A INPUT -j LOG \u2013log-prefix &#8220;DROP INPUT&#8221;<\/strong>: logging an input string.<\/li>\r\n<li><strong>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<\/strong>: configure a PAT (Address Translation Port) on eth0, hiding force-out packets.<\/li>\r\n<li><strong>iptables -t nat -A PREROUTING -d 192.168.0.1 -p tcp -m tcp \u2013dport 22 -j DNAT \u2013to-destination 10.0.0.2:22<\/strong>: redirect <strong>addressed<\/strong> packets from one host to another.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"26\"><span class=\"ez-toc-section\" id=\"Monitoring_And_Debugging_Commands\"><\/span><strong>Monitoring And Debugging Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6620\" src=\"https:\/\/i0.wp.com\/www.blog.temok.com\/wp-content\/uploads\/2020\/12\/26.jpg?resize=750%2C250&#038;ssl=1\" alt=\"Monitoring And Debugging Commands\" width=\"750\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/26.jpg?w=750&amp;ssl=1 750w, https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/26.jpg?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li><strong>top<\/strong>: show Linux tasks using the most CPU.<\/li>\r\n<li><strong>ps -eafw<\/strong>: show Linux tasks.<\/li>\r\n<li><strong>ps -e -o pid, args \u2013forest<\/strong>: Show Linux tasks in hierarchical mode.<\/li>\r\n<li><strong>pstree<\/strong>: show a process system tree.<\/li>\r\n<li><strong>kill -9 Process_ID<\/strong>: force a process to close and <strong>kill it<\/strong>.<\/li>\r\n<li><strong>kill -1 Process_ID<\/strong>: force a process to reload the configuration.<\/li>\r\n<li><strong>lsof -p $$<\/strong>: show a list of files opened by processes.<\/li>\r\n<li><strong>lsof \/ home\/user1<\/strong>: shows a list of files open in a given system path.<\/li>\r\n<li><strong>strace -c ls&gt; \/dev\/null<\/strong>: show the system calls made and received by a process.<\/li>\r\n<li><strong>strace -f -e open ls&gt; \/dev\/null<\/strong>: show library calls.<\/li>\r\n<li><strong>watch -n1 &#8216;cat\/proc\/interrupts&#8217;<\/strong>: show interrupts in real-time.<\/li>\r\n<li><strong>last reboot<\/strong>: show <strong>reboot<\/strong> history.<\/li>\r\n<li><strong>lsmod<\/strong>: show the loaded kernel.<\/li>\r\n<li><strong>free -m<\/strong>: shows RAM status in megabytes.<\/li>\r\n<li><strong>smartctl -A \/dev\/hda<\/strong>: monitor the reliability of a hard disk through SMART.<\/li>\r\n<li><strong>smartctl -i \/dev\/hda<\/strong>: check if SMART is enabled on a hard disk.<\/li>\r\n<li><strong>tail \/var\/log\/dmesg<\/strong>: show events inherent to the kernel loading process.<\/li>\r\n<li><strong>tail \/var\/log\/messages<\/strong>: show system events.<\/li>\r\n<\/ol>\r\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> 18<\/span> <span class=\"rt-label rt-postfix\">min read<\/span><\/span>When people hear the word \u201cLinux\u201d they think it is a complicated OS (Operating System) that is only used by hackers or programmers. But it is not as scary as it seems. Linux is a family of open-source Unix operating systems based on the Linux kernel such as Ubuntu, Fedora, Mint, Debian, and others. Moreover, [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":18196,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"pmpro_default_level":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[704],"tags":[802,805,800,803,801,804],"class_list":["post-6589","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-servers-and-infrastructure","tag-basic-linux-commands-list","tag-complete-list-of-linux-commands","tag-linux-basic-commands","tag-linux-commands-list","tag-linux-terminal-commands-cheat-sheet","tag-list-of-linux-commands","pmpro-has-access"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/blog.temok.com\/wp-content\/uploads\/2020\/12\/Linux-Basic-Commands.jpg?fit=750%2C500&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.temok.com\/blog\/wp-json\/wp\/v2\/posts\/6589","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.temok.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.temok.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.temok.com\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.temok.com\/blog\/wp-json\/wp\/v2\/comments?post=6589"}],"version-history":[{"count":9,"href":"https:\/\/www.temok.com\/blog\/wp-json\/wp\/v2\/posts\/6589\/revisions"}],"predecessor-version":[{"id":16676,"href":"https:\/\/www.temok.com\/blog\/wp-json\/wp\/v2\/posts\/6589\/revisions\/16676"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.temok.com\/blog\/wp-json\/wp\/v2\/media\/18196"}],"wp:attachment":[{"href":"https:\/\/www.temok.com\/blog\/wp-json\/wp\/v2\/media?parent=6589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.temok.com\/blog\/wp-json\/wp\/v2\/categories?post=6589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.temok.com\/blog\/wp-json\/wp\/v2\/tags?post=6589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}