I want to change the number of commands that Bash saves to 25. From a web search it looks like I should set HISTFILESIZE=25 and leave HISTSIZE alone. But I can't find my bashrc file to edit these variables. It doesn't seem to be in my home folder nor in /etc. There is a skel folder with bashrc in it in the /etc folder. The only other bash file I see in /etc is bash.bashrc, which has different contents than skel/bashrc and no line with either HISTFILESIZE or HISTSIZE. Did I somehow erase the bashrc file that's supposed to be in my home folder? There's a history being stored somewhere because I can recall previous commands.
Announcement
Collapse
No announcement yet.
Change HISTSIZE and HISTFILESIZE
Collapse
This topic is closed.
X
X
-
Tags: None
- Top
- Bottom
-
Your bashrc is in your home but it's hidden. One way to edit it, ALT-F2 to open krunner, then type:
kate ~/.bashrc
HISTSIZE is a "live" list while you're working in bash, and HISTFILESIZE is the number of lines that are saved to disk.
- Top
- Bottom
-
Originally posted by oshunluvr View PostYour bashrc is in your home but it's hidden.
Note that login shells don't have to run .bashrc, they run the first one of ~/.bash_profile, ~/.bash_login, and ~/.profile that is found; however the default ~/.profile (default for debian, I think) sources .bashrc if it exists. I mention this for completeness because your ~/.profile might have been deleted or the bit running .bashrc might have been removed.
I've got stuff in my .bashrc that I've had for a long time, some of it going back to when I used the Korn shell. (I use HISTFILESIZE=420, and HISTSIZE=2000).Regards, John Little
- Top
- Bottom
Comment
-
So I copied the contents of /etc/skel/.bashrc to an open kate document ~/.bashrc and saved it with the HISTSIZE=25 and HISTFILESIZE=25. This seems to work fine.
I am a bit worried because besides there being no .bashrc in my home directory there is also no .bash_login or .profile folder in my home directory. Some how I must have wiped these out doing some other operation. Are there backups somewhere I should copy to my home folder? Is there a list somewhere of what the contents of my home folder should be? How big a problem is this?
- Top
- Bottom
Comment
-
Originally posted by lcharles View PostI am a bit worried because besides there being no .bashrc in my home directory there is also no .bash_login or .profile
Assuming they're not hidden, I expect you deleted them somehow.
Are there backups somewhere I should copy to my home folder?
Is there a list somewhere of what the contents of my home folder should be?
How big a problem is this?Regards, John Little
- Top
- Bottom
Comment
-
You could also end up with no home folder or skel files if you created a user with "useradd" and left out the "-m" switch, then go and manually create the user folder. There's only three files in skel normally; .bash_logout, .bashrc, and .profile.
- Top
- Bottom
Comment
-
Looking at the hidden files in /home and comparing it to an earlier installation version of Kubuntu on another partition things seem mostly OK. I do backups of data once in a while but not the entire /home directory.
I copied /etc/skel/.profile and .bash_logout to /home. Things seem to be working alright.
- Top
- Bottom
Comment
Comment