<?xml version="1.0" encoding="ISO-8859-1"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:axle="http://www.cs.odu.edu/~zeil/axle" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ns0="http://www.cs.odu.edu/~zeil/axle" mode="ignore" id="typing" ns0:xlinkuri="open/typing.dbk" ns0:xpath="//*[@id='typing']" ns0:page="typing" foo="0 " ns0:last="/cocoon/~cs252/open/typing/quoting.html"><head><title>Typing Unix Commands</title><link type="text/css" href="_axle/docbookstyle.css" rel="stylesheet"/><link type="text/css" href="_axle/cppformat.css" rel="stylesheet"/><link type="text/css" href="_axle/overrides.css" rel="stylesheet"/><script src="_axle/docbook.js"/><link href="http://cocoon.cs.odu.edu:80/cocoon/~cs252/open/typing/paths.html" title="Next" rel="next"/><link href="http://cocoon.cs.odu.edu:80/cocoon/~cs252/open/typing/quoting.html" title="Last" rel="last"/><script>function gotoNext() {top.location.href="/cocoon/~cs252/open/typing/paths.html";}
function gotoPrev() {}
function gotoUp() {}
</script><xhtml:link xmlns:xhtml="http://www.w3.org/1999/xhtml" rel="stylesheet" href="_axle/navigation.css" type="text/css"/><xhtml:script xmlns:xhtml="http://www.w3.org/1999/xhtml" src="_axle/navigation.js"/></head><body><table width="100%" class="navigationBar"><tr class="navigationBar"><td width="5%" class="navigationBar"><a class="navigationBarArrow" title="Next" href="http://cocoon.cs.odu.edu:80/cocoon/~cs252/open/typing/paths.html"><img class="navigationBar" src="_axle/next.gif" alt="Next"/></a></td><td width="5%" class="navigationBar"><a class="navigationBarArrow" title="Last" href="http://cocoon.cs.odu.edu:80/cocoon/~cs252/open/typing/quoting.html"><img class="navigationBar" src="_axle/last.gif" alt="Last"/></a></td><td class="navigationBar"/><td width="5%" class="navigationBar"><a class="navigationBar" title="CS252 Home" href="http://cocoon.cs.odu.edu:80/cocoon/~cs252/directory/announcements.html"><img class="navigationBar" src="_axle/home.gif" alt="CS252 Home"/></a></td><td width="5%" class="navigationBar"><a class="navigationBar" title="discuss this page" href="http://cocoon.cs.odu.edu:80/cocoon/~cs252/forum/getXPath/open/typing/typing.html"><img class="navigationBar" src="_axle/forum.gif" alt="discuss this page"/></a></td></tr></table><br/><div class="info_article"><div class="title_article">Typing Unix Commands</div><div class="author_article"><span class="firstname">Steven</span> <span class="othername" role="mi">J</span> <span class="surname">Zeil</span></div><div class="affiliation">
        <span class="orgname">Old Dominion University</span>
        <span class="orgdiv">Dept. of Computer Science</span>
      </div><table width="100%"><tr><td align="left"><span class="copyright">©<span class="year">2000-2007</span> <span class="holder">Steven J. Zeil, Old Dominion University</span></span></td><td/><td align="right"><span class="date">Jan. 26, 2007</span></td></tr></table></div><div class="TOC">Contents:<div class="TOC-section0"><a href="paths.html#paths">1 Command Arguments</a></div><div class="TOC-section0"><a href="specialChar.html#specialChar">2 Special Characters</a></div><div class="TOC-section0"><a href="cmdpatterns.html#cmdpatterns">3 One Pattern, Many Instances</a></div><div class="TOC-section1"><a href="wildcards.html#wildcards">3.1 Wild Cards</a></div><div class="TOC-section1"><a href="regexp.html#regexp">3.2 Regular Expressions</a></div><div class="TOC-section0"><a href="quoting.html#quoting">4 Quoting</a></div></div>
  
  <div class="epigraph">
    <p class="para" align="center">
              (A printable version of this document is available 
              <a url="allPages.html" href="allPages.html">here</a>.)
            </p>
  </div>
  <p class="para">To run a Unix command (or any program, for that matter), you normally
