Common command-line utilities
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Bryan 7bca1fd003 search writes each hit as a link to its line
In a terminal every matching line of a file is a link whose target is
file:line, which ../editor opens at that line; the shown text is as it
was. On a console or in a pipe plain text as before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-24 07:45:14 +02:00
scripts the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
.gitignore the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
access.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
copy.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
count.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
create.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
echo.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
find.talc find: in a terminal, every path found is a link 2026-10-21 18:20:57 +02:00
first.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
last.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
link.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
list.talc list: in a terminal, directories strong 2026-10-21 17:53:35 +02:00
move.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
owner.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
README search writes each hit as a link to its line 2026-10-24 07:45:14 +02:00
remove.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
search.talc search writes each hit as a link to its line 2026-10-24 07:45:14 +02:00
show.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
utility.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
VERSION the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00
where.talc the utilities, tracked: every one of them, their shared library and the build 2026-10-21 19:12:27 +02:00

utilities: the everyday commands of a talc system.

  where       prints the working directory
  list        what a directory holds             -all -long -time
  show        prints files, or the input
  first       the first lines of a file           -lines -bytes
  last        the last lines of a file            -lines -bytes
  count       lines, words and bytes              -lines -words -bytes
  search      lines that match a pattern          -ignore-case -literal -tree
                                                  -line-numbers -names-only
                                                  -count -invert
  find        paths under a directory             -name -pattern -kind
  copy        files and directories               -tree
  move        files and directories
  remove      files, links and directories        -tree
  create      directories, or empty files         -parents -file
  link        a symbolic link                     -to
  access      who may do what to a file
  owner       whose a file is                     -user -group
  echo        prints its arguments                -no-newline

  utility.talc      what they share: options, complaining, input, trees
  scripts/build.sh  builds them all into bin/

Each one is a program of its own, <name>.talc here, and prints its usage
with -help. In a terminal (../terminal: TERMINAL_FORMS in the
environment) `list` says which names are directories, drawn strong,
and `find` writes every path it found as a link, which a press puts
into the terminal's line (or opens, in ../editor), and `search` writes
each matching line of a file as a link whose target is file:line, which
../editor opens at that line; on a console or in a pipe all three print
plain text, as (system console)'s console-write-styled and
console-write-link arrange. Changing directory is not here: it is the shell's `go`, since
a program cannot move the shell that started it.

Build:

  scripts/build.sh

which needs the installed toolchain (compiler on PATH), and puts the
programs in bin/. Add that directory to PATH to use them.

NAMES. A command is one English word that says what it does, chosen to be
typed many times a day: list, copy, move, remove. An option is one dash
and one word: -all, -tree, -lines 20. There are no one-letter options and
no two-dash ones. The same word means the same thing everywhere it
appears: -tree is always "a directory with everything under it", and a
count is always -lines or -bytes.

An option may come anywhere among the arguments. An argument that begins
with a dash and a letter is an option; a lone dash, or a dash and a digit,
is an ordinary argument. To name a file that begins with a dash, give it a
directory: ./-file.

WHAT THEY HAVE IN COMMON. A utility that reads files takes them as
arguments and reads its input when given none, so it sits in a pipeline
as well as at the end of one. A failure with one argument is complained
about on the error stream, as "name: what went wrong", and the utility
goes on to its next argument; it ends with 1 if anything failed, 2 if the
arguments themselves were wrong (and then prints its usage), and 0
otherwise. search alone ends with 1 to say that nothing matched, and 2
when it could not run.

Users and groups are numbers: this system keeps no file of names. Links
are removed, copied and listed as themselves, not as what they point at,
except that copy follows a link it is given directly. Times are UTC.