R.e. Advanced commandline - proposed chapter for Server guide attached
icosa atropa
icos.atropa at gmail.com
Tue Dec 12 03:44:31 UTC 2006
Dear Ubuntu server documentation team,
I've been drafting the following chapter in response to a number of
repeated questions on the ubuntu forum for the server guide and my own
use of the server guide. I've tried to follow the project outline at
https://wiki.ubuntu.com/ServerGuide, esp. with regards to overlap with
desktop guide. My goal is primarily an explanatory overview of
commandline concepts that will be used in operations described in the
Server Guide's later chapters. As per the ubuntu style guide,
"Explanatory writing is used for special language or concepts that
users need to understand a procedure. Format explanatory text in
paragraphs."
Your comments and suggestions are very much appreciated,
christian
----------------------------------------------------------------
Proposed Chapter 2.5 - After installation, before Package management
Introduction:
The default installation of ubuntu server does not include a desktop
environment. Instead, users login to the commandline. This is
intentional. The commandline requires less per-user overhead and is
easier to troubleshoot. Advantages notwithstanding, new users often
find the commandline intimidating.
This chapter of the server guide provides an overview of the
commandline from a server administer's point of view. The goal of
this chapter is to explain core concepts rather than to provide
exhaustive detail or advocate specific solutions.
1. Basics
Ubuntu server ships with the bash shell installed as its default.
When users log in, a new shell is started. Users type text onto the
commandline. When enter is pressed, the line of text is split into
arguments separated by whitespace. The first argument is typically a
command; the remaining arguments can include command options (e.g.
-v), files (e.g. /etc/bashrc) and special shell-interpreted constructs
like redirects (e.g. >out.file).
Documentation is available for commonly used commands as man pages.
For administrators, man pages are valuable resources to which the
exclamation RTFM refers. For example, typing "man man" will give the
man page for the man command. Most gnu tools include info pages that
are called with "info topic". In addition, many programs give useful
information when given the -h or --help arguments (e.g. info --help).
2. Commandline editing
Commandline editing can speed and ease commandline use. By default,
the bash shell uses the gnu readline library with emacs key bindings
(e.g. ^-a and ^-e) to edit text commandline text and interact with the
command history[1]. In addition, tab completion allows the shell to
search for, and either complete or display, text matching the already
entered text. Both readline and tab completion are highly
configurable.
3. Shell Environment
When a new shell starts, it reads several files that determine its
environment. Each shell's environment influences the behavior of that
shell and of commands started from that shell. By default, every
shell reads /etc/bashrc on startup. In addition, each user's shell
reads '~/.bashrc' on startup by default. Finally, the environment can
be altered from the commandline itself (e.g export VAR=Value).
4. Permissions and Sudo
By default, ubuntu uses unix-style file permissions[2] to determine
the user's priveledges to read, write, and execute the system's files
(ubuntu, like most unix-like operating systems, views directories and
pipes as files). Root is the special user who has unrestricted
priviledges.
Many administrative activities must be performed with root
priviledges. In ubuntu, login as root is discouraged. Instead,
select users are included in the sudoers file. These users can
execute commands with elevated privileges by using sudo. One
advantage of this method is that all sudo executions are recorded in
logfiles, improving accountability. In addition, using sudo for each
root-level command helps remind users to use caution.
#--- Still working on
5. Special Topic
a. Pipes and Redirects
b. Globs and Regular Expressions
6. Editors
a. nano is default
b. vim has minimalist ui, fast, installed by default
c. emacs not installed by default, is easy to begin using and highly extensible
7. Programming
a. ubuntu system uses many scripts
b. editors include helpful programming tools
c. programming helps users help themselves
[1] http://www.delorie.com/gnu/docs/readline/readline.3.html
[2] http://en.wikipedia.org/wiki/Unix_permissions
More information about the ubuntu-doc
mailing list