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

# MVH Kernel Filesystem Shell Commands — Full Reference

> Reference for all filesystem shell commands: ls, cd, pwd, mkdir, touch, write, append, cat, rm, rmdir, mount, and df. Includes usage examples.

MVH Kernel mounts a RAMFS (RAM-based filesystem) as the root filesystem at boot. The filesystem lives entirely in kernel memory, so it is fast and requires no disk hardware, but it is completely **volatile** — every file and directory you create is lost the moment you reboot. Use it to hold temporary text, test path navigation, or exercise the VFS layer during a session.

<Note>
  All files and directories are reset on every boot. RAMFS does not persist data across reboots.
</Note>

## Filesystem limits

The following constants define the hard limits of the RAMFS implementation (from `include/mvh/fs.h`):

| Constant      | Value      | Meaning                                         |
| ------------- | ---------- | ----------------------------------------------- |
| `FS_PATH_MAX` | 128 bytes  | Maximum full path length                        |
| `FS_NAME_MAX` | 24 bytes   | Maximum file or directory name length           |
| `FS_DATA_MAX` | 256 bytes  | Maximum data size per file                      |
| `FS_LIST_MAX` | 64 entries | Maximum entries returned by a directory listing |

***

## ls

List the contents of a directory.

**Syntax**

```sh theme={null}
ls [path]
```

If you omit `path`, the current working directory is listed. Directories are shown with a `[DIR]` prefix in blue; files are shown with `[FILE]` and their size in bytes.

**Example**

```text theme={null}
mvh> ls /
[DIR]  home
[DIR]  etc
[FILE] notes.txt  42 bytes
```

***

## dir

Alias for `ls`. Accepts the same optional path argument and produces identical output.

**Syntax**

```sh theme={null}
dir [path]
```

**Example**

```text theme={null}
mvh> dir /home
[DIR]  user
```

***

## cd

Change the current working directory. Both relative and absolute paths are supported. Running `cd` without an argument changes to `/home`.

**Syntax**

```sh theme={null}
cd <path>
```

**Examples**

```sh theme={null}
cd /home
cd ..
cd logs
```

If the directory does not exist, the shell prints `cd: directory not found`.

***

## pwd

Print the current working directory as an absolute path.

**Syntax**

```sh theme={null}
pwd
```

**Example**

```text theme={null}
mvh> pwd
/home/user
```

***

## mkdir

Create a new directory at the given path. Parent directories must already exist.

**Syntax**

```sh theme={null}
mkdir <path>
```

**Example**

```sh theme={null}
mkdir /home/user
mkdir logs
```

If the path is invalid or a parent directory is missing, the shell prints `mkdir: cannot create directory`.

***

## touch

Create a new empty file. If the file already exists, the command succeeds without modifying its contents.

**Syntax**

```sh theme={null}
touch <path>
```

**Example**

```sh theme={null}
touch notes.txt
touch /home/user/readme.txt
```

***

## write

Write text to a file, replacing any existing content. If the file does not already exist, it is created automatically. The entire argument after the filename is treated as the text to write.

**Syntax**

```sh theme={null}
write <path> <text>
```

**Example**

```text theme={null}
mvh> write notes.txt Hello from MVH Kernel
mvh> cat notes.txt
Hello from MVH Kernel
```

If the text exceeds the 256-byte file limit, the shell prints `write: file is full`.

***

## append

Append text to an existing file without removing previous content. If the file does not exist, it is created first. The total file size must remain within `FS_DATA_MAX` (256 bytes).

**Syntax**

```sh theme={null}
append <path> <text>
```

**Example**

```text theme={null}
mvh> write log.txt First line
mvh> append log.txt Second line
mvh> cat log.txt
First line
Second line
```

***

## cat

Print the full contents of a file to the shell.

**Syntax**

```sh theme={null}
cat <path>
```

**Example**

```text theme={null}
mvh> cat /etc/version
MVH Kernel 1.1.2
```

If the file does not exist, the shell prints `cat: file not found`.

***

## type

Alias for `cat`. Accepts the same path argument and produces identical output.

**Syntax**

```sh theme={null}
type <path>
```

**Example**

```sh theme={null}
type notes.txt
```

***

## open

Open a file and print its contents. Behaves identically to `cat`.

**Syntax**

```sh theme={null}
open <path>
```

**Example**

```sh theme={null}
open notes.txt
```

***

## rm

Remove a file from the filesystem. The path must point to an existing file, not a directory.

**Syntax**

```sh theme={null}
rm <path>
```

**Example**

```sh theme={null}
rm notes.txt
```

If the path is not found, the shell prints `rm: path not found`. If you attempt to remove a non-empty directory, the shell prints `rm: directory is not empty`.

***

## rmdir

Remove a directory. The directory must be empty before removal. `rmdir` is an alias that calls the same underlying removal function as `rm`.

**Syntax**

```sh theme={null}
rmdir <path>
```

**Example**

```sh theme={null}
rmdir /home/user/logs
```

If the directory is not empty, the shell prints `rmdir: directory is not empty`.

***

## mount

List all currently mounted filesystems. In the current release, RAMFS is the only filesystem and is always mounted at `/`.

**Syntax**

```sh theme={null}
mount
```

**Example**

```text theme={null}
mvh> mount
root on / type ramfs (read-write, volatile)
```

***

## df

Display filesystem usage information. In the current release this shows the RAMFS root entry only.

**Syntax**

```sh theme={null}
df
```

**Example**

```text theme={null}
mvh> df
Filesystem  Type   Mounted on
root        ramfs  /
```
