{"id":2093,"date":"2022-04-01T10:28:22","date_gmt":"2022-04-01T05:28:22","guid":{"rendered":"https:\/\/step-up.uz\/?p=2093"},"modified":"2022-11-09T10:45:14","modified_gmt":"2022-11-09T05:45:14","slug":"linuxda-fayllar-bilan-ishlash","status":"publish","type":"post","link":"https:\/\/step-up.uz\/en\/linuxda-fayllar-bilan-ishlash\/","title":{"rendered":"Linuxda fayl tarkibi buyruqlari bilan ishlash"},"content":{"rendered":"<p class=\"has-text-align-justify has-medium-font-size\">&nbsp;&nbsp;&nbsp;&nbsp;Linux operatsion tizimida fayl tarkibi bilan ishlovchi buyruqlar juda ko&#8217;p. Ushbu buyruqlardan eng ko&#8217;p qo&#8217;llaniladigan asosiy qismini ko&#8217;rib chiqamiz. Quyidagi jadvalda biz ushbu buyruqlar bilan tanishamiz:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular has-medium-font-size\"><table><tbody><tr><th>Buyruqlar<\/th><th>Vazifasi<\/th><\/tr><tr><td><strong>grep<\/strong><\/td><td>U berilgan fayldagi matn va satrlarni qidirish uchun ishlatiladi.<\/td><\/tr><tr><td><strong>head<\/strong><\/td><td>U faylning boshlanishini ko&#8217;rsatadi.<\/td><\/tr><tr><td><strong>tail<\/strong><\/td><td>U faylning oxirgi oxirgi qismini ko&#8217;rsatadi.<\/td><\/tr><tr><td><strong>more<\/strong><\/td><td>Buyruqlar qatori tarkibni sahifa shaklida yoki ko&#8217;proq formatda ko&#8217;rsatadi.<\/td><\/tr><tr><td><strong>less<\/strong><\/td><td>Buyruqlar qatori tarkibni sahifa shaklida yoki kamroq formatda ko&#8217;rsatadi.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">GREP buyru&#8217;gi<\/h2>\n\n\n\n<p class=\"has-text-align-justify has-medium-font-size\">The &#8216;grep&#8217; command stands for&nbsp;<strong>&laquo;global regular expression print&raquo;<\/strong>. grep command filters the content of a file which makes our search easy.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">grep with pipe<\/h2>\n\n\n\n<p class=\"has-medium-font-size\">The &#8216;grep&#8217; command is generally used with pipe&nbsp;<strong>(|)<\/strong>.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Syntax:<\/strong><a href=\"https:\/\/www.javatpoint.com\/linux-grep#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-grep#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-grep#\"><\/a><\/p>\n\n\n\n<p class=\"has-medium-font-size\">command&nbsp;|&nbsp;grep&nbsp;<strong>&lt;searchWord&gt;<\/strong>&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Example:<\/strong><a href=\"https:\/\/www.javatpoint.com\/linux-grep#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-grep#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-grep#\"><\/a><\/p>\n\n\n\n<p class=\"has-medium-font-size\">cat&nbsp;marks.txt&nbsp;|&nbsp;grep&nbsp;9<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">grep without pipe<\/h2>\n\n\n\n<p class=\"has-medium-font-size\">It can be used without pipe also.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Syntax:<\/strong><a href=\"https:\/\/www.javatpoint.com\/linux-grep#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-grep#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-grep#\"><\/a><\/p>\n\n\n\n<p class=\"has-medium-font-size\">grep&nbsp;<strong>&lt;searchWord&gt;<\/strong>&nbsp;<strong>&lt;file<\/strong>&nbsp;name<strong>&gt;<\/strong>&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Example:<\/strong><a href=\"https:\/\/www.javatpoint.com\/linux-grep#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-grep#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-grep#\"><\/a><\/p>\n\n\n\n<p class=\"has-medium-font-size\">grep&nbsp;9&nbsp;marks.txt&nbsp;&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">grep options<\/h2>\n\n\n\n<ul class=\"has-medium-font-size wp-block-list\">\n<li><strong>grep -vM<\/strong>: The &#8216;grep -v&#8217; command displays lines not matching to the specified word.<\/li>\n\n\n\n<li>grep&nbsp;-v&nbsp;<strong>&lt;searchWord&gt;<\/strong>&nbsp;<strong>&lt;fileName&gt;<\/strong>&nbsp;&nbsp;<\/li>\n\n\n\n<li>grep&nbsp;-v&nbsp;9&nbsp;marks.txt<\/li>\n<\/ul>\n\n\n\n<ul class=\"has-medium-font-size wp-block-list\">\n<li><strong>grep -i<\/strong>: The &#8216;grep -i&#8217; command filters output in a case-insensitive way.<\/li>\n\n\n\n<li>grep&nbsp;-i&nbsp;<strong>&lt;<\/strong><strong>searchWord<\/strong><strong>&gt;<\/strong>&nbsp;<strong>&lt;<\/strong><strong>fileName<\/strong><strong>&gt;<\/strong>&nbsp;&nbsp;<\/li>\n\n\n\n<li>grep&nbsp;-i&nbsp;red&nbsp;exm.txt&nbsp;&nbsp;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">Head buyrug&#8217;i<\/h2>\n\n\n\n<p class=\"has-medium-font-size\">The &#8216;head&#8217; command displays the starting content of a file. By default, it displays starting 10 lines of any file.<\/p>\n\n\n\n<p class=\"has-medium-font-size\">head&nbsp;<strong>&lt;file<\/strong>&nbsp;name<strong>&gt;<\/strong>&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"has-medium-font-size\">head&nbsp;jtp.txt&nbsp;&nbsp;<\/p>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">Tail buyrug&#8217;i<\/h2>\n\n\n\n<p class=\"has-medium-font-size\">Linux tail command is used to display the last ten lines of one or more files. Its main purpose is to read the error message. By default, it displays the last ten lines of a file. Additionally, it is used to monitor the file changes in real-time. It is a complementary command of the&nbsp;head command.<\/p>\n\n\n\n<p class=\"has-medium-font-size\">tail&nbsp;<strong>&lt;file<\/strong>&nbsp;name<strong>&gt;<\/strong>&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"has-medium-font-size\">tail&nbsp;num.txt&nbsp;&nbsp;<\/p>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">More buyrug&#8217;i<\/h2>\n\n\n\n<p class=\"has-medium-font-size\">As &#8216;cat&#8217; command displays the file content. Same way &#8216;more&#8217; command also displays the content of a file. Only difference is that, in case of larger files, &#8216;cat&#8217; command output will scroll off your screen while &#8216;more&#8217; command displays output one screenful at a time.<\/p>\n\n\n\n<p class=\"has-medium-font-size\">Following keys are used in &#8216;more&#8217; command to scroll the page:<\/p>\n\n\n\n<ul class=\"has-medium-font-size wp-block-list\">\n<li>Enter key: To scroll down page line by line.<\/li>\n\n\n\n<li>Space bar: To go to next page.<\/li>\n\n\n\n<li>b key: To go to the backward page.<\/li>\n\n\n\n<li>\/ key: Lets you search the string.<\/li>\n<\/ul>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Syntax:<\/strong><a href=\"https:\/\/www.javatpoint.com\/linux-more#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-more#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-more#\"><\/a><\/p>\n\n\n\n<p class=\"has-medium-font-size\">more&nbsp;<strong>&lt;file<\/strong>&nbsp;name<strong>&gt;<\/strong>&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Example:<\/strong><a href=\"https:\/\/www.javatpoint.com\/linux-more#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-more#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-more#\"><\/a><\/p>\n\n\n\n<p class=\"has-medium-font-size\">more&nbsp;\/var\/log\/udev&nbsp;&nbsp;<\/p>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">Less buyrug&#8217;i<\/h2>\n\n\n\n<p class=\"has-medium-font-size\">The &#8216;less&#8217; command is same as &#8216;more&#8217; command but include some more features.<\/p>\n\n\n\n<p class=\"has-medium-font-size\">It automatically adjust with the width and height of the teminal window, while &#8216;more&#8217; command cuts the content as the width of the terminal window get shorter.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Syntax:<\/strong><a href=\"https:\/\/www.javatpoint.com\/linux-less#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-less#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-less#\"><\/a><\/p>\n\n\n\n<p class=\"has-medium-font-size\">less&nbsp;<strong>&lt;file<\/strong>&nbsp;name<strong>&gt;<\/strong>&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Example:<\/strong><a href=\"https:\/\/www.javatpoint.com\/linux-less#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-less#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/linux-less#\"><\/a><\/p>\n\n\n\n<p class=\"has-medium-font-size\">less&nbsp;\/var\/log\/udev&nbsp;&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>grep, head, tail, more, less<\/p>","protected":false},"author":1,"featured_media":6854,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":1,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","footnotes":""},"categories":[4],"tags":[],"class_list":{"0":"post-2093","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-administartor"},"_links":{"self":[{"href":"https:\/\/step-up.uz\/en\/wp-json\/wp\/v2\/posts\/2093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/step-up.uz\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/step-up.uz\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/step-up.uz\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/step-up.uz\/en\/wp-json\/wp\/v2\/comments?post=2093"}],"version-history":[{"count":2,"href":"https:\/\/step-up.uz\/en\/wp-json\/wp\/v2\/posts\/2093\/revisions"}],"predecessor-version":[{"id":8352,"href":"https:\/\/step-up.uz\/en\/wp-json\/wp\/v2\/posts\/2093\/revisions\/8352"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/step-up.uz\/en\/wp-json\/wp\/v2\/media\/6854"}],"wp:attachment":[{"href":"https:\/\/step-up.uz\/en\/wp-json\/wp\/v2\/media?parent=2093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/step-up.uz\/en\/wp-json\/wp\/v2\/categories?post=2093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/step-up.uz\/en\/wp-json\/wp\/v2\/tags?post=2093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}