Find the answer to your Linux question:
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.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    12

    command line vs config files


    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 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?

    Thanks,

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,398
    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.

  3. #3
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    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:
    Code:
    man bash
    towards the bottom of the man page, you'll see a section called FILES:
    Code:
    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
    The whole rest of the man page is documentation about the bash program. You can run "man" on basically any commandline program.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •