UNIX Commands Quick Reference


Desired Action

Command

Get information about a UNIX command

man Command

Get UNIX commands for a given topic

man -k Topic

Create a directory

mkdir DirName

Change working directory to home directory

cd

Change working directory to arbitrary directory

cd DirName

List contents of working directory

ls

List contents of arbitrary directory

ls DirName

List contents of directory in detail

ls -l DirName

List all (hidden) files in directory

ls -a DirName

Remove an empty directory

rmdir DirName

Remove a non-empty directory

rm -r DirName

Remove a file

rm FileName

Rename a file or directory

mv OldName NewName

Move a file to a different directory

mv FileName DirName

Copy a file

cp OriginalName CopyName

Copy a directory and all its subdirectories

cp -r OriginalName CopyName

Clear the screen/window

clear

Record what appears on the screen

script

Edit a file

xemacs FileName

Translate a self-contained Java source program

javac SourceFileName

Run a Java program

java ClassName


Back to the Lab


Back to the Table of Contents

Back to the Introduction


Copyright 2000 by Prentice Hall. All rights reserved.