<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ls on Michael’s Domain</title><link>https://jeltsch.org/en/tags/ls/</link><description>Recent content in Ls on Michael’s Domain</description><generator>Hugo</generator><language>en-us</language><copyright>Copyright © 2002 - 2026 Michael Jeltsch.</copyright><lastBuildDate>Fri, 24 Jul 2026 00:18:18 +0300</lastBuildDate><atom:link href="https://jeltsch.org/en/tags/ls/index.xml" rel="self" type="application/rss+xml"/><item><title>Counting files (list and word count, ls &amp; wc)</title><link>https://jeltsch.org/en/counting_files_list_and_word_count_ls_wc/</link><pubDate>Wed, 29 Apr 2020 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/counting_files_list_and_word_count_ls_wc/</guid><description>&lt;p&gt;How do you count the number of files in a directory? That becomes non-trivial if you have thousands of files in a directory. Your file manager chokes on counting them, especially if they are not local. On the Linux command line, this task is fast and easy:&lt;code&gt;ls | wc&lt;/code&gt;ls lists your files one per row and wc returns three numbers: lines, words and bytes. In the file counting example, lines and words are the same and equal the number of files in the directory. To count all files recursively in the directory tree &amp;ldquo;backcheck&amp;rdquo;:&lt;code&gt;find backcheck/ -type f | wc -l&lt;/code&gt;&lt;/p&gt;</description></item><item><title>The ls command</title><link>https://jeltsch.org/en/the_ls_command/</link><pubDate>Sat, 26 May 2007 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/the_ls_command/</guid><description>&lt;p&gt;I have been using is for years, but hardly have used its &amp;ldquo;advanced&amp;rdquo; options. That is:&lt;code&gt;ls -t&lt;/code&gt; to sort the content of the directory according to modification date. &lt;code&gt;ls -d&lt;/code&gt; to display the directories and not their contents. &lt;code&gt;ls -alh&lt;/code&gt; lists the complete content of the directory in long, human-readable form (that means file sizes are given in B, K, M or G and not in bytes).The -d option I mostly use as: &lt;code&gt;ls -d .*&lt;/code&gt; This shows me all &amp;ldquo;hidden&amp;rdquo; directories which are located in the current directory. If I just typed ls .* I would get a recursive listing of all contents of all hidden directories.&lt;/p&gt;</description></item></channel></rss>