This is not a problem, it is not dangerous and is entirely normal. You can get such lines if you hit space a few times and then hit enter. This will be saved in your history (since it is a non-blank line, spaces are characters just invisible ones).
To test this, we can use a command that prints the blank lines in bash's history For example, this grep
will match all lines that start with numbers and then have 0 or more whitespace (spaces or tabs or whatever) and nothing else until the end of the line:
history | grep -P '^\s*\d+\s*$'
That should show you a list of empty commands you have run. Now, run ( the first line means hit space a few times, then enter)
$ echo foo
foo
$
$ history | tail -n 3
$ history | tail -n 3
80 echo foo
81 ## this is the blank line
82 history | tail -n 3
You will notice that you have a new blank line. In conclusion, don't worry. everything is fine and this is normal.
<original file name>~
is created in the same directory. so can you check and report if you find.bash_history~
file and if yes, do you see the blank line there too? – astrob0t Nov 08 '14 at 23:23