<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									User of ls -r command in linux - Kali Linux				            </title>
            <link>https://www.hacktheforum.com/kali-linux/user-of-ls-r-command-in-linux/</link>
            <description>Hack The Forum Discussion Board</description>
            <language>en</language>
            <lastBuildDate>Sat, 18 Apr 2026 14:13:04 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>User of ls -r command in linux</title>
                        <link>https://www.hacktheforum.com/kali-linux/user-of-ls-r-command-in-linux/#post-728</link>
                        <pubDate>Sun, 27 Oct 2024 12:50:35 +0000</pubDate>
                        <description><![CDATA[The ls -r command in Linux is used to list files and directories recursively. This means it will display the contents of the specified directory and all its subdirectories.
Usage:


bash...]]></description>
                        <content:encoded><![CDATA[<div class="flex max-w-full flex-col flex-grow">
<div class="min-h-8 text-message flex w-full flex-col items-end gap-2 whitespace-normal break-words :mt-5" dir="auto" data-message-author-role="assistant" data-message-id="201048b3-b756-4d2c-ae47-e76ca243b1b8" data-message-model-slug="gpt-4o-mini">
<div class="flex w-full flex-col gap-1 empty:hidden first:pt-">
<div class="markdown prose w-full break-words dark:prose-invert light">
<p>The <strong><code>ls -r</code></strong> command in Linux is used to list files and directories recursively. This means it will display the contents of the specified directory and all its subdirectories.</p>
<h3>Usage:</h3>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary">
<pre contenteditable="false">bash


ls -r </pre>
</div>
</div>
<h3>Options:</h3>
<ul>
<li><strong><code>-r</code></strong>: This flag stands for "recursive." It will traverse through all subdirectories.</li>
</ul>
<h3>Example:</h3>
<p>To list all files and directories in the current directory and its subdirectories, you can simply run:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary">
<pre contenteditable="false">bash


ls -r</pre>
</div>
</div>
<p>If you want to list the contents of a specific directory recursively:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary">
<pre contenteditable="false">bash


ls -r /path/to/directory</pre>
</div>
</div>
<h3>Additional Tips:</h3>
<ul>
<li>
<p>Combine with other options like <code>-l</code> for a detailed list (permissions, size, modification date):</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary">
<pre contenteditable="false">bash


ls -lr</pre>
</div>
</div>
</li>
<li>
<p>Use with <code>grep</code> to filter results:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary">
<pre contenteditable="false">bash


ls -r | grep "pattern"</pre>
</div>
</div>
</li>
</ul>
<p>This command is helpful for getting an overview of all files in a directory tree, especially in complex directory structures.</p>
</div>
</div>
</div>
</div>
<div class="mb-2 flex gap-3 empty:hidden -ml-2">
<div class="items-center justify-start rounded-xl p-1 flex">
<div class="flex items-center"><span class="" data-state="closed"><button class="rounded-lg text-token-text-secondary hover:bg-token-main-surface-secondary" aria-label="Copy" data-testid="copy-turn-action-button"><span class="flex h- w- items-center justify-center"></span></button></span><span class="hidden"></span>
<div class="flex items-center pb-0"> </div>
</div>
</div>
</div>]]></content:encoded>
						                            <category domain="https://www.hacktheforum.com/kali-linux/">Kali Linux</category>                        <dc:creator>Ivan Lon</dc:creator>
                        <guid isPermaLink="true">https://www.hacktheforum.com/kali-linux/user-of-ls-r-command-in-linux/#post-728</guid>
                    </item>
							        </channel>
        </rss>
		