4

I came across these files in my home directory:

  • .bash_history
  • .bash_sessions (directory)
  • .lesshst

and I cant help my OCD-ness and I want to remove them, is it safe?

1
  • 3
    You can choose not to show hidden system files.
    – root
    Feb 16, 2016 at 15:45

2 Answers 2

12

These files should be minuscule in size, and are actually handy to have. Not to mention they will reappear, unless you reconfigure them not to do so.

.lesshst

Name of the history file used to remember search commands and shell commands between invocations of less. If set to "-", a history file is not used. The default is "$HOME/.lesshst" on Unix systems, "$HOME/_lesshst" on DOS and Windows systems, or "$HOME/lesshst.ini" or "$INIT/lesshst.ini" on OS/2 systems.

.bash_history

When the -o history option to the set builtin is enabled, the shell provides access to the command history, the list of commands previously typed.

.bash_sessions (directory)

From Reddit about El Capitan changes: A new folder (~/.bash_sessions/) is used to store HISTFILE's and .session files that are unique to sessions. If $BASH_SESSION or $TERM_SESSION_ID is set upon launching the shell (i.e. if Terminal is resuming from a saved state), the associated HISTFILE is merged into the current one, and the .session file is ran. Session saving is facilitated by means of an EXIT trap being set for a function bash_update_session_state.

7

Your system will still work. However they will just come back, why do you want to remove them? They are harmless and shouldn't be taking up space on the disk.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .