i don't find the file .history in my home

med89med

New Member
Joined
Apr 4, 2021
Messages
5
Reaction score
3
Credits
62
Hello,

i was doing a homework that says to delete the history file : rm /home/myuser/.history
but i don't find this file in my home : error message while doing thiscommand : file not found. There is only the file .bash_history.
Im using fedora.


in ubuntu i don't see (.history nor .bash_history. ) (i use ls -a to display invisible files)
 


There is only the file .bash_history.

yep i'm on slackware and thats what i have as well . My last 3 (not including histroy command ) were :

498 cp persistence.dat /run/media/andrew/ventoy/
499 sync
500 su
501 history

and if i open .bash_history with say "kate" last entries are :

cp persistence.dat /run/media/andrew/ventoy/
sync
su


seems ok to me


assuming your in home directory whats the output of :


Code:
tail -n 5        .bash_history

then does that match last 5 using command

Code:
history
 
Ubuntu should have a .bash_history, if you've got a bash history. I don't think I've ever seen a '.history' file.

I'd ask the instructor for more information.
 
if you delete .bash_history , and you run history, you wil find all your history there. so there is no a directect relation beteween the command history and and the file .bash_history.

if you run history - c at this moment you will clear the concerned file . but this concened file i don't found him . can you help ?
 
well lets prove then that their is a relationship but bash holds the info until it exits.

First lets confirm .bash_history is your default store for bash commands:



Code:
bash-5.0$ echo $HISTFILE
this is mine :
bash-5.0$ echo $HISTFILE
/home/andrew/.bash_history
bash-5.0$

Now so as not to confuse work from one terminal and delete the file .bash_history




then on open terminal run :

Code:
kill -9 $$

then open terminal and run history command




(if you delete .bash_history , then play with commnds on terminal , .bash_history will be re-created AND store the last commands you played with)
 
Oh yeah... In my list of links to crib potential articles/keep as notes, I have this fairly recent gem.

 
G'day @med89med and welcome to linux.org :)

Just passing through, and maybe this will help.

No matter what Linux installed, .bash_history does not exist until you issue your first command from Terminal/console, whatever. It is only created then, and continues to grow, subject to scroll size limits you place or don't.

It defaults usually to 512 lines, and can be set to unlimited.

In any File Manager, you can go to Home and press Ctrl-h to show the hidden files and folders, and if your Preferences permits, set it to always how Hidden files and folders.

HTH

Wizard
 

Members online

No members online now.

Top