Math 171 Spring 2005, Lab 1

Due Thursday, January 20 11:59 P.M.

  1. Overview
  2. Using UNIX Commands
  3. UNIX Command Summary
  4. Assignment

Overview

This lab is intended to introduce you to the most commonly used UNIX commands and test your ability to use them. Each command is followed by a description of its purpose and examples of its usage.

Top

Using UNIX commands

Top

UNIX Command Summary

CategoryCommandDescription/Purpose
Command Interpreters (shells)bashThe bourne-again shell
cshC-shell
kshKorn shell
shBourne shell
zshZ-Shell
DocumentationmanUNIX online manual
infoGNU info pages
aproposlookup shell commands
whatisprint command summary
whichdisplays location of commands
Directory Navigationcdchange working directory
pwdprint working directory
lslist file information
File Manipulationcpcopy files
touchcreate or backdate files
mvmove files
rmremove files
mkdirmake directories
rmdirremove directories
lnmake links (shortcuts)
File Access Controlchmodchange file permissions
umaskchange default file permissions
Text Processingcatconcatenate files
morepager
lessalternate pager
diffdisplay differences between two files
grepfind lines in a file matching a regular expression
egrepfind lines in a file matching an extended regular expression
fgrepfind lines in a file matching a fixed string
viprogrammer's text editor
emacsalternate text editor
picosimple text editor
ispellinteractive spell checker
fmtjustifies text
expandconvert tabs to spaces
unexpandconvert spaces to tabs
sortsorts text
Compression/Archivingtararchiving program originally designed for tape drives
gzipGNU zip
gunzipGNU unzip
zipMS-Windows compatible zip
unzipMS-Windows compatible unzip
Process Information/Controlpslist currently running processes
topcontinuously updated list of currently running processes
killend processes
niceset new process priority
reniceset existing process priority
Account Information/Controlchshchange default shell
passwdchange password
whoamidisplay name of current user
System Informationdudisplay disk usage
findfind files
locatefind files quickly
fingerdisplay information about a user
lastdisplay previous logins to this machine
unamedisplay operating system information
whodisplay who is currently logged in to this machine
Network Programslynxconsole-mode web browser
mozillagraphical web browser
wgetautomatic web downloader
pineconsole-mode email client
sshsecure shell (remote logins)
Calculators and Mathematical Packagesmapleconsole-mode interface to the Maple Computer Algebra System (CAS)
xmaplegraphical interface to Maple
matlabinteractive interface to the matlab (MATrix LABratory) linear algebra programming language
latexmathematical type setter
dvipsconverts output of latex to a printable format (postscript)
dcconsole-mode reverse polish notation calculator
bcconsole-mode ordinary calculator
unitsconvert units
Compilers/Software Developmentg77GNU Fortran-77 compiler
ifortIntel Fortran 90/95 compiler
gccGNU C compiler
g++GNU C++ compiler
iccIntel C/C++ compiler
perlPerl scripting language interpreter
pythonPython scripting language interpreter
makeseparate compilation utility (speeds up/automates compiling large software projects)
Miscellaneousechodisplays arguments to standard output
historydisplays recently executed commands
tsetcontrols terminal display settings
resetresets terminal display settings
datedisplays current date and time

Top

Assignment

  1. My home directory contains a subdirectory m171/spring_2005/lab1. Copy this directory and all its contents into your own home directory.
  2. The lab1 directory contains three subdirectories called d1, d2, and d5. You will also see a file called README. Follow the instructions in this file for steps 3-4.
  3. The d2 subdirectory contains a file called instructions2. Follow the instructions in this file for step 6.
  4. Create a new subdirectory called d3 containing a new empty file called empty.
  5. The UNIX online dictionary is contained in the file /usr/share/dict/words. This file contains one word per line. Use these two facts to create a list of all words containing the letters 'gry'. Store this list in the file d4/grylist.
  6. Store a list of all files in the directory /etc in d4/etclist.
  7. Create three identical files called info1, info2, and info3 in the directory d3/subdir. Each of these should contain your username and the name of the operating system you're using, in that order.
  8. Make sure the only subdirectories of your lab1 directory are d1,d2,d3, and d4.
  9. Make sure no one but you can read or execute any of the files contained below your lab1 directory, and document this by generating a list of the names and permissions of all these files. Store this list in d4/permlist.
  10. Save your lab1 directory as a compressed tarfile called lab1.<username>.tar.gz, where <username> is replaced by your UNIX user name. Send me an email with this tarfile as an attachment. You may use either pine or webmail to send this email.

Top

Back to the course information page