{"id":9022,"date":"2026-05-30T14:31:51","date_gmt":"2026-05-30T12:31:51","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=9022"},"modified":"2026-05-30T14:31:52","modified_gmt":"2026-05-30T12:31:52","slug":"ssh-commands-tail","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-tail\/","title":{"rendered":"SSH Commands &#8211; tail"},"content":{"rendered":"\n<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">The <code>tail<\/code> command is used to display the end of a file. It is commonly used when working with logs, configuration files, or output data where the most recent entries are located at the bottom of the file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This command is especially useful for monitoring system or application activity in real time.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<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:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-tail\/#How_the_command_works\" >How the command works<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-tail\/#Changing_the_number_of_lines\" >Changing the number of lines<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-tail\/#Real-time_file_monitoring\" >Real-time file monitoring<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-tail\/#Practical_use_cases\" >Practical use cases<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-tail\/#Practical_implications\" >Practical implications<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-tail\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_the_command_works\"><\/span>How the command works<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<\/div>\n\n<div id=\"mybox-1143944526\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Early access<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Still need help?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contact our customer service team.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Message us<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">The basic structure is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail filename.txt\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">By default, the command shows the last 10 lines of a file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Changing_the_number_of_lines\"><\/span>Changing the number of lines<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can adjust how many lines are displayed using the <code>-n<\/code> option:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail -n 20 filename.txt\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This displays the last 20 lines of the file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Real-time_file_monitoring\"><\/span>Real-time file monitoring<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">One of the most common uses of <code>tail<\/code> is following a file as it is being updated:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail -f filename.txt\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This keeps the output active and continuously displays new lines as they are added to the file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Practical_use_cases\"><\/span>Practical use cases<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>tail<\/code> command is commonly used for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>monitoring error logs in real time<\/li>\n\n\n\n<li>checking recent access logs<\/li>\n\n\n\n<li>debugging applications and services<\/li>\n\n\n\n<li>reviewing the latest system events<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Practical_implications\"><\/span>Practical implications<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Unlike file editors, <code>tail<\/code> does not modify the file. It only reads and displays content.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When monitoring logs with <code>-f<\/code>, the process remains active until manually stopped, typically using <code>CTRL + C<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For large log files, <code>tail<\/code> is often used instead of opening the full file because it focuses only on the most recent activity.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>tail<\/code> command displays the end of a file and is frequently used for real-time monitoring of logs and system activity in SSH environments.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[54],"manual_kb_tag":[6145,6146,6147,6148,1530,5730,6141,6142,6143,6144],"class_list":["post-9022","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-ssh","manual_kb_tag-monitor-logs","manual_kb_tag-follow-file","manual_kb_tag-view-last-lines","manual_kb_tag-last-lines","manual_kb_tag-log-monitoring","manual_kb_tag-real-time-monitoring","manual_kb_tag-tail-command","manual_kb_tag-tail-usage","manual_kb_tag-tail-linux","manual_kb_tag-unix-tail"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/9022","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/9022\/revisions"}],"predecessor-version":[{"id":9023,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/9022\/revisions\/9023"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/media?parent=9022"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manualknowledgebasecat?post=9022"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb_tag?post=9022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}