From ArchWiki
Revision as of 09:12, 12 November 2009 by M l (talk | contribs) (added Sudo, System-Wide vs. User-Specific Configuration and Add, Create & Edit)
Jump to: navigation, search

Because the vast majority of the ArchWiki contains indications that may need clarification for users new to GNU/Linux, this rundown of basic procedures was written both to avoid confusion in the assimilation of the articles and to deter repetition in the content itself.

Besides covering basic differentiations, this article could serve to improve the quality of the Wiki by avoiding repetition. How many articles say: "edit in ~/.bashrc, or zhrc (if you're using zsh) -- alternatively, edit /etc/profile.bash for system-wide changes" or something to that effect? And even though it sounds counterintuitive, expanding this article makes the Wiki better for advanced users as well, since they won't be presented with the same old information they're accustomed to skip.

We could have a basic run down of common file locations and what they mean, instead of explaining them in every article. Editors can just say "add the following to the shell's configuration" and readers would then decide whether they want it system-wide or not, etc.

Just like article:ABS is referred to in every page that involves compiling, this page could serve the same kind of utility.

Regular user or root?

Some lines are written like so:

# pacman -S

Others have a different prefix:

$ pacman -S

The numeral sign (#) indicates that the line is to be entered as root, whereas the dollar sign ($) shows that the line is to be entered as a regular user.

A notable exception to watch out for:

# This alias makes ls colorize the listing
alias ls='ls --color=auto

In this example, the context surrounding the numeral sign tells the reader that this is not to be ran as a command; it should be edited into a file instead. So in this case, the numeral sign denotes a comment. Bash scripts denotation for comments happens to coincide with the root PS1.

After further examination, "give away" signs include the uppercase character after the # sign. Usually, Unix commands are not written this way and most of the time they are short abbreviations instead of full-blown English words (e.g. Copy=cp).

Regardless, most articles make this easy to discern by notifying the reader:

Append to Template:Filename:

# This alias makes ls colorize the listing
alias ls='ls --color=auto


When you see a command prefixed with sudo, it means that you need to have sudo installed and configured in order to use sudo. Or run the command as root.

Using sudo:

$ sudo pacman -Syu 

Same command without sudo:

# pacman -Syu 

System-Wide vs. User-Specific Configuration

It's important to remember that there are two different kinds of configurations on a Linux system. System-Wide configuration affects all users. System-Wide settings are generally made/located in the /etc directory, so you must be root in order to change System-Wide settings or using sudo. Since you want these settings to apply to all users, you make the changes in /etc. Some configuration files in /etc include: /etc/bash.bashrc, /etc/fstab, /etc/hosts and /etc/X11/xorg.conf. In fact, nearly all the files in /etc are configuration files.

User-Specific configuration affects only a single user. Dotfiles are used for User-Specific configuration. For example, the file ~/.bashrc is the User-Specific per-interactive-shell startup file. This will be different for every user on the system, so each user has their own .bashrc file in their home directory. This allows each user to define: aliases, functions and other interactive features like the prompt.

So when you see that System-Wide, Systemwide is mentioned it affects all users. And when you see that User-Specific, Per-User is mentioned it only affects a single user.

Note: ~/ is a shortcut for the user's home directory /home/user-name/, that is currently logged in.

Add, Create & Edit

Whenever you see the words add, create and edit. It simply means to use your favorite text editor to make changes to a configuration file(s). For example emacs, nano, vim. I suggest starting with nano if you don't have a favorite text editor or don't know how to use the others. When you are ready start using a more powerful text editor like the ones mentioned above, editing configuration file(s) will be faster.