{"id":9000,"date":"2026-05-30T01:54:57","date_gmt":"2026-05-29T23:54:57","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=9000"},"modified":"2026-05-30T01:54:58","modified_gmt":"2026-05-29T23:54:58","slug":"ssh-commands-cat","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-cat\/","title":{"rendered":"SSH Commands &#8211; cat"},"content":{"rendered":"\n<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">In server administration, backend web development, and cloud systems engineering, reviewing the raw contents of a file quickly without opening a full text editor is a routine operation. The <strong><code>cat<\/code><\/strong> command stands for <strong>Concatenate<\/strong>. It is a core POSIX-standard terminal utility used primarily to read, display, combine, and create text files directly within your console interface.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By passing file names or stream paths to this utility, you can inspect script files, review system variables, or append logs together into a single unified dataset.<\/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-cat\/#Direct_Read_Operations_and_Primary_Command_Flags\" >Direct Read Operations and Primary Command Flags<\/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:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-cat\/#1_Numbering_Output_Lines_cat_-n\" >1. Numbering Output Lines (cat -n)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-cat\/#2_Squeezing_Empty_White_Space_cat_-s\" >2. Squeezing Empty White Space (cat -s)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-cat\/#3_Displaying_Line_Endings_cat_-E\" >3. Displaying Line Endings (cat -E)<\/a><\/li><\/ul><\/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-cat\/#File_Manipulation_and_Concatenation_Paths\" >File Manipulation and Concatenation Paths<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-cat\/#Combining_Multiple_Files_Into_One\" >Combining Multiple Files Into One<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-cat\/#Appending_Data_to_an_Existing_File\" >Appending Data to an Existing File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-commands-cat\/#Inspecting_Production_Paths\" >Inspecting Production Paths<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Direct_Read_Operations_and_Primary_Command_Flags\"><\/span>Direct Read Operations and Primary Command Flags<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<\/div>\n\n<div id=\"mybox-964502486\" 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\">Running the <code>cat<\/code> command followed immediately by a target filename prints the entire contents of that file to your terminal screen. While this is highly effective for quick checks on short files, you will regularly append these core configuration flags to handle advanced analysis:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Numbering_Output_Lines_cat_-n\"><\/span>1. Numbering Output Lines (<code>cat -n<\/code>)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>-n<\/code> flag instructs the server to display line numbers next to every line of text output to the screen, including blank spaces.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Action:<\/strong> Execute the flag followed by your file target inside your working directory:Bash<code>cat -n config.php<\/code><\/li>\n\n\n\n<li><strong>Operational Benefit:<\/strong> This is highly useful when debugging backend code anomalies, allowing you to instantly align code outputs with explicit line-number errors flagged by your server&#8217;s diagnostic logs.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Squeezing_Empty_White_Space_cat_-s\"><\/span>2. Squeezing Empty White Space (<code>cat -s<\/code>)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If a file contains large, irregular blocks of multiple consecutive empty lines, the <code>-s<\/code> flag <strong>squeezes<\/strong> those gaps together, displaying them as a single blank line.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Action:<\/strong> Run the spacing compression filter over a disorganized file:Bash<code>cat -s textfile.txt<\/code><\/li>\n\n\n\n<li><strong>Operational Benefit:<\/strong> This keeps your terminal layout clean when parsing unoptimized logs or raw text files that contain heavy formatting clutter.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Displaying_Line_Endings_cat_-E\"><\/span>3. Displaying Line Endings (<code>cat -E<\/code>)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>-E<\/code> flag appends a dollar sign symbol (<code>$<\/code>) to the absolute end of every line.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Action:<\/strong> Execute the visibility flag:Bash<code>cat -E script.sh<\/code><\/li>\n\n\n\n<li><strong>Operational Benefit:<\/strong> This reveals hidden trailing whitespaces or non-printing characters that might cause script errors during runtime deployment.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"File_Manipulation_and_Concatenation_Paths\"><\/span>File Manipulation and Concatenation Paths<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">True to its namesake, the <code>cat<\/code> command can combine multiple file streams or direct text payloads into new destinations using standard Linux redirection operators (<code>&gt;<\/code> and <code>&gt;&gt;<\/code>).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Combining_Multiple_Files_Into_One\"><\/span>Combining Multiple Files Into One<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To merge the contents of multiple independent files into a single master document, list the files sequentially and redirect the combined output stream:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bash<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat header.txt body.txt footer.txt &gt; complete-page.html\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>The single redirection operator (<code>&gt;<\/code>) creates the target file or completely overwrites its contents if it already exists on the disk.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Appending_Data_to_an_Existing_File\"><\/span>Appending Data to an Existing File<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to push the contents of a file or text chunk to the absolute bottom of an existing file without deleting what is already inside it, use the append operator:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bash<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat recent-errors.log &gt;&gt; master-audit.log\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Inspecting_Production_Paths\"><\/span>Inspecting Production Paths<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To read a configuration file located inside your brand workspace from any directory on the server, pass the absolute path directly as an argument:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bash<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/home\/mybox\/yourlogin\/public_html\/.env<\/code><\/pre>\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":[6215,6216,6217,1180,1326,1505,6170,6174,6175,6179],"class_list":["post-9000","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-ssh","manual_kb_tag-cat-command","manual_kb_tag-concatenate-command","manual_kb_tag-bash","manual_kb_tag-server-administration","manual_kb_tag-command-line","manual_kb_tag-shell-commands","manual_kb_tag-linux","manual_kb_tag-backend-web-development","manual_kb_tag-cloud-systems-engineering","manual_kb_tag-terminal-utility"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/9000","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\/9000\/revisions"}],"predecessor-version":[{"id":9001,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/9000\/revisions\/9001"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/media?parent=9000"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manualknowledgebasecat?post=9000"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb_tag?post=9000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}