ucberkeley/moocchat

View on GitHub
turk/UnixCommands.html

Summary

Maintainability
Test Coverage
<!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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Overview of Unix Commands</title><!--
These style should be copied directly from the common CSS.
We include them in the document to make distributing files
easier.
-->


<style type="text/css">
/* --------------------------------------------- */
/*  AWS Developer Content Styles                 */
/* --------------------------------------------- */

body, div, p, td, th {
    font-family : helvetica,sans-serif, arial;
    font-size : 12px;
    color : #000000;
}

a {color:#006699;}

div.faq h2 a {
    color:#CC6600;
  }

.aws-h1, h1{
  font-family: verdana, arial, helvetica, sans-serif;
  font-size: 18px;
  font-weight: bold;
  color: #000000;
}
.aws-h2, h2{
  font-family: verdana, arial, helvetica, sans-serif;
  font-size: 14px;
  color: #c60;
}
.aws-h3, h3{
  font-family: verdana, arial, helvetica, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: #333333;
}

/*table ID selector styles*/
#aws-table {
  border-top: 1px solid #cccccc;
  border-left: 1px solid #cccccc;
  width:95%;
}

#aws-table td{
  font-size: 12px;
  padding: 5px 5px 5px 5px;
  border-bottom: 1px solid #cccccc;
  border-right: 1px solid #cccccc;
  vertical-align:top;
}

#aws-table th {
  font-size: 12px;
  padding: 5px 5px 5px 5px;
  border-bottom: 1px solid #cccccc;
  border-right: 1px solid #cccccc;
  vertical-align:top;
  background-color: #eeeeee;
  color: #333333;
  font-size: 12px;
  font-weight: bold;
  text-align: left;
}

/*code, note, and example styles*/
.programlisting{
  font-family: "Courier New", Courier, mono;
  font-size: 12px;
  margin-top: 5px;
  margin-bottom: 5px;
  color: #000066;
  padding: 5px;
  background-color: #eff7ff;
  border: 1px dashed #333;
  width:75%;
  display:block;
}
.aws-code-inline {
  font-family: "Courier New", Courier, mono;
  font-size: 11px;
}
.aws-note {
  border-top-width: 1px;
  border-right-width: 1px;
  border-bottom-width: 1px;
  border-left-width: 1px;
  border-top-style: solid;
  border-right-style: none;
  border-bottom-style: solid;
  border-left-style: none;
  border-top-color: #CCCCCC;
  border-right-color: #CCCCCC;
  border-bottom-color: #CCCCCC;
  border-left-color: #CCCCCC;
  padding: 10px;
  width:95%;
  margin-left: 20px;
  margin-right: 20px;
}
</style></head><body>
<h1>Overview of Unix Commands</h1>
<p>
Before you use the Command Line Tools in Unix, you should be familiar with using the command line interface in a terminal session. Although you can use the Command Line Tools without using any additional Unix commands, there are some basic commands that might be helpful. The table below describes some of the basic Unix commands. For more information about any of the commands, or to see additional parameters, type:
<span class="programlisting">
man <i>command name</i>
 </span><br/>
 <h2>
Table of Unix Commands </h2>
<table id="aws-table">
  <tbody>
    <tr>
      <th>Command</th>
      <th>Description</th>
    </tr>
     <tr>
      <td>ls</td>
      <td>List the files in the directory</td>
    </tr>
    <tr>
      <td>cd <i>directory name</i></td>
      <td>Change to the specified directory</td>
    </tr>
    <tr>
      <td>mkdir <i>directory name</i></td>
      <td>Create the specified directory</td>
    </tr>
    <tr>
      <td>rmdir <i>directory name</i></td>
      <td>Remove the specified directory</td>
    </tr>
    <tr>
      <td>mv <i>filename [filename]... directory name</i></td>
      <td>Move the specified files to the specified directory</td>
    </tr>
     <tr>
      <td>mv <i>file1 file2</i></td>
      <td>Rename file1 as file2</td>
    </tr>
    <tr>
      <td>mv <i>directory1 directory2</i></td>
      <td>Rename directory1 as directory2</td>
    </tr>
    <tr>
      <td>cp <i>file1 file2</i></td>
      <td>Copy the contents of file1 to file2</td>
    </tr>
    <tr>
      <td>rm <i>filename</i></td>
      <td>Delete the specified file</td>
    </tr>
    <tr>
      <td>diff <i>file1 file2</i></td>
      <td>Compare file1 with file2 and display the differences</td>
    </tr>
    
    <tr>
      <td>more <i>filename</i></td>
      <td>List the contents of the specified file one screen at a time</td>
    </tr>
    <tr>
      <td>CTRL+c</td>
      <td>Stop the current process</td>
    </tr>
    <tr>
      <td>CTRL+s </td>
      <td>Pause screen scrolling</td>
    </tr>
    <tr>
      <td>lpr <i> filename</i></td>
      <td>Print the specified file</td>
    </tr>
    
    
    <tr>
      <td>exit</td>
      <td>End the terminal session</td>
    </tr>
    </tbody>
</table>
<h1>Syntax</h1>
<p>
  The commands (shell scripts) in the Amazon Mechanical Turk Command Line Tools use the Bourne Shell syntax. If you want to write your own commands, be sure to follow this syntax. Some basic elements of the syntax are described in the following table.
</p>
<h2>
Bourne Shell Syntax </h2>
<table id="aws-table">
  <tbody>
    <tr>
      <th>Syntax Item</th>
      <th>Description</th>
      <th>Example</th>
    </tr>
     <tr>
      <td>#</td>
      <td>Specifies a comment. This character can be placed anywhere in the line are is in effect until the end of the line.</td>
      <td># This line is a comment.</td>
    </tr>
    <tr>
      <td>#!/bin/sh</td>
      <td>Specifies the first line of a script</td>
      <td>#!/bin/sh</td>
    </tr>
    <tr>
      <td>echo</td>
      <td>Prints the output to the screen.</td>
      <td>echo "This line will be printed on the screen."</td>
    </tr>
    <tr>
      <td>$1</td>
      <td>Specifies a positional parameter.</td>
      <td>echo $1 $2 $3</td>
    </tr>
    </tbody>
  </table>
</body></html>