{"id":19692,"date":"2023-06-22T09:58:11","date_gmt":"2023-06-22T09:58:11","guid":{"rendered":"https:\/\/linuxways.net\/?p=19692"},"modified":"2023-06-22T09:58:11","modified_gmt":"2023-06-22T09:58:11","slug":"more-command-on-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/linux-commands\/more-command-on-linux\/","title":{"rendered":"more Command on Linux"},"content":{"rendered":"<p>You know how often you come across text files in the Linux world. Whether it&#8217;s checking logs, reading configuration files, or just looking into some code, text files are a constant companion. But, let&#8217;s face it, some of these files are so huge that going through them feels like reading an encyclopedia. That&#8217;s when <strong>more<\/strong> command comes to the rescue!<\/p>\n<p>Interested to know more about it? Continue to read as we explore down the <strong>more <\/strong>command on Linux and how you can use it to your benefit.<\/p>\n<h2><strong>What is a more Command on Linux?<\/strong><\/h2>\n<p>If you are a Linux user, you probably deal with text files regularly. Now, suppose you have a book-length text file, and you need to read it or find something in it. Scrolling through it all at once can be a nightmare! Here&#8217;s where <strong>more<\/strong> command saves the day.<\/p>\n<p>The <strong>more<\/strong> command is a terminal command in Linux that lets you view text files but not all at once. It shows the text file content page by page. This makes it super easy to read large text files. You can think of it as reading a book where you flip through pages instead of having the entire content on a single, never-ending page.<\/p>\n<h2><strong>Why use more Command?<\/strong><\/h2>\n<p>When dealing with large files or logs, being able to break down the content into readable chunks can be a blessing. It makes finding information or just reading through the file a lot more manageable. The <strong>more<\/strong> command is particularly useful for viewing large files that don\u2019t fit on a single screen. Without it, you would be scrolling endlessly, and let\u2019s be honest, you don\u2019t want that.<\/p>\n<p>Besides, <strong>more<\/strong> command is quite simple to use. Even if you are a newcomer to Linux, you can swiftly grasp its concepts.<\/p>\n<h3><strong>Setting up more Command<\/strong><\/h3>\n<p>Before we put <strong>more<\/strong> command into use, we need to ensure that <strong>more<\/strong> command is ready to use on your Linux system. Fortunately, most Linux distributions come with <strong>more<\/strong> pre-installed. However, if by any chance your system doesn\u2019t have it, don\u2019t worry! It is as easy to install as using it.<\/p>\n<p>If you are using a Debian-based system like Ubuntu, you can use the apt-get command to install more. Open your terminal and type in:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">apt-get update<\/span><\/div><\/div>\n<p><strong><em><img loading=\"lazy\" decoding=\"async\" width=\"722\" height=\"152\" class=\"wp-image-19693\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-1.png 722w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-1-300x63.png 300w\" sizes=\"auto, (max-width: 722px) 100vw, 722px\" \/><\/em><\/strong><\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">apt-get install<\/span> moreutils<\/div><\/div>\n<p><em><img loading=\"lazy\" decoding=\"async\" width=\"724\" height=\"182\" class=\"wp-image-19694\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-2.png 724w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-2-300x75.png 300w\" sizes=\"auto, (max-width: 724px) 100vw, 724px\" \/><\/em><\/p>\n<p>For Red Hat-based systems like Fedora, use the yum command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">yum install<\/span> moreutils<\/div><\/div>\n<h3><strong>Basic Usage of more Command<\/strong><\/h3>\n<p>Now that you have the <strong>more<\/strong> command installed let&#8217;s get to the basics of how to use it. It&#8217;s very easy, and you don&#8217;t need to keep a lot of tricky stuff or coding in mind.<\/p>\n<p>To view a file using the <strong>more<\/strong> command, just type <strong>more<\/strong> followed by the file name you want to view. For example:<\/p>\n<p>more myfirstfile.txt<\/p>\n<p>[\/cc]<\/p>\n<p><em><img loading=\"lazy\" decoding=\"async\" width=\"721\" height=\"55\" class=\"wp-image-19695\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-3.png 721w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-3-300x23.png 300w\" sizes=\"auto, (max-width: 721px) 100vw, 721px\" \/><\/em><\/p>\n<p>This will display the content of the file named &#8220;myfirstfile.txt,&#8221; one screen at a time.<\/p>\n<p>Now, what if you don&#8217;t want to start reading from the beginning but want to jump to a specific line? Just use the <strong>+<\/strong> sign followed by the line number. Like this:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">more<\/span> +<span class=\"nu0\">10<\/span> myfirstfile.txt<\/div><\/div>\n<p><em><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"154\" class=\"wp-image-19696\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-4.png 714w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-4-300x65.png 300w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><\/em><\/p>\n<p>This will start showing the file content from line 10.<\/p>\n<h3><strong>Options for a Customized Viewing Experience<\/strong><\/h3>\n<p>You can also customize how the <strong>more<\/strong> command displays text. For example, if you want to set the number of lines displayed at once, you can use the <strong>-number<\/strong> option. For instance:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">more<\/span> <span class=\"re5\">-10<\/span> myfile.txt<\/div><\/div>\n<p><em><img loading=\"lazy\" decoding=\"async\" width=\"715\" height=\"132\" class=\"wp-image-19697\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-5.png 715w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/06\/word-image-19692-5-300x55.png 300w\" sizes=\"auto, (max-width: 715px) 100vw, 715px\" \/><\/em><\/p>\n<p>This means that <strong>more<\/strong> will show ten lines of the file at a time. It&#8217;s like adjusting the size of the pages in a book.<\/p>\n<h3><strong>Going through files<\/strong><\/h3>\n<p>When you open a text file using the <strong>more<\/strong> command, it shows you one screenful of text at a time. To navigate through the pages, you have a few simple keyboard tricks up your sleeve.<\/p>\n<ul>\n<li><strong>Space bar<\/strong>: Press the spacebar to go forward by one screen.<\/li>\n<li><strong>Enter key<\/strong>: If you want to move down just one line at a time, press the &#8216;Enter&#8217; key. This is useful for reading closely.<\/li>\n<li><strong>b key<\/strong>: Want to backtrack? Press &#8216;b&#8217; to go back one screen. It proves useful if you suspect that you may have overlooked something!<\/li>\n<li><strong>q key<\/strong>: Done reading? Press &#8216;q&#8217; to quit and return to the command prompt. No need to scroll to the end!<\/li>\n<\/ul>\n<h3><strong>Searching for text<\/strong><\/h3>\n<p>But what if you are looking for a specific piece of information in the file? Scrolling through the whole text can be frustrating. Here is how you will use the search function!<\/p>\n<p><strong>\/ keyword<\/strong>: Type a forward slash <strong>\/<\/strong> followed by the word you are looking for, and press &#8216;Enter.&#8217; <strong>more<\/strong> will jump to the next occurrence of that word. For example, <strong>\/Linux<\/strong> will find the word &#8220;Linux.&#8221;<\/p>\n<h2><strong>Conclusion <\/strong><\/h2>\n<p>The <strong>more<\/strong> command is a practical utility for handling text files in Linux. It&#8217;s especially useful for reading large files, as it displays the content one screen at a time. From the installation to searching for specific text and using the navigation techniques, we see how crucial the command is for Linux users. Use it and make your text file navigation in Linux much more manageable.<\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>The more command is a terminal command in Linux that lets you view text files but not all at once. It shows the text file content page by page. <\/p>","protected":false},"author":110,"featured_media":19698,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1049],"tags":[],"class_list":["post-19692","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-commands"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/19692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=19692"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/19692\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/19698"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=19692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=19692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=19692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}