{"id":8998,"date":"2026-05-30T01:53:55","date_gmt":"2026-05-29T23:53:55","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=8998"},"modified":"2026-05-30T01:53:56","modified_gmt":"2026-05-29T23:53:56","slug":"comenzi-ssh-ls","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/ro\/knowledgebase\/ssh-commands-ls\/","title":{"rendered":"Comenzi SSH - LS"},"content":{"rendered":"<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">In server administration, backend web development, and cloud systems engineering, verifying what files and folders exist inside your workspace is a critical operational step. The <strong><code>ls<\/code><\/strong> command stands for <strong>List<\/strong>. It is a core POSIX-standard terminal utility used to print the contents of your current working directory\u2014or any specified target directory\u2014directly to your console screen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By combining this command with specific configuration flags, you can inspect hidden files, read precise permission properties, and audit file capacities across your filesystem.<\/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-ls\/#Standard_Execution_and_Primary_Command_Flags\" >Standard Execution 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\/ro\/knowledgebase\/ssh-commands-ls\/#1_The_Human-Readable_Long_List_ls_-lh\" >1. The Human-Readable Long List (ls -lh)<\/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\/ro\/knowledgebase\/ssh-commands-ls\/#2_Revealing_Hidden_Assets_ls_-a\" >2. Revealing Hidden Assets (ls -a)<\/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\/ro\/knowledgebase\/ssh-commands-ls\/#3_Sorting_Content_by_Modification_Time_ls_-lt\" >3. Sorting Content by Modification Time (ls -lt)<\/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\/ro\/knowledgebase\/ssh-commands-ls\/#Target-Specific_Directory_Listing\" >Target-Specific Directory Listing<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Standard_Execution_and_Primary_Command_Flags\"><\/span>Standard Execution and Primary Command Flags<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<\/div>\n\n<div id=\"mybox-3083891506\" 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\">Running the <code>ls<\/code> command entirely by itself with no extra arguments will return a basic, multi-column list of visible files and folders inside your current directory. However, to get the detailed information needed for system maintenance, you will regularly append these primary operational flags:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_The_Human-Readable_Long_List_ls_-lh\"><\/span>1. The Human-Readable Long List (<code>ls -lh<\/code>)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>-l<\/code> flag instructs the server to output data in a detailed <strong>long listing format<\/strong>. Adding the <code>-h<\/code> flag converts raw file sizes into <strong>human-readable<\/strong> units (such as Kilobytes, Megabytes, or Gigabytes) instead of raw bytes.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Action:<\/strong> Execute the combined flags inside your terminal folder:Bash<code>ls -lh<\/code><\/li>\n\n\n\n<li><strong>The Data Columns Returned:<\/strong> The terminal will display detailed information rows containing:\n<ul class=\"wp-block-list\">\n<li>File metadata security permissions (e.g., <code>drwxr-xr-x<\/code> for folders or <code>-rw-r--r--<\/code> for files).<\/li>\n\n\n\n<li>The total number of hard links pointing to the item.<\/li>\n\n\n\n<li>The explicit User Owner and Group Owner names assigned to the file.<\/li>\n\n\n\n<li>The human-readable file or directory storage capacity.<\/li>\n\n\n\n<li>The exact date and timestamp of the last modification.<\/li>\n\n\n\n<li>The literal name of the file or folder.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Revealing_Hidden_Assets_ls_-a\"><\/span>2. Revealing Hidden Assets (<code>ls -a<\/code>)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">By default, Linux filesystems automatically hide system configuration and environment files that begin with a single dot (<code>.<\/code>). The <code>-a<\/code> flag tells the directory tree to list <strong>all files<\/strong>, including these hidden items.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Action:<\/strong> Run the all-inclusive command:Bash<code>ls -a<\/code><\/li>\n\n\n\n<li><strong>Common Hidden Configurations Discovered:<\/strong> This is the tool you will use to locate crucial runtime assets like your server&#8217;s access rule file (<code>.htaccess<\/code>), user profile histories (<code>.bash_history<\/code>), or environment variable keys (<code>.env<\/code>).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Sorting_Content_by_Modification_Time_ls_-lt\"><\/span>3. Sorting Content by Modification Time (<code>ls -lt<\/code>)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>-t<\/code> flag sorts your files based on their <strong>modification timestamps<\/strong>, listing the newest or most recently altered items at the very top of the list.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Action:<\/strong> Combine this flag with the long list layout to track down recent file changes:Bash<code>ls -lt<\/code><\/li>\n\n\n\n<li><strong>Operational Benefit:<\/strong> This setup allows network administrators to instantly identify which log files are currently being written to or detect which scripts were modified during a specific window.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Target-Specific_Directory_Listing\"><\/span>Target-Specific Directory Listing<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You do not need to navigate your terminal directly into a folder just to see what is inside it. You can inspect any directory on the server from your current position by passing its relative or absolute path directly as an argument to the <code>ls<\/code> command.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Relative Ingestion Check:<\/strong> If you are sitting inside <code>public_html<\/code> and want to view your assets directory without changing folders, execute:Bash<code>ls -lh wp-content\/themes<\/code><\/li>\n\n\n\n<li><strong>Absolute Ingestion Check:<\/strong> To check the core root configuration layout of another project environment entirely within your brand space, pass the full leading system path:Bash<code>ls -lh \/home\/mybox\/yourlogin\/innastrona.pl\/public_html<\/code><\/li>\n<\/ul>\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":[466,1592,1777,5210,6179,6218,6219,6220,6221,6222],"class_list":["post-8998","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-ssh","manual_kb_tag-hidden-files","manual_kb_tag-file-permissions","manual_kb_tag-list-command","manual_kb_tag-directory-listing","manual_kb_tag-terminal-utility","manual_kb_tag-ls-command","manual_kb_tag-human-readable-sizes","manual_kb_tag-long-listing-format","manual_kb_tag-modification-time","manual_kb_tag-file-metadata"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/8998","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\/8998\/revisions"}],"predecessor-version":[{"id":8999,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/8998\/revisions\/8999"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/media?parent=8998"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manualknowledgebasecat?post=8998"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb_tag?post=8998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}