> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/rtk-ai/rtk/llms.txt
> Use this file to discover all available pages before exploring further.

# rtk ls

> Token-optimized directory listing

## Overview

Lists directory contents in a token-optimized format with automatic noise filtering and file statistics. Reduces output by 60-70% compared to raw `ls -la`.

## Syntax

```bash theme={null}
rtk ls [OPTIONS] [PATH...]
```

## Arguments

**PATH** `string[]`

Directories to list. Defaults to current directory if not specified.

## Options

**-a, --all** `flag`

Show hidden directories like `.git` and `node_modules` (normally filtered)

**-l** `flag`

Detailed listing (always enabled by RTK)

**-R** `flag`

Recursive listing

**-h** `flag`

Human-readable sizes (always enabled by RTK)

## Automatic Filtering

RTK automatically excludes common noise directories unless `-a` is specified:

* `node_modules`, `.git`, `target`
* `__pycache__`, `.next`, `dist`, `build`
* `.cache`, `.turbo`, `.vercel`
* `.pytest_cache`, `.mypy_cache`, `.tox`
* `.venv`, `venv`, `coverage`

## Output Format

```
src/
Cargo.toml  1.2K
README.md  5.5K

📊 2 files, 1 dirs (2 .rs, 1 .toml)
```

**Features:**

* Directories shown with `/` suffix
* Human-readable file sizes (K, M)
* Summary line with file count by extension
* No permissions, timestamps, or ownership clutter

## Token Savings

**65% reduction** - removes metadata while preserving essential information

```bash Example: Basic listing theme={null}
rtk ls
# Output:
# src/
# tests/
# Cargo.toml  1.2K
# README.md  5.5K
# 📊 2 files, 2 dirs
```

```bash Example: Show hidden theme={null}
rtk ls -a
# Shows .git, node_modules, etc.
```

```bash Example: Specific directory theme={null}
rtk ls src
# Lists contents of src/ directory
```

## Exit Codes

* `0` - Success
* `1` - Directory not found or permission denied

## Related Commands

* `rtk tree` - Recursive tree view
* `rtk find` - Search for files
* `rtk read` - View file contents


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.