Skip to content
Newer
Older
100644 254 lines (227 sloc) 13.6 KB
0e2d67a @lsblakk and now with a .nojekyll
lsblakk authored Dec 8, 2011
1
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6 <html xmlns="http://www.w3.org/1999/xhtml">
7 <head>
8 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
10 <title>Command Line Navigation &mdash; PyStar: Programming Workshops for Women and Their Friends</title>
11 <link rel="stylesheet" href="../_static/agogo.css" type="text/css" />
12 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
13 <script type="text/javascript">
14 var DOCUMENTATION_OPTIONS = {
15 URL_ROOT: '../',
16 VERSION: '0.2',
17 COLLAPSE_INDEX: false,
18 FILE_SUFFIX: '.html',
19 HAS_SOURCE: true
20 };
21 </script>
22 <script type="text/javascript" src="../_static/jquery.js"></script>
23 <script type="text/javascript" src="../_static/underscore.js"></script>
24 <script type="text/javascript" src="../_static/doctools.js"></script>
25 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
26 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
27 <script type="text/javascript" src="http://tablesorter.googlecode.com/svn/trunk/jquery.tablesorter.min.js"></script>
28 <script type="text/javascript" src="../_static/js/third_party/jquery.twitter.mentions/jquery.twitter.mentions.js"></script>
29 <script type="text/javascript" src="../_static/js/pystar.js"></script>
30 <script type="text/javascript" src="../_static/js/third_party/jquery.socialbutton-1.7.1.js"></script>
31 <link rel="shortcut icon" href="../_static/pystar_flaming_32_150px.ico"/>
32 <link rel="author" title="About these documents" href="../about.html" />
33 <link rel="top" title="PyStar: Programming Workshops for Women and Their Friends" href="../index.html" />
34 <link rel="up" title="Badges" href="index.html" />
35 <link rel="next" title="In the Beginning was the Command Line" href="badge_inthebeginning.html" />
36 <link rel="prev" title="Help Yourself!" href="badge_self_help.html" />
37
38 <link rel="stylesheet" href="../_static/pystar.css" type="text/css" />
39 <link rel="stylesheet" href="../_static/css/twitter-mentions.css" type="text/css" />
40 <link rel="stylesheet" href="../_static/tablesorter_blue_skin/style.css" type="text/css" />
62a78db @lsblakk added in google analytics
lsblakk authored Dec 8, 2011
41 <script type="text/javascript">
42
43 var _gaq = _gaq || [];
44 _gaq.push(['_setAccount', 'UA-27597337-1']);
45 _gaq.push(['_trackPageview']);
46
47 (function() {
48 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
49 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
50 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
51 })();
52
53 </script>
0e2d67a @lsblakk and now with a .nojekyll
lsblakk authored Dec 8, 2011
54
55
56 </head>
57 <body>
58
59 <div class="header-wrapper">
60 <div class="header">
61 <p class="logo"><a href="../index.html">
62 <img class="logo" src="../_static/pystar_flaming_160_150px.png" alt="Logo"/>
63 </a></p>
64 <h1><a href="../index.html">PyStar: Programming Workshops for Women and Their Friends</a></h1>
65 <div class="rel">
66 <a href="badge_self_help.html" title="Help Yourself!"
67 accesskey="P">previous</a> |
68 <a href="badge_inthebeginning.html" title="In the Beginning was the Command Line"
69 accesskey="N">next</a>
70 </div>
71 </div>
72 </div>
73
74 <div style="position: absolute; top:0px; right:0px">
75 <a href="https://github.com/pystar/pystar"><img src="../_static/img/forkme_right_darkblue_121621.png" /></a>
76 </div>
77
78 <div class="content-wrapper">
79 <div class="content">
80 <div class="document">
81
82
83 <div class="documentwrapper">
84 <div class="bodywrapper">
85 <div class="body">
86
87 <div class="section" id="command-line-navigation">
88 <h1>Command Line Navigation<a class="headerlink" href="#command-line-navigation" title="Permalink to this headline">¶</a></h1>
89 <p>This badge is to learn how to navigate using the command line (CLI).</p>
90 <blockquote>
91 <div></div></blockquote>
92 <div class="section" id="commands">
93 <h2>Commands<a class="headerlink" href="#commands" title="Permalink to this headline">¶</a></h2>
94 <p>Commands used when navigating in the CLI:</p>
95 <ul class="simple">
96 <li>cd</li>
97 <li>ls</li>
98 <li>mkdir</li>
99 <li>pwd</li>
100 </ul>
101 </div>
102 <div class="section" id="concepts">
103 <h2>Concepts<a class="headerlink" href="#concepts" title="Permalink to this headline">¶</a></h2>
104 <p>Navigation requires an understanding of the above commands and of file system paths, both relative and absolute.</p>
105 <div class="section" id="absolute-power-corrupts-absolutely">
106 <h3>Absolute power corrupts absolutely<a class="headerlink" href="#absolute-power-corrupts-absolutely" title="Permalink to this headline">¶</a></h3>
107 <p>Absolute paths are the full name to a file or directory starting from root.</p>
108 <p>If I want to navigate to a folder in my Documents folder (on a Mac), the absolute path would look something like:</p>
109 <div class="highlight-python"><pre>$ cd /Users/Amanda/Documents/Thesis/</pre>
110 </div>
111 </div>
112 <div class="section" id="it-s-all-relative">
113 <h3>It&#8217;s all relative<a class="headerlink" href="#it-s-all-relative" title="Permalink to this headline">¶</a></h3>
114 <p>Relative paths are partial path names relative to where you are in the directory structure.</p>
115 <p>If I am in <tt class="docutils literal"><span class="pre">/Users/Amanda</span></tt>, then the way to get to my Thesis folder using the relative path would look something like:</p>
116 <div class="highlight-python"><pre>$ cd Documents/Thesis</pre>
117 </div>
118 <p>If I am in my Thesis folder and I want to move to a different folder within my Documents directory, I would do something like:</p>
119 <div class="highlight-python"><pre>$ cd ../IF</pre>
120 </div>
121 <p>The double dot notation is shorthand for &#8220;go up a directory,&#8221; which is this case is Documents. From there, I can then go down into my IF directory (and play some text adventure games).</p>
122 <p>Here is a more complicated example: from my IF directory, I could get to a folder of pictures in my Pictures directory (absolute path: /Users/Amanda/Pictures/atlanta) by typing:</p>
123 <div class="highlight-python"><pre>$ cd ../../Pictures/atlanta/</pre>
124 </div>
125 <p>The first <tt class="docutils literal"><span class="pre">..</span></tt> takes me up to Documents, the second <tt class="docutils literal"><span class="pre">..</span></tt> takes me up to my user directory (Amanda) and from there I can go down into Pictures and then into atlanta.</p>
126 </div>
127 </div>
128 <div class="section" id="do">
129 <h2>Do<a class="headerlink" href="#do" title="Permalink to this headline">¶</a></h2>
130 <p>Open a command line window. Explore your file system in the CLI using the following commands and using absolute and relative path names:</p>
131 <ul class="simple">
132 <li>ls</li>
133 <li>pwd</li>
134 <li>cd</li>
135 </ul>
136 <p><tt class="docutils literal"><span class="pre">ls</span></tt> means &#8220;list&#8221; and it will show you the list of files in the directory you are in. Try using some optional arguments such as <tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">-p</span></tt>, or <tt class="docutils literal"><span class="pre">-l</span></tt>. What do they show you that just running <tt class="docutils literal"><span class="pre">ls</span></tt> without arguments doesn&#8217;t?</p>
137 <p><tt class="docutils literal"><span class="pre">pwd</span></tt> means &#8220;print working directory,&#8221; which is fairly self explainitory. Try typing it in different directories. What does it return?</p>
138 <p><tt class="docutils literal"><span class="pre">cd</span></tt> means &#8220;change directory,&#8221; which is also fairly self explainitory. Try typing in <tt class="docutils literal"><span class="pre">cd</span></tt> by itself. Where does it bring you? Try navigating to a directory within your files system and list the files in that directory. Use absolute and relative paths to visit several different directories on your file system.</p>
139 </div>
140 <div class="section" id="done">
141 <h2>Done<a class="headerlink" href="#done" title="Permalink to this headline">¶</a></h2>
142 <p>Here&#8217;s an example of what your CLI screen might look like after completing the above work:</p>
143 <div class="highlight-bash"><pre>amanda-nyrens-macbook-pro:~ Amanda$ pwd
144 /Users/Amanda
145 amanda-nyrens-macbook-pro:~ Amanda$ ls
146 Calibre Library Documents Icon? Movies Pictures Sites VirtualBox VMs
147 Desktop Downloads Library Music Public Speelies mydir
148 amanda-nyrens-macbook-pro:~ Amanda$ cd Desktop/
149 amanda-nyrens-macbook-pro:Desktop Amanda$ ls
150 command.txt git-amanda pystar python
151 amanda-nyrens-macbook-pro:Desktop Amanda$ ls -l
152 total 424
153 -rw-rw-rw- 1 Amanda staff 213063 Jul 27 1999 command.txt
154 drwxr-xr-x 6 Amanda staff 204 Mar 22 16:18 git-amanda
155 drwxr-xr-x 7 Amanda staff 238 Apr 9 09:31 pystar
156 drwxr-xr-x 33 Amanda staff 1122 Apr 9 09:23 python
157 amanda-nyrens-macbook-pro:Desktop Amanda$ cd git-amanda/pystar_amanda/
158 amanda-nyrens-macbook-pro:pystar_amanda Amanda$ ls -a
159 . .. .DS_Store .git README.rst docs utils web
160 amanda-nyrens-macbook-pro:pystar_amanda Amanda$ pwd
161 /Users/Amanda/Desktop/git-amanda/pystar_amanda
162 amanda-nyrens-macbook-pro:pystar_amanda Amanda$ cd ../../../Documents/Thesis/
163 amanda-nyrens-macbook-pro:Thesis Amanda$ ls -lrt
164 total 86920
165 -rwxrwxrwx@ 1 Amanda staff 24576 Oct 4 2005 thesis proposal.doc
166 -rw-r--r--@ 1 Amanda staff 12562780 Feb 15 2006 ES2e-CH18.pdf
167 -rw-rw---- 1 Amanda staff 4197 Mar 8 2006 thesis references-Converted.txt
168 -rw-r--r--@ 1 Amanda staff 3475730 Mar 9 2006 chester_2003.pdf
169 -rw-r--r--@ 1 Amanda staff 908091 Mar 9 2006 evaluating sand and clay models.pdf
170 -rw-r--r--@ 1 Amanda staff 34304 Mar 19 2006 thesis budget.xls
171 -rw-r--r--@ 1 Amanda staff 0 Mar 24 2006 Icon?
172 -rw-r--r--@ 1 Amanda staff 37376 Mar 29 2006 Manuscript preparation WORD.doc
173 -rw-r--r--@ 1 Amanda staff 31744 Mar 29 2006 Remaining Important Dates for Departmental Honors Students 2005-06.doc
174 -rw-r--r--@ 1 Amanda staff 3064448 Apr 9 2006 storti salvini mcclay.pdf
175 -rwxrwxrwx@ 1 Amanda staff 39424 Apr 13 2006 thrust analysis.xls
176 -rw-r--r--@ 1 Amanda staff 9557504 Apr 30 2006 Thesis.doc
177 drwxr-xr-x 38 Amanda staff 1292 Apr 30 2006 Images
178 -rw-r--r--@ 1 Amanda staff 14669824 May 7 2006 thesis.ppt
179 amanda-nyrens-macbook-pro:Thesis Amanda$ pwd
180 /Users/Amanda/Documents/Thesis
181 amanda-nyrens-macbook-pro:Thesis Amanda$</pre>
182 </div>
183 </div>
184 </div>
185
186
187 </div>
188 </div>
189 </div>
190 </div>
191 <div class="sidebar">
192 <h3>Table Of Contents</h3>
193 <ul>
194 <li class="toctree-l1"><a class="reference internal" href="../about.html">About</a></li>
195 <li class="toctree-l1"><a class="reference internal" href="../for_organizers.html">Advice for Organizers</a></li>
196 <li class="toctree-l1"><a class="reference internal" href="../safer_space.html">Safer Space</a></li>
197 <li class="toctree-l1"><a class="reference internal" href="../for_learners.html">Advice for Learners</a></li>
198 <li class="toctree-l1"><a class="reference internal" href="../for_guides.html">Advice for Guides</a></li>
199 <li class="toctree-l1"><a class="reference internal" href="index.html">Badges</a></li>
200 <li class="toctree-l1"><a class="reference internal" href="../setup_machine.html">Setup Your Machine!</a></li>
201 <li class="toctree-l1"><a class="reference internal" href="../schedule.html">Schedule</a></li>
202 <li class="toctree-l1"><a class="reference internal" href="../survey_pre_google.html">Pre-Workshop Assessment</a></li>
203 <li class="toctree-l1"><a class="reference internal" href="../survey_post_google.html">Post-Workshop Assessment</a></li>
204 <li class="toctree-l1"><a class="reference internal" href="../previous_pystars.html">Previous Pystars</a></li>
205 <li class="toctree-l1"><a class="reference internal" href="../sponsors.html">Sponsors</a></li>
206 <li class="toctree-l1"><a class="reference internal" href="../notes_and_tools.html">Notes and Tools</a></li>
207 </ul>
208
209 <h3 style="margin-top: 1.5em;">Twitter</h3>
210 <div id='twitter-area'>[twitter]</div>
211
212
213 <h3 style="margin-top: 1.5em;">Search</h3>
214 <form class="search" action="../search.html" method="get">
215 <input type="text" name="q" size="18" />
216 <input type="submit" value="Go" />
217 <input type="hidden" name="check_keywords" value="yes" />
218 <input type="hidden" name="area" value="default" />
219 </form>
220 <p class="searchtip" style="font-size: 90%">
221 Enter search terms or a module, class or function name.
222 </p>
223
224
225 </div>
226 <div class="clearer"></div>
227 </div>
228 </div>
229
230 <div class="footer-wrapper">
231 <div class="footer">
232 <div class="left">
233 <a href="badge_self_help.html" title="Help Yourself!"
234 >previous</a> |
235 <a href="badge_inthebeginning.html" title="In the Beginning was the Command Line"
236 >next</a>
237 <br/>
238 <a href="../_sources/badges/badge_cmd_nav.txt"
239 rel="nofollow">Show Source</a>
240 </div>
241
242 <div class="right">
243
244 <div class="footer">
245 Last updated on Dec 08, 2011.
246 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
247 </div>
248 </div>
249 <div class="clearer"></div>
250 </div>
251 </div>
252
253 </body>
254 </html>
Something went wrong with that request. Please try again.