Linux

Where Does mksh Store Config?

mksh reads ENV targeted rc files, conventionally ~/.mkshrc. History file and vi or emacs mode live beside it.

Last updated

mksh follows the classic Korn shell pattern instead of a fixed rc name. The ENV variable names the startup file, conventionally .mkshrc in home. History file location and editing mode set inside it.

Android and minimal systems ship mksh as the default shell with the same mechanism. The rc file is plain shell, so the same content ports across Linux, BSD, and macOS installs. Prompt escapes match ksh conventions exactly. Emacs and vi editing modes toggle from a single option. History appends atomically across concurrent shells.

Where mksh stores this, by platform

Linux
/home/<username>/.mkshrc

Conventional rc file named by ENV. Aliases, prompts, and history settings. Sourced for interactive shells.

Linux
/home/<username>/.mksh_history

Command history file. Relocate with HISTFILE inside the rc. Copy with the rc for full restores.

Frequently asked questions

How do I set up mksh config?

Point ENV at home mkshrc from profile or export it inline. mksh sources that file for interactive shells.

How do I migrate mksh settings?

Copy the rc plus history file to the new home folder. Aliases and keybindings travel together.

Notice an outdated path? Let us know.