477 lines
7.0 KiB
HTML
477 lines
7.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Exercises</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="Introduction to Linux"
|
|
HREF="index.html"><LINK
|
|
REL="UP"
|
|
TITLE="About files and the file system"
|
|
HREF="chap_03.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Summary"
|
|
HREF="sect_03_05.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Processes"
|
|
HREF="chap_04.html"></HEAD
|
|
><BODY
|
|
CLASS="sect1"
|
|
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"
|
|
>Introduction to Linux: </TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="sect_03_05.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Chapter 3. About files and the file system</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="chap_04.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="sect1"
|
|
><H1
|
|
CLASS="sect1"
|
|
><A
|
|
NAME="sect_03_06"
|
|
></A
|
|
>3.6. Exercises</H1
|
|
><P
|
|
>Just login with your common user ID.</P
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="sect_03_06_01"
|
|
></A
|
|
>3.6.1. Partitions</H2
|
|
><P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
>On which partition is your home directory?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>How many partitions are on your system?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>What is the total size of your Linux installation?</P
|
|
></LI
|
|
></UL
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="sect_03_06_02"
|
|
></A
|
|
>3.6.2. Paths</H2
|
|
><P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
>Display your search path.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Export a senseless path by entering, for instance, <B
|
|
CLASS="command"
|
|
>export <TT
|
|
CLASS="varname"
|
|
>PATH</TT
|
|
>=<TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>blah</I
|
|
></TT
|
|
></B
|
|
> and try listing directory content.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>What is the path to your home directory? How would another user reach your home directory starting from his own home directory, using a relative path?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Go to the <TT
|
|
CLASS="filename"
|
|
>tmp</TT
|
|
> directory in <TT
|
|
CLASS="filename"
|
|
>/var</TT
|
|
>.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Now go to <TT
|
|
CLASS="filename"
|
|
>share</TT
|
|
> in <TT
|
|
CLASS="filename"
|
|
>/usr</TT
|
|
> using only one command. Change to <TT
|
|
CLASS="filename"
|
|
>doc</TT
|
|
>. What is your present working directory?</P
|
|
></LI
|
|
></UL
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="sect_03_06_03"
|
|
></A
|
|
>3.6.3. Tour of the system</H2
|
|
><P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
>Change to the <TT
|
|
CLASS="filename"
|
|
>/proc</TT
|
|
> directory.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>What CPU(s) is the system running on?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>How much RAM does it currently use?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>How much swap space do you have?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>What drivers are loaded?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>How many hours has the system been running?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Which filesystems are known by your system?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Change to <TT
|
|
CLASS="filename"
|
|
>/etc/rc.d | /etc/init.d | /etc/runlevels</TT
|
|
> and choose the directory appropriate for your run level.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>What services should be running in this level?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Which services run in graphical mode that don't run in text mode?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Change to <TT
|
|
CLASS="filename"
|
|
>/etc</TT
|
|
></P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>How long does the system keep the log file in which user logins are monitored?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Which release are you running?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Are there any issues or messages of the day?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>How many users are defined on your system? Don't count them, let the computer do it for you!</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>How many groups?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Where is the time zone information kept?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Are the HOWTOs installed on your system?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Change to <TT
|
|
CLASS="filename"
|
|
>/usr/share/doc</TT
|
|
>.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Name three programs that come with the GNU <EM
|
|
>coreutils</EM
|
|
> package.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Which version of <B
|
|
CLASS="command"
|
|
>bash</B
|
|
> is installed on this system?</P
|
|
></LI
|
|
></UL
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="sect_03_06_04"
|
|
></A
|
|
>3.6.4. Manipulating files</H2
|
|
><P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
>Create a new directory in your home directory.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Can you move this directory to the same level as your home directory?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Copy all XPM files from <TT
|
|
CLASS="filename"
|
|
>/usr/share/pixmaps</TT
|
|
> to the new directory. What does XPM mean?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>List the files in reverse alphabetical order.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Change to your home directory. Create a new directory and copy all the files of the <TT
|
|
CLASS="filename"
|
|
>/etc</TT
|
|
> directory into it. Make sure that you also copy the files and directories which are in the subdirectories of <TT
|
|
CLASS="filename"
|
|
>/etc</TT
|
|
>! (recursive copy)</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Change into the new directory and make a directory for files starting with an upper case character and one for files starting with a lower case character. Move all the files to the appropriate directories. Use as few commands as possible.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Remove the remaining files.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Delete the directory and its entire content using a single command.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Use <B
|
|
CLASS="command"
|
|
>grep</B
|
|
> to find out which script starts the Font Server in the graphical run level.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Where is the <EM
|
|
>sendmail</EM
|
|
> server program?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Make a symbolic link in your home directory to <TT
|
|
CLASS="filename"
|
|
>/var/tmp</TT
|
|
>. Check that it really works.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Make another symbolic link in your home directory to this link. Check that it works. Remove the first link and list directory content. What happened to the second link?</P
|
|
></LI
|
|
></UL
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="sect_03_06_05"
|
|
></A
|
|
>3.6.5. File permissions</H2
|
|
><P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
>Can you change file permissions on <TT
|
|
CLASS="filename"
|
|
>/home</TT
|
|
>?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>What is your standard file creation mode?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Change ownership of <TT
|
|
CLASS="filename"
|
|
>/etc</TT
|
|
> to your own user and group.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Change file permissions of <TT
|
|
CLASS="filename"
|
|
>~/.bashrc</TT
|
|
> so that only you and your primary group can read it.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Issue the command <B
|
|
CLASS="command"
|
|
>locate <TT
|
|
CLASS="filename"
|
|
>root</TT
|
|
></B
|
|
>. Do you notice anything special?</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Make a symbolic link to <TT
|
|
CLASS="filename"
|
|
>/root</TT
|
|
>. Can it be used?</P
|
|
></LI
|
|
></UL
|
|
></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="sect_03_05.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="chap_04.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Summary</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="chap_03.html"
|
|
ACCESSKEY="U"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Processes</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |