mod

uses PHP filesystem functions to change UNIX permissions and timestamps

FilesVersion 1.1.4Stable
lil-terminal

Overview

mod uses PHP filesystem functions to change UNIX permissions and timestamps. mod notes.txt -0600 restricts access to the owner, while mod notes.txt -m 0644 uses the explicit mode syntax. When stat is installed, the command then shows actual metadata; otherwise it returns a success marker.

Inspect before editing

Create a temporary file with mf, run mod notes.txt, change its mode with -0600, and inspect the result. Use stat -f to verify access and modification times.

Syntax

lil-terminal
mod [path] [-0755|-m 0755] [-YYYYMMDD] [-HHMMSS] [-o|-s]

Reference

mod [path]

inspect metadata using stat (read-only)

mod <path> -0755

set octal permissions directly

mod <path> -m 0755

set permissions in UNIX mode format through the mode option

mod <path> -20251225

set the date

mod <path> -121008

set the time in HHMMSS format

mod <path> -20251225 -121008

set the date and time

mod <path> ... -o

change only the access time

mod <path> ... -s

change only the modification time

Notes

Dates use -YYYYMMDD and times use -HHMMSS; you can combine them or provide just one. By default both access time and modification time are updated. -o selects only access time; -s only modification time. Without a date or time, those flags do not change anything. Timestamps use the server PHP timezone.

Safety

Plain mod or mod <path> is a read-only shortcut to installed stat; when stat is missing it explains how to install it. Invalid dates and permission strings are rejected. Avoid 0777 unless genuinely needed.

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.

Inspect metadata using stat (read-only)

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.

Base package

Install the complete package with local command reference and every published mode.

install mod
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install mod -m
Exact public version

Install exactly this published version.

install mod -v 1.1.4
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade mod
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install mod -u

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.

Inspect metadata using stat (read-only)
mod
Path         sandbox
Type         directory
Items        16
Permissions  0755  drwxr-xr-x
Modified     2026-08-11 18:40:00
Inspect metadata using stat (read-only)
mod \sandbox\feed.xml
Path         sandbox/feed.xml
Type         file
Extension    xml
Size         127 b (127 B)
Permissions  0644  -rw-r--r--
Modified     2026-08-11 18:40:00
Set octal permissions directly
@mf \sandbox\tmp\permissions.txt | mod \sandbox\tmp\permissions.txt -0600
README.txt
current.txt
draft.txt
new.txt
permissions.txt

Path         sandbox/tmp/permissions.txt
Type         file
Extension    txt · @code · @edit
Size         0 b (0 B)
Permissions  0600  -rw-------
Modified     2026-08-11 18:40:00
Set permissions in UNIX mode format through the mode option
@mf \sandbox\tmp\permissions.txt | mod \sandbox\tmp\permissions.txt -m 0644
README.txt
current.txt
draft.txt
new.txt
permissions.txt

Path         sandbox/tmp/permissions.txt
Type         file
Extension    txt · @code · @edit
Size         0 b (0 B)
Permissions  0644  -rw-r--r--
Modified     2026-08-11 18:40:00
Set the date
@mf \sandbox\tmp\permissions.txt | mod \sandbox\tmp\permissions.txt -20251225
README.txt
current.txt
draft.txt
new.txt
permissions.txt

Path         sandbox/tmp/permissions.txt
Type         file
Extension    txt · @code · @edit
Size         0 b (0 B)
Permissions  0644  -rw-r--r--
Modified     2025-12-25 18:40:00
Set the time in HHMMSS format
@mf \sandbox\tmp\permissions.txt | mod \sandbox\tmp\permissions.txt -121008
README.txt
current.txt
draft.txt
new.txt
permissions.txt

Path         sandbox/tmp/permissions.txt
Type         file
Extension    txt · @code · @edit
Size         0 b (0 B)
Permissions  0644  -rw-r--r--
Modified     2026-08-11 12:10:08
Set the date and time
@mf \sandbox\tmp\permissions.txt | mod \sandbox\tmp\permissions.txt -20251225 -121008
README.txt
current.txt
draft.txt
new.txt
permissions.txt

Path         sandbox/tmp/permissions.txt
Type         file
Extension    txt · @code · @edit
Size         0 b (0 B)
Permissions  0644  -rw-r--r--
Modified     2025-12-25 12:10:08
Change only the access time
@mf \sandbox\tmp\permissions.txt | mod \sandbox\tmp\permissions.txt -20251225 -o | @stat \sandbox\tmp\permissions.txt -f
permissions.txt

Path         sandbox/tmp/permissions.txt
Type         file
Extension    txt
Size         0 b (0 B)
Permissions  0644  -rw-r--r--
Modified     2026-08-11 18:40:00

Modified     2026-08-11 18:40:00
Accessed     2025-12-25 18:40:00
Change only the modification time
@mf \sandbox\tmp\permissions.txt | mod \sandbox\tmp\permissions.txt -20251225 -s | @stat \sandbox\tmp\permissions.txt -f
permissions.txt

Path         sandbox/tmp/permissions.txt
Type         file
Extension    txt
Size         0 b (0 B)
Permissions  0644  -rw-r--r--
Modified     2025-12-25 18:40:00

Modified     2025-12-25 18:40:00
Accessed     2026-08-11 18:40:00
Set octal permissions directly
mod \sandbox\missing.txt -0644
Path not found
Set the date
@mf \sandbox\tmp\permissions.txt | mod \sandbox\tmp\permissions.txt -20251344
Invalid date or time

File used in this example: sandbox/tmp/README.txt

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

lil-terminal sandbox temporary workspace

Commands in the public documentation use this directory for disposable copies,
archives, uploads and files created during examples. Review destructive commands
before running them and restore the sandbox from the release package when needed.

Related documentation

Current public release

v1.1.42026-10-31

Read-only metadata inspection via stat

mod and mod <path> reuse the installed stat renderer; modifications still require explicit flags.