Results 1 to 3 of 3
Hello, I am a newbie and my manager has told me to override some parameters in the command line or in the config files. My understanding is that some parameters ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-04-2010 #1
- Join Date
- Sep 2010
command line vs config files
I am a newbie and my manager has told me to override some parameters in the command line or in the config files. My understanding is that some parameters are defined in config file and then you can either change them or override them in the command line. Is that correct? which one is more important (i.e. doesn command line params override configs or vice versa).
I am very new to this concept also, can you point me to a very basic tutorial for this?
- 10-04-2010 #2
This is more like a rule of thumb, as it depends on the daemon/application to implement it *if* it makes sense:
"command line" overrides "config file in $HOME" overrides "config file in /etc"You must always face the curtain with a bow.
- 10-08-2010 #3
To go into a bit more detail:
There is no Linux rule for this. It is up to each individual program how it handles config files (or whether it handles them at all).
For big programs like Bash, Vim, etc., config files are usually organized as such:
* A system-wide configuration file that applies sensible defaults to all users. This is usually in /etc (e.g. /etc/bashrc).
* A per-user configuration file that overrides the system-wide configuration file. This is usually in the user's home directory (e.g. ~/.bashrc).
* Configuration options given at the time of execution that override everything else. These can be either environment variables or commandline parameters.
Some smaller programs may simply have a single configuration file that is on a per-user basis.
The best way to check how to configure a program is to check its manual page. This can be done by running the "man" command. For instance, to learn about how to configure bash (it's a bit verbose, but...), you can run the command:
FILES /bin/bash The bash executable /etc/profile The systemwide initialization file, executed for login shells /etc/bash.bashrc The systemwide per-interactive-shell startup file /etc/bash.bash.logout The systemwide login shell cleanup file, executed when a login shell exits ~/.bash_profile The personal initialization file, executed for login shells ~/.bashrc The individual per-interactive-shell startup file ~/.bash_logout The individual login shell cleanup file, executed when a login shell exits ~/.inputrc Individual readline initialization file