cd

Change the current directory and show its contents immediately, with shortcuts for the previous directory, the ~ base and the \ installation root.

FilesVersion 1.2.5Stable
lil-terminal

Overview

Use cd for navigation without turning a directory change into a tree dump: it moves the working directory and immediately shows only the current level, while cd -, cd ~ and cd \ make repeated movement predictable.

Go straight to the right directory

Use cd when the next action matters more than a deep listing: move, see the destination immediately, then continue.

Syntax

lil-terminal
cd [path|-] [-s|-S] [-d|-D]

Reference

cd | cd .

show a flat list for the current directory

cd <path>

move to a relative, absolute, "~" or "\" path

cd ..

move one level up

cd -

switch to the previous directory

cd ~

move to the directory selected through @pwd

cd \

move to the directory containing the lil core

-s

show file sizes

-S

show file and directory sizes

-d

show modification dates

-D

show modification dates and times

Columns

-s shows file sizes and leaves directories as a dash. -S also measures directory contents recursively. Directory measurement is deliberately bounded; an unreadable or unfinished directory is shown as ?. The order of size and date flags controls the column order: cd -s -d puts size before date, while cd -d -s puts date before size. Metadata columns use a wider gap, while the final filename receives the remaining width.

Notes

Relative paths start from the current lil-terminal directory. The "~" prefix starts from the directory selected with @pwd -s or @pwd set, while "\" starts from the directory containing the lil core; therefore cd ~tmp and cd \tmp may point to different folders. Quoted paths may contain spaces. A missing path returns Directory not found, a file path returns Not a directory, and cd - reports when no previous directory exists.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Move to a relative, absolute, "~" or "\" path

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Built into the core

This command is part of the selected lil-terminal core and is not installed as an ordinary extension.

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Move to a relative, absolute, "~" or "\" path
cd \sandbox | cd data | cd .. | cd -
config/
data/
db/
images/
logs/
public/
scripts/
tmp/
workspace/

sample.csv
sample.txt
users.json

config/
data/
db/
images/
logs/
public/
scripts/
tmp/
workspace/

sample.csv
sample.txt
users.json
Show file sizes
cd \sandbox -s -d
      -    2026-08-04    archives
      -    2026-08-09    config
  127  B   2026-08-09    feed.xml
  718  B   2026-08-10    README.txt
Show modification dates
cd \sandbox -d -s
2026-08-04          -    archives
2026-08-09          -    config
2026-08-09      127  B   feed.xml
2026-08-10      718  B   README.txt
Show file and directory sizes
cd \sandbox -S -D
6.5 KB    2026-08-09 03:58:34    certs
1.0 KB    2026-08-09 12:22:13    config
127  B     2026-08-09 01:00:07    feed.xml
718  B     2026-08-10 15:47:59    README.txt
Enter a relative directory
cd sandbox
config/
data/
images/
src/
.env.example
app.ini
app.json
feed.xml
Open a path with spaces
cd "sandbox/sample project"
assets/
index.html
README.md
Move to the parent directory
cd ..
sandbox/
website_e36e9fed/
Return to the previous directory
cd -
sandbox
Open the saved ~ base
cd ~
sandbox
Open the installation root
cd \
sandbox
Move to a relative, absolute, "~" or "\" path
cd \sandbox\missing
Directory not found

File used in this example: sandbox/README.txt

The example uses a file or directory from the protected /sandbox/ documentation workspace.

lil-terminal documentation sandbox

This directory is part of the server tree: website_e36e9fed/sandbox/.
It is never included in generated lil-terminal downloads and direct HTTP access is blocked.
The documentation renderer reads only explicitly allow-listed files from here and
uses them to show real, reproducible command examples.

The fixtures are intentionally small and contain no secrets. They cover PHP, HTML,
CSS, JavaScript, JSON, INI, SQL, Python, shell, XML/SVG, CSV, plain text, logs,
images, .lil workflows, archives and temporary work paths.

During module review, examples may be refined together with the command. Keep paths
stable whenever possible because public documentation links refer to them.

Related documentation

Current release

v1.2.52026-08-08

Ordered columns and directory sizes

Adds -S for directory-size measurement, follows the order of size/date flags when building columns and widens metadata spacing.