Is it safe to delete these files?

9,051

Solution 1

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.

Solution 2

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.

Share:
9,051

Related videos on Youtube

Esteban
Author by

Esteban

Updated on September 18, 2022

Comments

  • Esteban
    Esteban almost 2 years

    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?

    • root
      root over 8 years
      You can choose not to show hidden system files.