teru 0.1.0

A reimplementation of the Unix `ls` command, for learning Rust.
Documentation
  • Coverage
  • 83.33%
    15 out of 18 items documented0 out of 8 items with examples
  • Size
  • Source code size: 20.52 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 368.54 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1s Average build duration of successful builds.
  • all releases: 1s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • RikiyaOta

teru

A reimplementation of the Unix ls command, for learning Rust.

The name comes from the Japanese 照らす (terasu, "to shine a light on, to illuminate") — it lights up what is inside a directory.

Usage

cargo run -p teru           # plain listing, current directory only
cargo run -p teru -- -a     # include hidden (dotfile) entries
cargo run -p teru -- -l     # long listing: permissions, size, modified time
cargo run -p teru -- -a -l  # combine flags (see "Scope" below)

Example -l output:

drwxr-xr-x 128 2026-08-31 02:24 crates
-rw-r--r-- 1514 2026-08-28 11:42 Cargo.toml

Exit code matches the local ls: 0 on success, 1 if a directory cannot be read.

Scope

This covers the scope of issue #11: plain listing, -a (show hidden entries), and -l (long listing). A few things are deliberately left out, all for the same reason: standard library only, no external crates.

  • -l shows permissions, size, and modification time, but not owner/group names or the hard-link count. Resolving a uid to a username needs libc; the standard library alone cannot do it.
  • Modification times are shown in UTC, not the local timezone. Local time needs the system's timezone database (IANA tzdata), which the standard library does not expose and which would take real effort to parse correctly from scratch.
  • Short flags cannot be combined: -a -l works, -al does not. The argument parser only recognises exact -a / -l tokens.
  • Unix-only. Permission bits and file metadata come from std::os::unix::fs, so this crate does not build on Windows.

See the repository README for how this crate fits into the workspace, and CLAUDE.md for how it is developed.