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?

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

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.


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.


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.


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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.