must type the name of the command/program file followed by any
arguments.  There is actually a program running that accepts your
keystrokes and launches the appropriate program. The program that
reads and interprets your keystrokes is called the <span class="emphasis">shell</span>.
There are many shells available, all of which offer different
features. The default shell for ODU CS is called tcsh, and we'll
concentrate on that.</p>
  <p class="para">The command/program name is usually not given as a full
file name. Instead, certain directories, such as <span class="code">/bin</span>, are
automatically searched for a program of the appropriate name. This set of directories is referred to as your <span class="quote">
      &#8220;execution path&#8221;
    </span>
New accounts are set up so that the directories holding the most commonly used  Unix commands and programs are already in the execution path.<a onmouseover="DBshowBriefly('fn_fref1_live')" name="fn_fref1" id="fn_fref1" class="footnotemark" href="quoting.html#fn_fnote1">1</a><div class="footnote_live" id="fn_fref1_live">You can see your path by giving the command
<div class="programlisting">
echo $PATH
</div>
And you can <a href="../custom/">modify your <span class="code">$PATH</span></a>, if desired, to add additional directories.
</div>
Thus,
one can invoke the <span class="code">ls</span> command as
<div class="screen"><span class="userinput">
   /bin/ls
</span></div>
but it's usually simpler to say
<div class="screen"><span class="userinput">
   ls
</span></div></p>
  <script type="text/javascript">
checkForAnchorOnOtherPage('paths','paths');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref2','paths');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref2_live','paths');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fnote2','paths');
</script>
  <script type="text/javascript">
checkForAnchorOnOtherPage('specialChar','specialChar');
</script>
  <script type="text/javascript">
checkForAnchorOnOtherPage('cmdpatterns','cmdpatterns');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref3','cmdpatterns');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref3_live','cmdpatterns');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('wildcards','wildcards');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref4','wildcards');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref4_live','wildcards');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fnote4','wildcards');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('regexp','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('grepregexps','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref5','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref5_live','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref6','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref6_live','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fnote5','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fnote6','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('sedregexps','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref7','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref7_live','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref8','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref8_live','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fnote7','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fnote8','regexp');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fnote3','regexp');
</script>

  <script type="text/javascript">
checkForAnchorOnOtherPage('quoting','quoting');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref9','quoting');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fref9_live','quoting');
</script><script type="text/javascript">
checkForAnchorOnOtherPage('fn_fnote9','quoting');
</script>
<script type="text/javascript">
checkForAnchorOnOtherPage('fn_fnote1','quoting');
</script><br/><table width="100%" class="navigationBar"><tr class="navigationBar"><td width="5%" class="navigationBar"><a class="navigationBarArrow" title="Next" href="http://cocoon.cs.odu.edu:80/cocoon/~cs252/open/typing/paths.html"><img class="navigationBar" src="_axle/next.gif" alt="Next"/></a></td><td width="5%" class="navigationBar"><a class="navigationBarArrow" title="Last" href="http://cocoon.cs.odu.edu:80/cocoon/~cs252/open/typing/quoting.html"><img class="navigationBar" src="_axle/last.gif" alt="Last"/></a></td><td class="navigationBar"/><td width="5%" class="navigationBar"><a class="navigationBar" title="CS252 Home" href="http://cocoon.cs.odu.edu:80/cocoon/~cs252/directory/announcements.html"><img class="navigationBar" src="_axle/home.gif" alt="CS252 Home"/></a></td><td width="5%" class="navigationBar"><a class="navigationBar" title="discuss this page" href="http://cocoon.cs.odu.edu:80/cocoon/~cs252/forum/getXPath/open/typing/typing.html"><img class="navigationBar" src="_axle/forum.gif" alt="discuss this page"/></a></td></tr></table></body></html>