Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hey, I'm aware that /etc/ stores config files and in my home directory I also have dot files as well as a .config folder.
And I'm told not to edit /etc/ but create a copy in my home directory to preserve original files. Is it as simple as creating the full path the same as /etc/ and editing it in home folder?
Ideally this is how I hope it works, because I don't want to edit /etc/ and end up with a bunch of custom, non default files.
Last edited by PACMANchasingme; 06-03-2015 at 03:13 PM.
/etc has many different configuration files for many different purposes. These are generally for "global" setups (i.e. those that affect all users on the system). Your $HOME will typically have far less files that are "user specific" rather than global. Some of these are designed to be used to override or augment what you got from the global files and some are simply only used by users and have no global. Similarly many global files have no user specific files.
Examples of global only files are /etc/fstab which is used to define filesystem mounts and /etc/hosts is used to define hostname IP relationships that aren't defined other ways (e.g. in NFS or NIS). They don't really have files you put in $HOME to override them.
Based one what you wrote in your question I suspect what you're really asking about are the files that are loaded by the shell when you login or become a specific user. Typically the global files would be things in /etc such as /etc/profile, /etc/bashrc, and /etc/bash_profile. The files in your $HOME would be things like .profile, .bashrc and .bash_profile. You can determine which files are used by your shell by typing "man <shell>" and reviewing its man page (e.g. man ksh for Kornshell or man bash for Bourne Again Shell). Usually the .file in your $HOME will override or add to whatever was in the file in /etc.
An example would be PATH= which is usually set in the global files for some default locations like /bin, /usr/bin etc... In your .file you could add to what is in PATH or replace it completely. To add to it you make a statement like:
PATH=$PATH:/usr/local/bin:/opt/myprog/bin
To replace it you'd leave out the $PATH - it is the $PATH that tells it to include whatever has already been defined for PATH and the items following separated by colons are the ones you're adding. Without the $PATH it simply uses the items you define.
Other things you might have that wouldn't be global might be .vimrc which sets defaults in your $HOME for the way you use the editor, vim.
Last edited by MensaWater; 06-03-2015 at 03:54 PM.
The bash manual page is very long, and it doesn't list what files are global only. I guess who ever wrote it didn't care some noob has to figure out each file one by one.
I don't like how my original .xinitrc is in /etc/X11/.xinitrc but but in my home it doesn't need the X11 folder, some config files need the full path, some dont how confusing is that.... My pulseaudio is in /home/.config when some of it is just in /home/, what a mess.
No YOU have a way to go. Linux allows you to do tons of configuration to set it exactly the way YOU want it unlike Windows which cans your experience for you.
As I noted each configuration file has its own purpose. The ones I mentioned for bash are specific to the shell environment. The ones you're talking about are not for Bash but for X11 and Pulseaudio respectively so would not be defined by the bash man page. Each of those defines its own setup and not all users (or even most) use them. The reason they're not ubiquitous is because YOU get to choose what tools you use.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.