<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ubuntu Command on MeerStory</title><link>https://meerstory.com/zh/tags/ubuntu-command/</link><description>Recent content in Ubuntu Command on MeerStory</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Sat, 29 Aug 2026 07:06:42 +0900</lastBuildDate><atom:link href="https://meerstory.com/zh/tags/ubuntu-command/index.xml" rel="self" type="application/rss+xml"/><item><title>Ubuntu 必备命令 ls -al：完美掌握 Linux 隐藏文件与权限！</title><link>https://meerstory.com/zh/ubuntu/20260829_070614_1_ls_al_ls/</link><pubDate>Sat, 29 Aug 2026 07:06:42 +0900</pubDate><guid>https://meerstory.com/zh/ubuntu/20260829_070614_1_ls_al_ls/</guid><description>&lt;h2 id="概述">概述&lt;/h2>
&lt;p>在 Linux 及 Ubuntu 终端环境中，最基础且最重要的命令莫过于用于查看文件和目录的 ls。本文将结合实操示例，详细介绍如何利用 ls -al 选项一目了然地查看文件权限、所有者以及以点（.）开头的隐藏文件。&lt;/p>
&lt;h2 id="1-ls-基本用法与文件详细信息查看-ls-ls--l">1. ls 基本用法与文件详细信息查看 (ls, ls -l)&lt;/h2>
&lt;p>为了创建并进入用于 &lt;code>ls&lt;/code> 命令实操的专属目录，请执行 &lt;code>mkdir -p ~/ls_demo &amp;amp;&amp;amp; cd ~/ls_demo&lt;/code> 命令。&lt;/p>
&lt;p>&lt;img src="https://meerstory.com/ubuntu/20260829_070614_1_ls_al_ls/captures/s01_c01_mkdir_-p___ls_demo____cd___ls_demo.png" alt="mkdir -p ~/ls_demo &amp;amp;&amp;amp; cd ~/ls_demo">&lt;/p>
&lt;p>为了准备实操所需的示例文件，请使用 &lt;code>touch file1.txt file2.txt&lt;/code> 命令创建空文件。&lt;/p>
&lt;p>&lt;img src="https://meerstory.com/ubuntu/20260829_070614_1_ls_al_ls/captures/s01_c02_touch_file1_txt_file2_txt.png" alt="touch file1.txt file2.txt">&lt;/p>
&lt;p>&lt;code>ls&lt;/code> 命令用于列出当前目录中的文件和目录列表。&lt;br>
⚙️ [主要选项]&lt;/p>
&lt;p>&lt;code>-a&lt;/code> : 列出包括以点（.）开头的文件和目录在内的所有项目。&lt;br>
&lt;code>-l&lt;/code> : 显示文件权限、所有者、文件大小等详细信息。&lt;br>
&lt;code>-h&lt;/code> : 以易读单位（KB、MB、GB）显示文件大小。&lt;br>
&lt;code>-t&lt;/code> : 按最近修改时间从新到旧排序并输出。&lt;br>
&lt;code>-S&lt;/code> : 按文件大小由大到小排序并显示列表。&lt;/p>
&lt;p>&lt;img src="https://meerstory.com/ubuntu/20260829_070614_1_ls_al_ls/captures/s01_c03_ls.png" alt="ls">&lt;/p>
&lt;p>&lt;code>ls -l&lt;/code> 命令以列表形式输出文件权限、所有者、容量、修改时间等各项目的详细信息。&lt;/p>
&lt;p>&lt;img src="https://meerstory.com/ubuntu/20260829_070614_1_ls_al_ls/captures/s01_c04_ls_-l.png" alt="ls -l">&lt;/p>
&lt;h2 id="2-包含隐藏文件和隐藏目录的全量查看-ls--a-ls--al">2. 包含隐藏文件和隐藏目录的全量查看 (ls -a, ls -al)&lt;/h2>
&lt;p>为了进行隐藏文件实操，请执行 &lt;code>touch ~/ls_demo/.hidden_file&lt;/code> 命令，创建一个文件名开头带点（&lt;code>.&lt;/code>）的 &lt;code>.hidden_file&lt;/code> 空文件。&lt;/p></description></item></channel></rss>