{"id":9014,"date":"2026-05-30T14:27:03","date_gmt":"2026-05-30T12:27:03","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=9014"},"modified":"2026-05-30T14:27:04","modified_gmt":"2026-05-30T12:27:04","slug":"comenzi-ssh-touch","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/ro\/knowledgebase\/ssh-commands-touch\/","title":{"rendered":"Comenzi SSH \u2013 touch"},"content":{"rendered":"<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">The <code>touch<\/code> command is used to create a new empty file from the Linux command line. It is commonly used when working with files through SSH, especially during website development, testing, or server administration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The command creates the file immediately if it does not already exist.<\/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\/ro\/knowledgebase\/ssh-commands-touch\/#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\/ro\/knowledgebase\/ssh-commands-touch\/#When_to_use_touch\" >When to use touch<\/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\/ro\/knowledgebase\/ssh-commands-touch\/#Practical_considerations\" >Practical considerations<\/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\/ro\/knowledgebase\/ssh-commands-touch\/#Before_you_begin\" >Before you begin<\/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-3650791453\" 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\">Acces timpuriu<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Mai ave\u021bi nevoie de ajutor?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contacta\u021bi echipa noastr\u0103 de servicii pentru clien\u021bi.<\/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\">Trimite mesaj<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">To create a new file, use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>touch filename.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>touch \/yourdomain.com\/public_html\/page.html<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This command creates an empty HTML file named <code>page.html<\/code> inside the <code>public_html<\/code> directory of your website.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"When_to_use_touch\"><\/span>When to use touch<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>touch<\/code> command is useful when you need to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a new file before editing it.<\/li>\n\n\n\n<li>Generate configuration or log files.<\/li>\n\n\n\n<li>Prepare website files directly from the terminal.<\/li>\n\n\n\n<li>Test file permissions or application behavior.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Practical_considerations\"><\/span>Practical considerations<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the specified file already exists, the command will not overwrite its contents. Instead, the file&#8217;s modification timestamp may be updated.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The file is created in the directory from which the command is executed unless a full path is provided. If you are unsure of your current location, use the <code>pwd<\/code> command to display the current directory path before creating files.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Before_you_begin\"><\/span>Before you begin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You need SSH access enabled on your hosting account to use command-line tools. If SSH access is not yet active, refer to the guide for enabling SSH access in the mybox panel.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[54],"manual_kb_tag":[491,1326,1511,3748,6118,6169,6170,6171,6172,6173],"class_list":["post-9014","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-ssh","manual_kb_tag-website-development","manual_kb_tag-command-line","manual_kb_tag-touch","manual_kb_tag-terminal-commands","manual_kb_tag-linux-command","manual_kb_tag-touch-command","manual_kb_tag-linux","manual_kb_tag-create-file","manual_kb_tag-file-creation","manual_kb_tag-empty-file"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9014\/revisions"}],"predecessor-version":[{"id":9015,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9014\/revisions\/9015"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/media?parent=9014"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manualknowledgebasecat?post=9014"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb_tag?post=9014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}