History file gibberish

Hi,

why the content of my /root/.history is full of gibberish like this? I guess I am doing something wrong ...Thanks!

1624298110050.png
 
It's misc/mc, more specifically, the subshell option (CTRL-O) it has. Did you change root's shell to something else?
 
I did not changed root shell. So I understand the gibberish is coming from mc, is that right? Can I do something to avoid it?

user's shell: sh
root;s shell: csh

this is how is look like:
1624308518136.png


Thanks!
 
So I understand the gibberish is coming from mc, is that right?
That is correct. Specifically caused by the subshell function of mc. Not sure why it happens, I've been using mc for years and I've never had this problem.

user's shell: sh
Try setting your user's shell to tcsh(1), it's a much easier shell to use than a plain sh(1). It'll take some getting used to though. But it has some really useful features for interactive use. Other's like to use shells/bash or shells/zsh,
 
You might find an answer in this thread:
 
I changed the shell to csh/tcsh/zsh but issue still persisted, there is something with CTRL-O. Is there any safe way to clean of that gibberish the /root/.history? It is very unproductive to get the previous commands.
 
I have set the root shell to zsh.
[My recovery user is toor with shell oksh which i copied in the /bin directory ]
Here the relevent lines in my /root/.zshrc,
Code:
HISTFILE=/root/.histfile  # Where to save history to disk
HISTSIZE=1000000      # How many lines of history to keep in memory
SAVEHIST=1000000      # Number of history entries to save to disk
setopt APPEND_HISTORY     # Append history to the history file (no overwriting)
setopt SHARE_HISTORY      # Share history across terminals
setopt INC_APPEND_HISTORY # Immediately append to the history file, not just when a term is killed
Then you just have one .histfile in your root directory.
I also have one .history file , i think thats when zsh spawns sh.
 
For me there are three kinds of data.
Normal data.
Important data , /etc ; /usr/local/etc
Un-important data , which you can delete as you please.
- Log files, you can always "truncate -s 0", so their length is zero
- The contents of /var/cache or ~/.cache , you can delete as you please.
- History files you can delete as you please. But it is more important to know which shell created the history file, and which configuration of the shell made the history file to exist. I have had problems myself and removed all references to history files out of the configuration files of all shells. To problem is gone. Than i added a history config to my zsh. So history works again as it should.
 
I have set the root shell to zsh.
[My recovery user is toor with shell oksh which i copied in the /bin directory ]
Here the relevent lines in my /root/.zshrc,
Code:
HISTFILE=/root/.histfile  # Where to save history to disk
HISTSIZE=1000000      # How many lines of history to keep in memory
SAVEHIST=1000000      # Number of history entries to save to disk
setopt APPEND_HISTORY     # Append history to the history file (no overwriting)
setopt SHARE_HISTORY      # Share history across terminals
setopt INC_APPEND_HISTORY # Immediately append to the history file, not just when a term is killed
Then you just have one .histfile in your root directory.
I also have one .history file , i think thats when zsh spawns sh.
 
Back
Top