84 lines
4.1 KiB
HTML
84 lines
4.1 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
|
|
<!Converted with LaTeX2HTML 95.1 (Fri Jan 20 1995) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
|
|
<HEAD>
|
|
<TITLE>3.3.1 Moving around</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<meta name="description" value="3.3.1 Moving around">
|
|
<meta name="keywords" value="gs">
|
|
<meta name="resource-type" value="document">
|
|
<meta name="distribution" value="global">
|
|
<P>
|
|
<BR> <HR><A NAME=tex2html3120 HREF="node108.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html3118 HREF="node106.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html3112 HREF="node106.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html3122 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html3123 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html3121 HREF="node108.html">3.3.2 Looking at the </A>
|
|
<B>Up:</B> <A NAME=tex2html3119 HREF="node106.html">3.3 First Steps into </A>
|
|
<B> Previous:</B> <A NAME=tex2html3113 HREF="node106.html">3.3 First Steps into </A>
|
|
<BR> <HR> <P>
|
|
<H2><A NAME=SECTION00531000000000000000>3.3.1 Moving around</A></H2>
|
|
<P>
|
|
Now that we can login, and know how to refer to files using pathnames,
|
|
how can we change our current working directory, to make life easier?
|
|
<P>
|
|
<A NAME=2350> </A>
|
|
<A NAME=2351> </A>
|
|
The command for moving around in the directory structure is
|
|
<tt>cd</tt>, short for ``change directory''. You'll
|
|
notice that many often-used Unix commands are two or three letters.
|
|
The usage of the <tt>cd</tt> command is:
|
|
<P><TT> cd <IMG BORDER=0 ALIGN=BOTTOM ALT="" SRC="img102.gif"> <P></TT>
|
|
where <IMG BORDER=0 ALIGN=BOTTOM ALT="" SRC="img103.gif"> is the name of the directory which you wish
|
|
to change to.
|
|
<P>
|
|
As we said, when you login, you begin in your home directory. If
|
|
Larry wanted to move down into the <tt>papers</tt> subdirectory, he'd
|
|
use the command
|
|
<P><TT> /home/larry# <em>cd papers</em> <BR>
|
|
/home/larry/papers#
|
|
<P></TT>
|
|
As you can see, Larry's prompt changes to reflect his current working
|
|
directory (so he knows where he is). Now that he's in the <tt>papers</tt>
|
|
directory, he can look at his history final with the command
|
|
<P><TT> /home/larry/papers# <em>more history-final</em>
|
|
<P></TT>
|
|
<P>
|
|
<A NAME=2352> </A>
|
|
<A NAME=2353> </A>
|
|
<A NAME=2354> </A>
|
|
Now, Larry is stuck in the <tt>papers</tt> subdirectory. To move back
|
|
up to the parent directory, use the command
|
|
<P><TT> /home/larry/papers# <em>cd ..</em> <BR>
|
|
/home/larry#
|
|
<P></TT>
|
|
(Note the space between the ``<tt>cd</tt>'' and the ``<tt>..</tt>''.)
|
|
Every directory has an entry named ``<tt>..</tt>'' which refers to
|
|
the parent directory. Similarly, every directory has an entry
|
|
named ``<tt>.</tt>'' which refers to itself. Therefore, the command
|
|
<P><TT> /home/larry/papers# <em>cd .</em>
|
|
<P></TT>
|
|
gets us nowhere.
|
|
<P>
|
|
You can also use absolute pathnames in the <tt>cd</tt> command.
|
|
To <tt>cd</tt> into Karl's home directory, we can use the command
|
|
<P><TT> /home/larry/papers# <em>cd /home/karl</em> <BR>
|
|
/home/karl#
|
|
<P></TT>
|
|
<P>
|
|
Also, using <tt>cd</tt> with no argument will return you to your own
|
|
home directory.
|
|
<P><TT> /home/karl# <em>cd</em> <BR>
|
|
/home/larry#
|
|
<P></TT>
|
|
<A NAME=2355> </A>
|
|
<P>
|
|
<BR> <HR><A NAME=tex2html3120 HREF="node108.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html3118 HREF="node106.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html3112 HREF="node106.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html3122 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html3123 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html3121 HREF="node108.html">3.3.2 Looking at the </A>
|
|
<B>Up:</B> <A NAME=tex2html3119 HREF="node106.html">3.3 First Steps into </A>
|
|
<B> Previous:</B> <A NAME=tex2html3113 HREF="node106.html">3.3 First Steps into </A>
|
|
<BR> <HR> <P>
|
|
<BR> <HR>
|
|
<P><ADDRESS>
|
|
<I>Matt Welsh <BR>
|
|
mdw@sunsite.unc.edu</I>
|
|
</ADDRESS>
|
|
</BODY>
|