Where is the global shell history stored?

As per title, where can I find the globally accessible history exactly?

I have learned to use rpc:call to the current group leader with the group_history atom but that doesn’t tell me where the actual items are stored.

(And I think I seen somewhere that disk_log is responsible for managing them?)

2 Likes

See the shell documentation:

Depending on shell_history configuration parameter it could be your custom module, or the default group_history module. The latter, in turn, uses shell_history_path to find saved history on the disk.

4 Likes

Thank you. I know this is unrelated but I am working with Elixir and I can’t access the docs of kernel or group_history in iex.

I also tried to look for group_history module docs on erlang.org and failed. Can you please point me at it?

EDIT: Maybe this? erlang-history/group_history.erl at master · ferd/erlang-history · GitHub

1 Like

Well, at least on my Mac I eventually found the history inside the ~/Library/Caches/erlang-history/ directory.

1 Like

Source code is here: otp/group_history.erl at master · erlang/otp · GitHub

So technically if there is no value set for shell_history_path, it’s filename:basedir(user_cache, "erlang-history")

1 Like

The location is reported by
filename:basedir(user_cache, “erlang-history”)
which for my Linux box is ~/.cache/erlang-history

3 Likes