LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-03-2015, 03:12 PM   #1
PACMANchasingme
Member
 
Registered: Mar 2015
Distribution: Arch
Posts: 62

Rep: Reputation: Disabled
Understanding configuration files better


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.
 
Old 06-03-2015, 03:49 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
/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.
 
1 members found this post helpful.
Old 06-03-2015, 06:18 PM   #3
PACMANchasingme
Member
 
Registered: Mar 2015
Distribution: Arch
Posts: 62

Original Poster
Rep: Reputation: Disabled
Thanks for the detailed answer.

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.

yeah, linux has a ways to go still
 
Old 06-04-2015, 07:33 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] help understanding configuration structs HalfMadDad Linux - Networking 5 08-04-2013 07:51 AM
sendmail basic understanding of operation needed for configuration burkecabaniss Linux - Newbie 5 05-16-2013 03:24 AM
Understanding Delay Pool Configuration (Squid) carl0ski Linux - Server 0 04-20-2007 01:00 AM
help understanding .tar.gz files lucky_1811 Linux - General 6 02-07-2004 11:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration