What Are Dotfiles?
Dot files are the files that start with a period in your home dir. They're pretty much the config files that make your system yours. While they historically they've just been files in the root of your home they're slowly moving to your things like .config
The Basic Dotfiles
*nix system uses
/etc/skel to store it's default bland dot files for a system. This is also the directory you put anything you need a new account to have in. So in that dir you'll find things like
.zshrc, etc. These are you basic dot files.
Most people should be aware of
~/.bashrc it's the file that gets parsed whenever you open up a new bash prompt. Other files that you should be aware of are:
… and the list goes on. These are the basics though so let's break them down into what they do and why (or why not) to keep them around
Pretty much anything with the suffix rc is going to be a config that gets run when something is opened.
Starting with the
*shrc files. These belong to whatever shell you're using. So bashrc for bash, zshrc for zsh, tcshrc for tcsh, etc. These files are important because they store things that you use on a regular basis. So if you like to alias
ls -l you wold add that into your shrc file. If you're going to backup and store these on somewhere like github make sure you do not put anything sensitive in there eg setting an environmental to a password or leaving an API key in there. You shouldn't be doing that anyway, but if you're gonna do it might as well practice harm reduction and store in another file that you source from your shrc file.
Next up is your .tmux & .screenrc files. These files contain your settings for screen & tmux. If you seldom use these apps you'll want to make sure that anything you do for their configs are backed up otherwise the next time you need them they might do what you expect them to do.
Your .vimrc, .nanorc, etc. are you text editor rc files. If you have any custom settings configure these are going to super important to keep around. Nothing is worse than trying to edit a file and not having your keybinds, plugins, etc not there. It makes things very annoying.
Lastly there's some rc files that you should not be backing up. These are things that you never use or customize. You can port them around if you really want to. The only exception to that is the .netrc file.
DO NOT BACKUP YOUR
.netrc FILES ANYWHERE PUBLIC.
Your .netrc file contains user/pass data to login to stuff. You really SHOULD NOT be using it, but there are some reasons to use it for instance curl, wget, youtube-dl, etc. look for this file to login to things. So if you have some edge case for it then that's a good enough reason to keep it around. If you really need it for some one off things maybe symlink it into tmpfs that way it's lost upon reboot?
Next are you info and history files.
Pretty much anything with the suffix info or history is going to be a history file
These files are rarely ever a good idea to port around. At best it's just junk info that doesn't pertain to whatever system you're on. At worse they could contain sensitive information. Generally avoid moving these around.
Keeping Your Dotfiles fresh
One of the more fun/painful things of setting up a new system is getting your dotfiles moved over. There's A LOT of ways to organize them and keep them. I've tried almost everything over the years. The last system I used was yadm and while it worked good enough it just never really did it for me. So I would almost always just move things around and redo configs.
Recently I've come upon fresh and the workflow for that just makes sense to me. So I'm slowly migrating into this.