slackware-current/slackbook/html/shell.html
Patrick J Volkerding 75a4a592e5 Slackware 13.37
Mon Apr 25 13:37:00 UTC 2011
Slackware 13.37 x86_64 stable is released!

Thanks to everyone who pitched in on this release: the Slackware team,
the folks producing upstream code, and linuxquestions.org for providing
a great forum for collaboration and testing.

The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a
dual-sided
32-bit/64-bit x86/x86_64 DVD.  Please consider supporting the Slackware
project by picking up a copy from store.slackware.com.  We're taking
pre-orders now, and offer a discount if you sign up for a subscription.

As always, thanks to the Slackware community for testing, suggestions,
and feedback.  :-)

Have fun!
2018-05-31 22:45:18 +02:00

166 lines
6.6 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>The Shell</title>
<meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" />
<link rel="HOME" title="Slackware Linux Essentials" href="index.html" />
<link rel="PREVIOUS" title="Dual Booting" href="booting-dual.html" />
<link rel="NEXT" title="The Command Line" href="shell-command-line.html" />
<link rel="STYLESHEET" type="text/css" href="docbook.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body class="CHAPTER" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"
alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<th colspan="3" align="center">Slackware Linux Essentials</th>
</tr>
<tr>
<td width="10%" align="left" valign="bottom"><a href="booting-dual.html"
accesskey="P">Prev</a></td>
<td width="80%" align="center" valign="bottom"></td>
<td width="10%" align="right" valign="bottom"><a href="shell-command-line.html"
accesskey="N">Next</a></td>
</tr>
</table>
<hr align="LEFT" width="100%" />
</div>
<div class="CHAPTER">
<h1><a id="SHELL" name="SHELL"></a>Chapter 8 The Shell</h1>
<div class="TOC">
<dl>
<dt><b>Table of Contents</b></dt>
<dt>8.1 <a href="shell.html#SHELL-USERS">Users</a></dt>
<dt>8.2 <a href="shell-command-line.html">The Command Line</a></dt>
<dt>8.3 <a href="shell-bash.html">The Bourne Again Shell (bash)</a></dt>
<dt>8.4 <a href="shell-vt.html">Virtual Terminals</a></dt>
</dl>
</div>
<p>In a graphical environment, the interface is provided by a program that creates
windows, scrollbars, menus, etc. In a commandline environment, the user interface is
provided by a shell, which interprets commands and generally makes things useable.
Immediately after logging in (which is covered in this chapter), users are put into a
shell and allowed to go about their business. This chapter serves as an introduction to
the shell, and to the most common shell among Linux users-- the Bourne Again Shell
(bash). For more detailed information on anything in this chapter, check out the <tt
class="COMMAND">bash</tt>(1) man page.</p>
<div class="SECT1">
<h1 class="SECT1"><a id="SHELL-USERS" name="SHELL-USERS">8.1 Users</a></h1>
<div class="SECT2">
<h2 class="SECT2"><a id="AEN2678" name="AEN2678">8.1.1 Logging In</a></h2>
<p>So you've booted, and you're looking at something that looks like this:</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
Welcome to Linux 2.4.18
Last login: Wed Jan 1 15:59:14 -0500 2005 on tty6.
darkstar login:
</pre>
</td>
</tr>
</table>
<p>Hmm.. nobody said anything about a login. And what's a darkstar? Don't worry; you
probably didn't accidentally fire up a hyperspace comm-link to the Empire's artificial
moon. (I'm afraid the hyperspace comm-link protocol isn't currently supported by the
Linux kernel. Maybe the 2.8 kernel branch will at last provide this oft looked-for
support.) No, darkstar is just the name of one of our computers, and its name gets
stamped on as the default. If you specified a name for your computer during setup, you
should see it instead of darkstar.</p>
<p>As for the login... If this is your first time, you'll want to log in as <tt
class="USERNAME">root</tt>. You'll be prompted for a password; if you set one during the
setup process, that's what it's looking for. If not, just hit enter. That's it-- you're
in!</p>
</div>
<div class="SECT2">
<h2 class="SECT2"><a id="AEN2693" name="AEN2693">8.1.2 Root: The Superuser</a></h2>
<p>Okay, who or <span class="emphasis"><i class="EMPHASIS">what</i></span> is <tt
class="USERNAME">root</tt>? And what's it doing with an account on <span
class="emphasis"><i class="EMPHASIS">your</i></span> system?</p>
<p>Well, in the world of Unix and similar operating systems (like Linux), there are users
and then there are users. We'll go into this in more detail later, but the important
thing to know now is that <tt class="USERNAME">root</tt> is the user above all users; <tt
class="USERNAME">root</tt> is all-powerful and all-knowing, and <span class="emphasis"><i
class="EMPHASIS">nobody</i></span> disobeys <tt class="USERNAME">root</tt>. It just isn't
allowed. <tt class="USERNAME">root</tt> is what we call a &#8220;superuser&#8221;, and
rightly so. And best of all, <tt class="USERNAME">root</tt> is <span class="emphasis"><i
class="EMPHASIS">you</i></span>.</p>
<p>Cool, huh?</p>
<p>If you're not sure: yes, that's very cool. The catch is, though, that root is
inherently allowed to break anything it so desires. You might want to skip ahead to <a
href="essential-sysadmin.html#ESSENTIAL-SYSADMIN-USERS-SCRIPTS">Section 12.1.1</a> and
see about adding a user; then login as that user and work from there. The traditional
wisdom is that it's best to only become the superuser when absolutely necessary, so as to
minimize the possibility of accidentally breaking something.</p>
<p>By the way, if you decide you want to be root while you're logged in as someone else,
no problem. Just use the <tt class="COMMAND">su</tt>(1) command. You'll be asked for <tt
class="USERNAME">root's</tt> password and then it will make you <tt
class="USERNAME">root</tt> until you <tt class="COMMAND">exit</tt> or <tt
class="COMMAND">logout</tt>. You can also become any other user using <tt
class="COMMAND">su</tt>, provided you know that user's password: <tt class="COMMAND">su
logan</tt>, for instance, would make you me.</p>
<div class="NOTE">
<table class="NOTE" width="100%" border="0">
<tr>
<td width="25" align="CENTER" valign="TOP"><img src="./imagelib/admon/note.png"
hspace="5" alt="Note" /></td>
<td align="LEFT" valign="TOP">
<p><tt class="USERNAME">root</tt> is allowed to su to any user, without requiring their
password.</p>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="NAVFOOTER">
<hr align="LEFT" width="100%" />
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href="booting-dual.html"
accesskey="P">Prev</a></td>
<td width="34%" align="center" valign="top"><a href="index.html"
accesskey="H">Home</a></td>
<td width="33%" align="right" valign="top"><a href="shell-command-line.html"
accesskey="N">Next</a></td>
</tr>
<tr>
<td width="33%" align="left" valign="top">Dual Booting</td>
<td width="34%" align="center" valign="top">&nbsp;</td>
<td width="33%" align="right" valign="top">The Command Line</td>
</tr>
</table>
</div>
</body>
</html>