{"id":1205,"date":"2024-08-24T17:43:45","date_gmt":"2024-08-24T17:43:45","guid":{"rendered":"https:\/\/winlincloud.com\/?page_id=1205"},"modified":"2024-08-24T17:48:15","modified_gmt":"2024-08-24T17:48:15","slug":"useful-linux-commands","status":"publish","type":"page","link":"https:\/\/winlincloud.com\/?page_id=1205","title":{"rendered":"Useful Linux Commands"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"1205\" class=\"elementor elementor-1205\" data-elementor-settings=\"{&quot;element_pack_global_tooltip_width&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;element_pack_global_tooltip_width_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;element_pack_global_tooltip_width_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;element_pack_global_tooltip_padding&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;top&quot;:&quot;&quot;,&quot;right&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;left&quot;:&quot;&quot;,&quot;isLinked&quot;:true},&quot;element_pack_global_tooltip_padding_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;top&quot;:&quot;&quot;,&quot;right&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;left&quot;:&quot;&quot;,&quot;isLinked&quot;:true},&quot;element_pack_global_tooltip_padding_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;top&quot;:&quot;&quot;,&quot;right&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;left&quot;:&quot;&quot;,&quot;isLinked&quot;:true},&quot;element_pack_global_tooltip_border_radius&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;top&quot;:&quot;&quot;,&quot;right&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;left&quot;:&quot;&quot;,&quot;isLinked&quot;:true},&quot;element_pack_global_tooltip_border_radius_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;top&quot;:&quot;&quot;,&quot;right&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;left&quot;:&quot;&quot;,&quot;isLinked&quot;:true},&quot;element_pack_global_tooltip_border_radius_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;top&quot;:&quot;&quot;,&quot;right&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;left&quot;:&quot;&quot;,&quot;isLinked&quot;:true}}\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-a12e5d0 e-con-full e-flex e-con e-parent\" data-id=\"a12e5d0\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-3a35985 elementor--h-position-left elementor--v-position-middle elementor-arrows-position-inside elementor-pagination-position-inside elementor-widget elementor-widget-slides\" data-id=\"3a35985\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;navigation&quot;:&quot;both&quot;,&quot;autoplay&quot;:&quot;yes&quot;,&quot;pause_on_hover&quot;:&quot;yes&quot;,&quot;pause_on_interaction&quot;:&quot;yes&quot;,&quot;autoplay_speed&quot;:5000,&quot;infinite&quot;:&quot;yes&quot;,&quot;transition&quot;:&quot;slide&quot;,&quot;transition_speed&quot;:500}\" data-widget_type=\"slides.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-swiper\">\n\t\t\t<div class=\"elementor-slides-wrapper elementor-main-swiper swiper-container\" dir=\"ltr\" data-animation=\"fadeInUp\">\n\t\t\t\t<div class=\"swiper-wrapper elementor-slides\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"elementor-repeater-item-71d0eec swiper-slide\"><div class=\"swiper-slide-bg\" role=\"img\"><\/div><div class=\"elementor-background-overlay\"><\/div><div class=\"swiper-slide-inner\" ><div class=\"swiper-slide-contents\"><div class=\"elementor-slide-heading\">Usefull Linux Commands Every New Leaner Needs  To Know<\/div><\/div><\/div><\/div>\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-4980956 e-flex e-con-boxed e-con e-parent\" data-id=\"4980956\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-563639b e-con-full e-flex e-con e-child\" data-id=\"563639b\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-bdbd254 elementor-widget elementor-widget-text-editor\" data-id=\"bdbd254\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><strong>Basics<\/strong><\/p><p><strong>File Hierarchy Standard (FHS)<\/strong><\/p><table width=\"1120\"><thead><tr><td><p><strong>Path<\/strong><\/p><\/td><td><p><strong>Content<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>\/bin<\/p><\/td><td><p>Binaries (User)<\/p><\/td><\/tr><tr><td><p>\/boot<\/p><\/td><td><p>Static boot loader files<\/p><\/td><\/tr><tr><td><p>\/etc<\/p><\/td><td><p>Host specific configs<\/p><\/td><\/tr><tr><td><p>\/lib<\/p><\/td><td><p>Shared libraries and kernel modules<\/p><\/td><\/tr><tr><td><p>\/sbin<\/p><\/td><td><p>Binaries (System\/root)<\/p><\/td><\/tr><tr><td><p>\/var<\/p><\/td><td><p>Varying files (e.g. Logs)<\/p><\/td><\/tr><tr><td><p>\/usr<\/p><\/td><td><p>3rd party software<\/p><\/td><\/tr><tr><td><p>\/proc<\/p><\/td><td><p>Pseudo file system<\/p><\/td><\/tr><tr><td><p>\/sys<\/p><\/td><td><p>Pseudo file system<\/p><\/td><\/tr><tr><td><p>\/mnt<\/p><\/td><td><p>Mountpoint for internal drives<\/p><\/td><\/tr><tr><td><p>\/media<\/p><\/td><td><p>Mountpoint for external drives<\/p><\/td><\/tr><tr><td><p>\/home<\/p><\/td><td><p>User homes<\/p><\/td><\/tr><tr><td><p>\/run<\/p><\/td><td><p>PID files of running processes<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Commands<\/strong><\/p><p><strong>File System Commands<\/strong><\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Options<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>cd<\/p><\/td><td><p>&#8211;<\/p><\/td><td><p>Navigate to last dir<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>~<\/p><\/td><td><p>Navigate to home<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>~username<\/p><\/td><td><p>Navigate to home of specified user<\/p><\/td><\/tr><tr><td><p>pwd<\/p><\/td><td><p>\u00a0<\/p><\/td><td><p>Print working dir<\/p><\/td><\/tr><tr><td><p>ls<\/p><\/td><td><p>\u00a0<\/p><\/td><td><p>Print dir content<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-l<\/p><\/td><td><p>Format as list<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-a<\/p><\/td><td><p>Show hidden items (-A\u00a0without\u00a0.\u00a0and\u00a0..)<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-r<\/p><\/td><td><p>Invert order<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-R<\/p><\/td><td><p>Recurse<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-S<\/p><\/td><td><p>Sort by size<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-t<\/p><\/td><td><p>Sort by date modified<\/p><\/td><\/tr><tr><td><p>mkdir<\/p><\/td><td><p>-p<\/p><\/td><td><p>Create dir with parents<\/p><\/td><\/tr><tr><td><p>cp<\/p><\/td><td><p>-r<\/p><\/td><td><p>Copy dir<\/p><\/td><\/tr><tr><td><p>rmdir<\/p><\/td><td><p>-p<\/p><\/td><td><p>Remove dir and empty parents<\/p><\/td><\/tr><tr><td><p>rm<\/p><\/td><td><p>-rf<\/p><\/td><td><p>Remove dir recursively,\u00a0-f\u00a0without confirmation<\/p><\/td><\/tr><tr><td><p>mv<\/p><\/td><td><p>\u00a0<\/p><\/td><td><p>Move recursively<\/p><\/td><\/tr><tr><td><p>find<\/p><\/td><td><p>-iname pattern<\/p><\/td><td><p>Search dir\/file case-insensitive<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-mmin n<\/p><\/td><td><p>Last modified n minutes ago<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-mtime n<\/p><\/td><td><p>Last modified n days ago<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-regex pattern<\/p><\/td><td><p>Path matches pattern<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-size n[kMG]<\/p><\/td><td><p>By file size (-n\u00a0less than;\u00a0+n\u00a0greater than)<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>! searchparams<\/p><\/td><td><p>Invert search<\/p><\/td><\/tr><\/tbody><\/table><p><strong>File Manipulation<\/strong><\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Options<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>cat<\/p><\/td><td><p>file<\/p><\/td><td><p>Print content<\/p><\/td><\/tr><tr><td><p>tac<\/p><\/td><td><p>file<\/p><\/td><td><p>Print content inverted<\/p><\/td><\/tr><tr><td><p>sort<\/p><\/td><td><p>file<\/p><\/td><td><p>Print sorted<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>file -r -u<\/p><\/td><td><p>Print sorted descending without dublicates<\/p><\/td><\/tr><tr><td><p>head<\/p><\/td><td><p>-n10 file<\/p><\/td><td><p>Print lines 5-10<\/p><\/td><\/tr><tr><td><p>tail<\/p><\/td><td><p>-f file<\/p><\/td><td><p>Print new lines automatically<\/p><\/td><\/tr><tr><td><p>cut<\/p><\/td><td><p>-f -4,7-10,12,15- file<\/p><\/td><td><p>Print selected fields (tab delimited)<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-c -4,7-10,12,15- file<\/p><\/td><td><p>Print selected characters positions<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-f 2,4 -d, &#8211;output-delimiter=$&#8217;\\t&#8217; file<\/p><\/td><td><p>Change delimiter (but use tab for output)<\/p><\/td><\/tr><tr><td><p>uniq<\/p><\/td><td><p>file<\/p><\/td><td><p>Hide consecutive identical lines<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>file -c<\/p><\/td><td><p>Show consecutive identical line count<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>file -u<\/p><\/td><td><p>Hide consecutive identical lines<\/p><\/td><\/tr><tr><td><p>file<\/p><\/td><td><p>file<\/p><\/td><td><p>Get file type<\/p><\/td><\/tr><tr><td><p>wc<\/p><\/td><td><p>file<\/p><\/td><td><p>Count Lines, Words, Chars (Bytes)<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Archiving<\/strong><\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Options<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>tar<\/p><\/td><td><p>cfv archiv.tar file1 file2<\/p><\/td><td><p>Create archive \/ add or overwrite content<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>tfv archiv.tar<\/p><\/td><td><p>Show content<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>xf archiv.tar [-C ~\/extracted]<\/p><\/td><td><p>Extract (and decompress) archive (to ~ \/ extracted)<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>cfvj archiv.tar.bz2 file<\/p><\/td><td><p>Create bzip2 compressed archive<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>cfvz archiv.tar.gz file<\/p><\/td><td><p>Create gzip compressed archive<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>cfa archiv.tar.[komp] file<\/p><\/td><td><p>create compressed archive (auto type based on name)<\/p><\/td><\/tr><tr><td><p>bzip2<\/p><\/td><td><p>file1 file2<\/p><\/td><td><p>Dateien (einzeln) komprimieren<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-d file1 file2<\/p><\/td><td><p>Compress files (one at a time)<\/p><\/td><\/tr><tr><td><p>gzip<\/p><\/td><td><p>file1 file2<\/p><\/td><td><p>Dateien (einzeln) komprimieren<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-d file1 file2<\/p><\/td><td><p>Decompress files<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Disk and File System Management<\/strong><\/p><p><strong>General Disk Manipulation (non-LVM)<\/strong><\/p><p>Creating physical partitions is\u00a0<strong>not required<\/strong>! You can create PVs directly!<\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Options<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>fdisk<\/p><\/td><td><p>-l<\/p><\/td><td><p>List physical disks and partitions<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>\/dev\/sdb<br \/>n<\/p><\/td><td><p>Create new partition<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>\/dev\/sdb<br \/>t<br \/>8e<\/p><\/td><td><p>Change partition type to\u00a0<em>Linux LVM<\/em><\/p><\/td><\/tr><tr><td><p>mkfs.xfs<\/p><\/td><td><p>\/dev\/myVG\/myVol<\/p><\/td><td><p>Format LV with XFS<\/p><\/td><\/tr><tr><td><p>mkfs.ext4<\/p><\/td><td><p>-f \/dev\/myVG\/myVol<\/p><\/td><td><p>Format LV with EXT4 (overwrite)<\/p><\/td><\/tr><tr><td><p>blkid<\/p><\/td><td><p>\/dev\/myVG\/myVol<\/p><\/td><td><p>Show UUID and formatting of volume<\/p><\/td><\/tr><tr><td><p>mount<\/p><\/td><td><p>\u00a0<\/p><\/td><td><p>Show current mounted file systems<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-t ext4 \/dev\/myVG\/myVol \/mountpoint<\/p><\/td><td><p>Mount LV to \/mountpoint<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-a<\/p><\/td><td><p>Mount as configured in \/etc\/fstab<\/p><\/td><\/tr><tr><td><p>umount<\/p><\/td><td><p>\u00a0<\/p><\/td><td><p>Unmount a file system<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>\/dev\/myVG\/myVol<\/p><\/td><td><p>Unmount LV from \/mountpoint<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>\/mountpoint<\/p><\/td><td><p>Unmount LV from \/mountpoint<\/p><\/td><\/tr><tr><td><p>df<\/p><\/td><td><p>\u2013<\/p><\/td><td><p>Show disk usage<\/p><\/td><\/tr><tr><td><p>xfs_growfs<\/p><\/td><td><p>\/dev\/myVG\/myVol<\/p><\/td><td><p>Resize xfs filesystem<\/p><\/td><\/tr><tr><td><p>resize2fs<\/p><\/td><td><p>\/dev\/myVG\/myVol<\/p><\/td><td><p>Resize ext3\/4 filesystem<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Other<\/strong><\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Options<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>&lt;command&gt;<\/p><\/td><td><p>&#8211;help<\/p><\/td><td><p>Help of current command (not standardized)<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-h<\/p><\/td><td><p>\u00a0<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-?<\/p><\/td><td><p>\u00a0<\/p><\/td><\/tr><tr><td><p>man<\/p><\/td><td><p>&lt;command&gt;<\/p><\/td><td><p>Manual page of command<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-k keyword<\/p><\/td><td><p>Search command by keyword (oder\u00a0apropos)<\/p><\/td><\/tr><tr><td><p>alias<\/p><\/td><td><p>\u00a0<\/p><\/td><td><p>Show aliases<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>name=&#8217;befehl&#8217;<\/p><\/td><td><p>Create alias<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Globs (Wildcards)<\/strong><\/p><p>The dot\u00a0.\u00a0in front of hidden items is ignored by glob patterns!<\/p><table width=\"1120\"><thead><tr><td><p><strong>Character<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>?<\/p><\/td><td><p>Any single character<\/p><\/td><\/tr><tr><td><p>*<\/p><\/td><td><p>Any characters<\/p><\/td><\/tr><tr><td><p>[ac-e]<\/p><\/td><td><p>1 character in enum<\/p><\/td><\/tr><tr><td><p>[!ac-e]<\/p><\/td><td><p>1 character not in enum<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Regex<\/strong><\/p><p>Bash itself does not know regex. Use programs like\u00a0grep,\u00a0sed,\u00a0awk.<\/p><p><strong>Control characters<\/strong><\/p><table width=\"1120\"><thead><tr><td><p><strong>Character<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>.<\/p><\/td><td><p>Any single character<\/p><\/td><\/tr><tr><td><p>[ac-e]<\/p><\/td><td><p>1 character in enum<\/p><\/td><\/tr><tr><td><p>[^ac-e]<\/p><\/td><td><p>1 character not in enum<\/p><\/td><\/tr><tr><td><p>^<\/p><\/td><td><p>Start of string<\/p><\/td><\/tr><tr><td><p>$<\/p><\/td><td><p>End of string<\/p><\/td><\/tr><tr><td><p>\\d<\/p><\/td><td><p>Digit<\/p><\/td><\/tr><tr><td><p>\\D<\/p><\/td><td><p>Not a digit<\/p><\/td><\/tr><tr><td><p>\\s<\/p><\/td><td><p>Whitespace<\/p><\/td><\/tr><tr><td><p>\\S<\/p><\/td><td><p>Not a Whitespace<\/p><\/td><\/tr><tr><td><p>\\&lt;<\/p><\/td><td><p>Start of word<\/p><\/td><\/tr><tr><td><p>\\&gt;<\/p><\/td><td><p>End of word<\/p><\/td><\/tr><tr><td><p>pattern?<\/p><\/td><td><p>Quantifier 0 or 1<\/p><\/td><\/tr><tr><td><p>pattern*<\/p><\/td><td><p>Quantifier 0..n<\/p><\/td><\/tr><tr><td><p>pattern+<\/p><\/td><td><p>Quantifier 1..n<\/p><\/td><\/tr><tr><td><p>pattern{x}<\/p><\/td><td><p>Quantifier exactly x<\/p><\/td><\/tr><tr><td><p>pattern{x,}<\/p><\/td><td><p>Quantifier x..n<\/p><\/td><\/tr><tr><td><p>pattern{x,y}<\/p><\/td><td><p>Quantifier x..y<\/p><\/td><\/tr><tr><td><p>pattern{,y}<\/p><\/td><td><p>Quantifier 0..y<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Grep<\/strong><\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Options<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>grep<\/p><\/td><td><p>pattern file<\/p><\/td><td><p>Extended Regex<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-E pattern file<\/p><\/td><td><p>Extended Regex<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-v pattern file<\/p><\/td><td><p>Invert match<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-w pattern file<\/p><\/td><td><p>Word match<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-i pattern file<\/p><\/td><td><p>Ignore case<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Stream redirection<\/strong><\/p><ul><li>&gt;\u00a0overwrite<\/li><li>&gt;&gt;\u00a0append<\/li><\/ul><table width=\"1120\"><thead><tr><td><p><strong>Character<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>&gt; file\u00a0or\u00a01&gt; file<\/p><\/td><td><p>STDOUT to file<\/p><\/td><\/tr><tr><td><p>&lt; file<\/p><\/td><td><p>Datei to STDIN<\/p><\/td><\/tr><tr><td><p>2&gt; file<\/p><\/td><td><p>STDERR to file<\/p><\/td><\/tr><tr><td><p>2&gt;&amp;1<\/p><\/td><td><p>STDERR to same target as STDOUT<\/p><\/td><\/tr><tr><td><p>&gt; file 2&gt;&amp;1<\/p><\/td><td><p>STDOUT and STDERR to file<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Text Readers &amp; Editors<\/strong><\/p><p><strong>Less<\/strong><\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>q<\/p><\/td><td><p>Quit<\/p><\/td><\/tr><tr><td><p>R<\/p><\/td><td><p>Refresh content<\/p><\/td><\/tr><tr><td><p>F<\/p><\/td><td><p>Auto scroll<\/p><\/td><\/tr><tr><td><p>g number<\/p><\/td><td><p>Go to line<\/p><\/td><\/tr><tr><td><p>m lowercaseLetter<\/p><\/td><td><p>Mark line<\/p><\/td><\/tr><tr><td><p>&#8216; lowercaseLetter<\/p><\/td><td><p>Go to mark<\/p><\/td><\/tr><tr><td><p>\/pattern<\/p><\/td><td><p>Search forward<\/p><\/td><\/tr><tr><td><p>?pattern<\/p><\/td><td><p>Search backward<\/p><\/td><\/tr><tr><td><p>n<\/p><\/td><td><p>Next search result<\/p><\/td><\/tr><tr><td><p>N<\/p><\/td><td><p>Last search result<\/p><\/td><\/tr><tr><td><p>ESC u<\/p><\/td><td><p>Remove highlighting from search<\/p><\/td><\/tr><\/tbody><\/table><p><strong>VI<\/strong><\/p><p><strong>VI\/VIM Editing<\/strong><\/p><p>To leave editing mode press\u00a0ESC.<\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>i<\/p><\/td><td><p>insert before cursor<\/p><\/td><\/tr><tr><td><p>a<\/p><\/td><td><p>insert after cursor<\/p><\/td><\/tr><tr><td><p>A<\/p><\/td><td><p>insert at end of line<\/p><\/td><\/tr><tr><td><p>o<\/p><\/td><td><p>new line below<\/p><\/td><\/tr><tr><td><p>O<\/p><\/td><td><p>new line above<\/p><\/td><\/tr><tr><td><p>u<\/p><\/td><td><p>undo<\/p><\/td><\/tr><tr><td><p>.<\/p><\/td><td><p>repeat last command<\/p><\/td><\/tr><tr><td><p>yy<\/p><\/td><td><p>copy line<\/p><\/td><\/tr><tr><td><p>5yy<\/p><\/td><td><p>copy 5 lines<\/p><\/td><\/tr><tr><td><p>p<\/p><\/td><td><p>paste below<\/p><\/td><\/tr><tr><td><p>P<\/p><\/td><td><p>paste above<\/p><\/td><\/tr><tr><td><p>x<\/p><\/td><td><p>delete character<\/p><\/td><\/tr><tr><td><p>5x<\/p><\/td><td><p>delete 5 characters<\/p><\/td><\/tr><tr><td><p>dd<\/p><\/td><td><p>delete line<\/p><\/td><\/tr><tr><td><p>5dd<\/p><\/td><td><p>delete 5 lines<\/p><\/td><\/tr><tr><td><p>:10,20d<\/p><\/td><td><p>delete lines 10-20<\/p><\/td><\/tr><tr><td><p>d0<\/p><\/td><td><p>delete to line begin<\/p><\/td><\/tr><tr><td><p>d$<\/p><\/td><td><p>delete to line end<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Navigation<\/strong><\/p><p>Navigate as usual with\u00a0arrow keys,\u00a0home,\u00a0end,\u00a0pg up,\u00a0pg dn.<\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>5G<\/p><\/td><td><p>go to line 5<\/p><\/td><\/tr><tr><td><p>H<\/p><\/td><td><p>go to top of screen<\/p><\/td><\/tr><tr><td><p>M<\/p><\/td><td><p>go to middle of screen<\/p><\/td><\/tr><tr><td><p>L<\/p><\/td><td><p>go to end of screen<\/p><\/td><\/tr><tr><td><p>5w<\/p><\/td><td><p>move over 7 words<\/p><\/td><\/tr><tr><td><p>5b<\/p><\/td><td><p>move back 5 words<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Other<\/strong><\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>\/foo<\/p><\/td><td><p>search forward<\/p><\/td><\/tr><tr><td><p>?foo<\/p><\/td><td><p>search backwards<\/p><\/td><\/tr><tr><td><p>n<\/p><\/td><td><p>repeat search<\/p><\/td><\/tr><tr><td><p>:w<\/p><\/td><td><p>save<\/p><\/td><\/tr><tr><td><p>:q<\/p><\/td><td><p>close<\/p><\/td><\/tr><tr><td><p>:wq<\/p><\/td><td><p>save and close<\/p><\/td><\/tr><tr><td><p>:q!<\/p><\/td><td><p>close without saving<\/p><\/td><\/tr><tr><td><p>:!command<\/p><\/td><td><p>run bash command<\/p><\/td><\/tr><tr><td><p>:r foo<\/p><\/td><td><p>read file foo into this file<\/p><\/td><\/tr><\/tbody><\/table><p><strong>User and Group Management<\/strong><\/p><p><strong>UID<\/strong><\/p><table width=\"1120\"><thead><tr><td><p><strong>UID<\/strong><\/p><\/td><td><p><strong>Type<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>&lt;1000<\/p><\/td><td><p>system account<\/p><\/td><\/tr><tr><td><p>&gt;1000<\/p><\/td><td><p>user account<\/p><\/td><\/tr><\/tbody><\/table><p><strong>User Database<\/strong><\/p><p>User info without passwords is stored in\u00a0\/etc\/passwd.<\/p><table width=\"1120\"><thead><tr><td><p><strong>username<\/strong><\/p><\/td><td><p><strong>PW<\/strong><\/p><\/td><td><p><strong>UID<\/strong><\/p><\/td><td><p><strong>GID<\/strong><\/p><\/td><td><p><strong>GECOS<\/strong><\/p><\/td><td><p><strong>HOME<\/strong><\/p><\/td><td><p><strong>SHELL<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>hfict<\/p><\/td><td><p>x<\/p><\/td><td><p>1000<\/p><\/td><td><p>1000<\/p><\/td><td><p>\u00a0<\/p><\/td><td><p>\/home\/hfict<\/p><\/td><td><p>\/bin\/bash<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Group Database<\/strong><\/p><p>Group info with secondary group members are stored in\u00a0\/etc\/group. Primary group members are identified by GID in user database.<\/p><table width=\"1120\"><thead><tr><td><p><strong>groupname<\/strong><\/p><\/td><td><p><strong>PW<\/strong><\/p><\/td><td><p><strong>GID<\/strong><\/p><\/td><td><p><strong>Users<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>wheel<\/p><\/td><td><p>x<\/p><\/td><td><p>10<\/p><\/td><td><p>hfict,user2<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Password Database<\/strong><\/p><p>Hashed user passwords are stored in\u00a0\/etc\/shadow. Password encryption is configured in\u00a0\/etc\/login.defs.<\/p><table width=\"1120\"><thead><tr><td><p><strong>username<\/strong><\/p><\/td><td><p><strong>PW<\/strong><\/p><\/td><td><p><strong>Last PW change<\/strong><\/p><\/td><td><p><strong>Minimum<\/strong><\/p><\/td><td><p><strong>Maximum<\/strong><\/p><\/td><td><p><strong>Warn<\/strong><\/p><\/td><td><p><strong>Inactive<\/strong><\/p><\/td><td><p><strong>Expire<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>hfict<\/p><\/td><td><p>[hash]<\/p><\/td><td><p>17803<\/p><\/td><td><p>0<\/p><\/td><td><p>99999<\/p><\/td><td><p>7<\/p><\/td><td><p>\u00a0<\/p><\/td><td><p>\u00a0<\/p><\/td><\/tr><\/tbody><\/table><p>PW:<\/p><ul><li>[hash]\u00a0Encrypted test password<\/li><li>! [hash]\u00a0Account locked<\/li><li>!!\u00a0or\u00a0*\u00a0Account locked, no password set<\/li><\/ul><p><strong>Commands<\/strong><\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Param<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>id<\/p><\/td><td><p>username<\/p><\/td><td><p>Show a user\u2019s ID and groups<\/p><\/td><\/tr><tr><td><p>who<\/p><\/td><td><p>\u00a0<\/p><\/td><td><p>Show logged in users<\/p><\/td><\/tr><tr><td><p>last<\/p><\/td><td><p>\u00a0<\/p><\/td><td><p>Show last logins<\/p><\/td><\/tr><tr><td><p>lastb<\/p><\/td><td><p>\u00a0<\/p><\/td><td><p>Show last failed logins<\/p><\/td><\/tr><tr><td><p>sudo<\/p><\/td><td><p>-u user command<\/p><\/td><td><p>Execute command with user rights (default is root)<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-i\u00a0or\u00a0su &#8211;<\/p><\/td><td><p>Shell with root rights<\/p><\/td><\/tr><tr><td><p>su<\/p><\/td><td><p>\u00a0<\/p><\/td><td><p>Shell as root (non-login shell)<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>&#8211;<\/p><\/td><td><p>Shell as root (login shell)<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>&#8211; user<\/p><\/td><td><p>Shell as user<\/p><\/td><\/tr><tr><td><p>useradd<\/p><\/td><td><p>-u 2101 -g primarygroup -c comment username<\/p><\/td><td><p>Create user (without\u00a0-g, new group will be created)<\/p><\/td><\/tr><tr><td><p>usermod<\/p><\/td><td><p>-G group1, group2<\/p><\/td><td><p>Define (overwrite) secondary groups<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-ag group, group2<\/p><\/td><td><p>Add secondary groups<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-l username<\/p><\/td><td><p>Change username<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-L<\/p><\/td><td><p>Lock Account<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-U<\/p><\/td><td><p>Unlock Account<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-s shellpath<\/p><\/td><td><p>Change shell<\/p><\/td><\/tr><tr><td><p>userdel<\/p><\/td><td><p>-r username<\/p><\/td><td><p>Delete user including home and mail spool<\/p><\/td><\/tr><tr><td><p>passwd<\/p><\/td><td><p>username<\/p><\/td><td><p>Change password (interactive)<\/p><\/td><\/tr><tr><td><p>groupadd<\/p><\/td><td><p>groupname<\/p><\/td><td><p>Create group (optionally set GID with\u00a0-g)<\/p><\/td><\/tr><tr><td><p>groupdel<\/p><\/td><td><p>groupname<\/p><\/td><td><p>Delete group<\/p><\/td><\/tr><\/tbody><\/table><p><strong>File System Permissions<\/strong><\/p><p>Permissions can be set on:<\/p><ul><li>User (owner)<\/li><li>Group (owner)<\/li><li>Others<\/li><\/ul><p>Only root can change\u00a0<em>User<\/em>.\u00a0<em>User<\/em>\u00a0can change\u00a0<em>Group<\/em>.<\/p><p>Basic permissions (Add binary flags to combine):<\/p><table width=\"1120\"><thead><tr><td><p><strong>Char<\/strong><\/p><\/td><td><p><strong>Binary Flag<\/strong><\/p><\/td><td><p><strong>Permission<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>r<\/p><\/td><td><p>4<\/p><\/td><td><p>read<\/p><\/td><\/tr><tr><td><p>w<\/p><\/td><td><p>2<\/p><\/td><td><p>write<\/p><\/td><\/tr><tr><td><p>x<\/p><\/td><td><p>1<\/p><\/td><td><p>execute<\/p><\/td><\/tr><\/tbody><\/table><p>Advanced permissions (place in front of basic permissions:\u00a0chmod 1777 shared).:<\/p><table width=\"1120\"><thead><tr><td><p><strong>Char<\/strong><\/p><\/td><td><p><strong>Binary Flag<\/strong><\/p><\/td><td><p><strong>Name<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>t \/ T<\/p><\/td><td><p>1<\/p><\/td><td><p>Sticky Bit<\/p><\/td><td><p><em>Others<\/em>\u00a0can\u2019t delete content (only applicable for directories)<\/p><\/td><\/tr><tr><td><p>s \/ S<\/p><\/td><td><p>2<\/p><\/td><td><p>SGID-Bit<\/p><\/td><td><p>File: run with permissions of\u00a0<em>Group<\/em><br \/>Dir: New elements inherit\u00a0<em>Group<\/em><\/p><\/td><\/tr><tr><td><p>s \/ S<\/p><\/td><td><p>4<\/p><\/td><td><p>SUID-Bit<\/p><\/td><td><p>File is run with permissions of\u00a0<em>User<\/em>\u00a0(only applicable for files)<\/p><\/td><\/tr><\/tbody><\/table><p>Advanced permissions replace the\u00a0<strong>x<\/strong>\u00a0when using\u00a0ls -l. Lower case if\u00a0<strong>x<\/strong>\u00a0is set, upper case if\u00a0<strong>x<\/strong>\u00a0is not set.<\/p><p><em>Read<\/em>\u00a0permission on a directory only allows to see the directory itself but not it\u2019s contents. Use\u00a0<em>execute<\/em>\u00a0permission to show contents.<\/p><p><strong>Commands<\/strong><\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Options<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>chmod<\/p><\/td><td><p>-R [uog] dirname<\/p><\/td><td><p>Set permissions recursively using binary flags<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>+[suog] filename<\/p><\/td><td><p>Add permissions using binary flags<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>-[suog] filename<\/p><\/td><td><p>Remove permissions using binary flags<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>u+x filename<\/p><\/td><td><p>Add\u00a0<em>execute<\/em>\u00a0permission for\u00a0<em>User<\/em><\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>g+wx filename<\/p><\/td><td><p>Add\u00a0<em>write<\/em>\u00a0and\u00a0<em>execute<\/em>\u00a0permissions for\u00a0<em>Group<\/em><\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>o-r filename<\/p><\/td><td><p>Remove\u00a0<em>read<\/em>\u00a0permission for\u00a0<em>Others<\/em><\/p><\/td><\/tr><tr><td><p>chown<\/p><\/td><td><p>-R user:group filename<\/p><\/td><td><p>Change owner (<em>User<\/em>\u00a0&amp;\u00a0<em>Group<\/em>) recursively<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>user filename<\/p><\/td><td><p>Change owner (<em>User<\/em>)<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>:group filename<\/p><\/td><td><p>Change owner (<em>Group<\/em>)<\/p><\/td><\/tr><tr><td><p>chgroup<\/p><\/td><td><p>group filename<\/p><\/td><td><p>Change owner (<em>Group<\/em>)<\/p><\/td><\/tr><\/tbody><\/table><p><strong>SSH<\/strong><\/p><p>SSH Configuration is done in\u00a0\/etc\/ssh\/sshd_config.<\/p><p>Reload SSH service with\u00a0systemctl reload sshd\u00a0to apply changes!<\/p><p>DenyUsers, AllowUsers, DenyGroups, AllowGroups override each other and are applied in the order listed above.<\/p><table width=\"1120\"><thead><tr><td><p><strong>Config<\/strong><\/p><\/td><td><p><strong>Option<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>PermitRootLogin<\/p><\/td><td><p>no<\/p><\/td><td><p>Deny root to login via SSH<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>yes<\/p><\/td><td><p>Allow root to login via SSH<\/p><\/td><\/tr><tr><td><p>\u00a0<\/p><\/td><td><p>without-password<\/p><\/td><td><p>Allow only with private\/public key auth<\/p><\/td><\/tr><tr><td><p>AllowUsers<\/p><\/td><td><p>user1 user2<\/p><\/td><td><p>Allow only user1 and user2<\/p><\/td><\/tr><tr><td><p>DenyUsers<\/p><\/td><td><p>user1 user2<\/p><\/td><td><p>Allow all users but user1 and user2<\/p><\/td><\/tr><tr><td><p>AllowGroups<\/p><\/td><td><p>group1 group2<\/p><\/td><td><p>Allow only users from specified groups<\/p><\/td><\/tr><tr><td><p>DenyGroups<\/p><\/td><td><p>group1 group2<\/p><\/td><td><p>Allow all users but those in specified groups<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Cronjobs<\/strong><\/p><p>Crontab<\/p><p>Cronjobs are configured in crontab files. Do not edit these files directly. Use\u00a0crontab -e\u00a0instead. This runs all required actions to activate a cronjob after saving the edited crontab. The locations are as follows:<\/p><ul><li>\/var\/spool\/cron\/username\u00a0user specific<\/li><li>\/etc\/crontab\u00a0system wide crontab<\/li><\/ul><p>The format of the files is (user specific crontabs\u00a0<strong>do not<\/strong>\u00a0have the column\u00a0<em>user-name<\/em>):<\/p><p>Example of job definition:<\/p><p>.&#8212;&#8212;&#8212;&#8212;&#8212;- minute (0 &#8211; 59 | *\/5 [every 5 minutes])<\/p><p>|\u00a0 .&#8212;&#8212;&#8212;&#8212;- hour (0 &#8211; 23)<\/p><p>|\u00a0 |\u00a0 .&#8212;&#8212;&#8212;- day of month (1 &#8211; 31)<\/p><p>|\u00a0 |\u00a0 |\u00a0 .&#8212;&#8212;- month (1 &#8211; 12) OR jan,feb,mar,apr &#8230;<\/p><p>|\u00a0 |\u00a0 |\u00a0 |\u00a0 .&#8212;- day of week (0 &#8211; 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat<\/p><p>|\u00a0 |\u00a0 |\u00a0 |\u00a0 |<\/p><p>*\u00a0 *\u00a0 *\u00a0 *\u00a0 * user-name\u00a0 command to be executed<\/p><p>\u00a0<\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>rpm -q cronie<\/p><\/td><td><p>Check if package is installed<\/p><\/td><\/tr><tr><td><p>systemctl status crond.service<\/p><\/td><td><p>Check if service is running<\/p><\/td><\/tr><tr><td><p>crontab -l<\/p><\/td><td><p>List current users crontab<\/p><\/td><\/tr><tr><td><p>crontab -e<\/p><\/td><td><p>Edit current users crontab<\/p><\/td><\/tr><tr><td><p>crontab -e -u username<\/p><\/td><td><p>Edit specific users crontab<\/p><\/td><\/tr><tr><td><p>crontab -r<\/p><\/td><td><p>Remove current users crontab<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Script folders<\/strong><\/p><p>Scripts in one of the following directories will be executed at the interval specified by the directory\u2019s name:<\/p><ul><li>\/etc\/cron.hourly<\/li><li>\/etc\/cron.daily<\/li><li>\/etc\/cron.weekly<\/li><li>\/etc\/cron.monthly<\/li><\/ul><p><strong>Allow \/ Deny usage<\/strong><\/p><p>Add user names one per line to the following files:<\/p><ul><li>\/etc\/cron.allow\u00a0Whitelist<\/li><li>\/etc\/cron.deny\u00a0Blacklist<\/li><\/ul><p>If none of the files exists, all users are allowed.<\/p><p><strong>Logs and Results<\/strong><\/p><p>Execution of cronjobs is logged in\u00a0\/var\/log\/cron. Results are sent to the users mail\u00a0\/var\/spool\/mail\/username.<\/p><p><strong>Package Management<\/strong><\/p><p><strong>RPM<\/strong><\/p><p>RPM<\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>rpm -i rpmfile|rpmurl<\/p><\/td><td><p>Install package<\/p><\/td><\/tr><tr><td><p>rpm -e packagename<\/p><\/td><td><p>Uninstall package<\/p><\/td><\/tr><tr><td><p>rpm -q packagename<\/p><\/td><td><p>Check if package is installed<\/p><\/td><\/tr><tr><td><p>rpm -ql packagename<\/p><\/td><td><p>List files in a package<\/p><\/td><\/tr><tr><td><p>rpm -qa<\/p><\/td><td><p>List all installed packages<\/p><\/td><\/tr><tr><td><p>rpm -qf \/path\/to\/file<\/p><\/td><td><p>Get package that installed the file<\/p><\/td><\/tr><tr><td><p>rpm -qf $(which &lt;exe&gt;)<\/p><\/td><td><p>Get package that installed the executable<\/p><\/td><\/tr><tr><td><p>rpm -V packagename<\/p><\/td><td><p>Validate installed package<\/p><\/td><\/tr><\/tbody><\/table><p><strong>YUM<\/strong><\/p><p>YUM is configured in\u00a0\/etc\/yum.conf<\/p><p>Repos are configured in\u00a0\/etc\/yum.repos.d\/<\/p><p>Log is in\u00a0\/var\/log\/yum.log<\/p><table width=\"1120\"><thead><tr><td><p><strong>Command<\/strong><\/p><\/td><td><p><strong>Description<\/strong><\/p><\/td><\/tr><\/thead><tbody><tr><td><p>yum install packagename [-y]<\/p><\/td><td><p>Install package (-y\u00a0no confirm message)<\/p><\/td><\/tr><tr><td><p>yum remove packagename<\/p><\/td><td><p>Uninstall package<\/p><\/td><\/tr><tr><td><p>yum update<\/p><\/td><td><p>Update all installed packages<\/p><\/td><\/tr><tr><td><p>yum update packagename<\/p><\/td><td><p>Update specific package<\/p><\/td><\/tr><tr><td><p>yum update pattern*<\/p><\/td><td><p>Update packages using wildcard<\/p><\/td><\/tr><tr><td><p>yum info packagename<\/p><\/td><td><p>Get detailed info about package<\/p><\/td><\/tr><tr><td><p>yum list packagename<\/p><\/td><td><p>List installed and available packages<\/p><\/td><\/tr><tr><td><p>yum search searchstring<\/p><\/td><td><p>search for a package (name &amp; summary)<\/p><\/td><\/tr><tr><td><p>yum search all searchstring<\/p><\/td><td><p>search for a package (all infos)<\/p><\/td><\/tr><tr><td><p>yum deplist packagename<\/p><\/td><td><p>List dependencies of a package<\/p><\/td><\/tr><tr><td><p>yum reinstall packagename<\/p><\/td><td><p>Reinstall (corrupted) package<\/p><\/td><\/tr><tr><td><p>yumdownloader &#8211;resolve packagename<\/p><\/td><td><p>Download rpm package with dependencies<\/p><\/td><\/tr><\/tbody><\/table><p><strong>Directory Navigation<\/strong><\/p><ul><li>cd \u2013 change working directory<\/li><li>ls- list directory contents<\/li><li>dir- directory listing, columnar format<\/li><li>pwd- return working directory name<\/li><li>tree- list subdirectories in a tree structure<\/li><\/ul><p><strong>File Commands<\/strong><\/p><ul><li>cat\/tac- concatenate and print files<\/li><li>diff\/sdiff- compare files line by line<\/li><li>find- search for files<\/li><li>grep- file pattern matcher<\/li><li>head- display the first lines of a file<\/li><li>locate- find files and directories<\/li><li>stat- display file status<\/li><li>tail- display the last lines of a file<\/li><li>unique- report or filter out repeated lines in a file<\/li><\/ul><p><strong>File and Directory Manipulation<\/strong><\/p><ul><li>awk- pattern-directed scanning and processing language<\/li><li>chmod- change permissions<\/li><li>chown- change file owner and group<\/li><li>cp- copy files and directories<\/li><li>cut- remove sections from files<\/li><li>mkdir- make a new directory<\/li><li>mv- move files and directories<\/li><li>nano- text editor<\/li><li>rm- delete files and directories<\/li><li>rmdir- remove directory<\/li><li>paste- merge corresponding or subsequent lines of file<\/li><li>rsync- remote copy files<\/li><li>scp- secure copy<\/li><li>basename- strips directory information and suffixes from file path<\/li><li>sed- text transformation tool<\/li><li>sort- arrange or merge lines of files<\/li><li>split- split a file into pieces<\/li><li>touch- change file access and modification times<\/li><li>vim- text editor<\/li><\/ul><p><strong>Package archive and compression tools<\/strong><\/p><ul><li>bzip2- block-sorting file compressor<\/li><li>gzip- compression tool<\/li><li>gunzip- decompression tool<\/li><li>tar- create, extract and manipulate archives<\/li><li>zip- package and compress files<\/li><li>unzip- list, test, extract compressed ZIP files<\/li><\/ul><p><strong>System commands<\/strong><\/p><ul><li>crontab- maintain individual tables used to drive the cron daemon<\/li><li>df- display free disk space<\/li><li>du- display disk usage statistics<\/li><li>free- show memory usage information<\/li><li>hostname- set or print name of current host system<\/li><li>hostnamectl- change hostname settings<\/li><li>ionice- get\/set I\/O process priority<\/li><li>iostat- I\/O statistics<\/li><li>kill- terminate or signal a process by id<\/li><li>killall- kill processes by name<\/li><li>lsblk- display block and loop devices<\/li><li>lsof- list open files<\/li><li>mpstat- CPU statistics<\/li><li>ncdu- curses-based disk usage<\/li><li>ps- display process status<\/li><li>pstree- show processes in tree format<\/li><li>reboot- restart the system<\/li><li>service- run an init script<\/li><li>shutdown- close down the system at a specific time<\/li><li>top\/htop- display process information<\/li><li>uname- prints operating system details<\/li><li>useradd- add\/update user accounts<\/li><li>userdel- delete user account<\/li><li>usermod- modify user properties<\/li><li>vmstat- virtual memory statistics<\/li><li>whereis- locate programs<\/li><\/ul><p><strong>Networking Commands<\/strong><\/p><ul><li>dig- DNS lookup utility<\/li><li>ifconfig- configure network interface parameters<\/li><li>ip- perform network administration tasks<\/li><li>iptable- configure IPv4 network firewall<\/li><li>lscpu- display CPU architecture information<\/li><li>netstat- show network status<\/li><li>ping- check network connectivity<\/li><li>whois- information about Internet domain names and network numbers<\/li><\/ul><p><strong>Package Management<\/strong><\/p><ul><li>apt- Debian package management<\/li><li>rpm- RPM package manager (RedHat)<\/li><li>yum- package manager for RedHat Linux<\/li><\/ul><p><strong>User Information commands<\/strong><\/p><p>For user modification, see useradd, userdel, usermod under System commands<\/p><ul><li>groups- show group memberships<\/li><li>finger- shows information about users<\/li><li>last- displays most recent user logins<\/li><li>passwd- modify a user\u2019s password<\/li><li>w- display who is logged in and what they are doing<\/li><li>who- display who is logged in<\/li><li>whoami- display effective user id<\/li><\/ul><p><strong>Session commands<\/strong><\/p><ul><li>clear- clear terminal screen<\/li><li>env- display environment variables, or set variables for command execution<\/li><li>exit- close the active session\/shell<\/li><li>printenv- print specified environment variables<\/li><li>history- display the command history<\/li><li>login- login and initiate a user session<\/li><li>nohup- invoke a utility immune to hangups<\/li><li>sleep- suspend execution for a time interval<\/li><li>ssh- secure shell login<\/li><li>su- substitute user identity<\/li><li>sudo- execute a command as another user<\/li><li>screen- start a screen session<\/li><\/ul><p><strong>Getting Help<\/strong><\/p><ul><li>man- format and display online manual pages<\/li><li>help- displays help about basic commands not covered by \u2018man\u2019<\/li><li>whatis- display one-line command descriptions<\/li><\/ul><p><strong>Applications<\/strong><\/p><ul><li>bc- basic calculator<\/li><li>cal- displays a calendar<\/li><li>cmatrix- enter the Matrix<\/li><li>curl- transfer data to or from a server<\/li><li>echo- display interpreted arguments<\/li><li>factor- prints prime factors of numbers<\/li><li>printf- format output<\/li><li>sl- runs a steam locomotive across your terminal<\/li><li>wget- non-interactive web file download<\/li><li>xargs- construct argument lists and execute utility<\/li><li>yes- print continous output stream<\/li><li>banner- Writes ASCII character strings in large letters to standard output.<\/li><li>aplay- aplay is a command-line to play audio files.<\/li><li>spd-say- plays the given text as the sound from the command line.<\/li><\/ul><p>\u00a0<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Usefull Linux Commands Every New Leaner Needs To Know Basics File Hierarchy Standard (FHS) Path Content \/bin Binaries (User) \/boot Static boot loader files \/etc Host specific configs \/lib Shared libraries and kernel modules \/sbin Binaries (System\/root) \/var Varying files (e.g. Logs) \/usr 3rd party software \/proc Pseudo file system \/sys Pseudo file system \/mnt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_header_footer","meta":{"footnotes":""},"class_list":["post-1205","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/winlincloud.com\/index.php?rest_route=\/wp\/v2\/pages\/1205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/winlincloud.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/winlincloud.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/winlincloud.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/winlincloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1205"}],"version-history":[{"count":10,"href":"https:\/\/winlincloud.com\/index.php?rest_route=\/wp\/v2\/pages\/1205\/revisions"}],"predecessor-version":[{"id":1219,"href":"https:\/\/winlincloud.com\/index.php?rest_route=\/wp\/v2\/pages\/1205\/revisions\/1219"}],"wp:attachment":[{"href":"https:\/\/winlincloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}