Instructor: Doug Riecken (email:
dougrieckenclass@gmail.com
)
This document contains information that should be useful to students
taking classes with me at the SCI at Rutgers University.
Please send your corrections and suggestions
Go to Doug's Home Page
UNIX Commands
This is a quick reference sheet for A Few Good UNIX Commands.
These commands will help you when
working on the scils.rutgers.edu UNIX host. During
this fall class, I will continue to add commands as needed. Should you
wish to add commands, please email me your requests.
UNIX File System Tricks
- pwd(cr) --- present working directory
- ls(cr) --- short listing of current directory
- ls -l(cr) --- long listing of current directory
- ls -a(cr) --- listing of all files, including .file, in current directory
- ls -al(cr) --- long listing of all files in current directory
- ls [pathname](cr) --- short listing of pathname
- ls -l [pathname](cr) --- long listing of current directory
- cd(cr) --- change to user home directory
- cd [pathname](cr) --- change to directory in pathname
- cp [pathname/file] [pathname] --- copy file to directory in 2nd pathname
- mv [pathname/file] [pathname] --- move file to directory in 2nd pathname
- mv [pathname/file] [pathname] --- move can also be used to rename a file
- rm pathname/file --- remove (delete) file
- rmdir pathname --- remove directory
- chmod 755 filename --- set permissions rwx for owner and r-x for everyone else
UNIX Tricks
- hostname(cr) --- print name of UNIX machine (e.g., scils)
- who(cr) --- listing of who is logged into the system
- cat [file or pathname/file](cr) --- dump complete contents of file
onto screen
- more [file or pathname/file](cr) --- dump a screen full of contents
of file then use for next screen full or the (cr) for
next line from file until EOF (end of file)
- grep charString [file](cr) --- find each line in file containing
the charString
- whereis [file](cr) --- try to find pathname location for file
- clear(cr) --- clear the screen
- date(cr) --- print current date
- man [UNIX command](cr) --- print manual page for UNIX command
- echo foo(cr) --- print the contents of foo - foo can be a string
or variable
UNIX User Environment Variables
- echo $PATH --- show all user Environment pathnames to executable programs
- echo $HOME --- show name of user home directory
- echo $TERM --- show user Environment terminal type
UNIX Communication Commands
- finger riecken@scils.rutgers.edu(cr) --- command to find a
person at a given "host"
- telnet scils.rutgers.edu(cr) --- set up terminal session
with $TERM=vt100 at a given "host"
- rlogin scils.rutgers.edu(cr) --- remote login into a given "host"
- ftp scils.rutgers.edu(cr) --- file transport protocol program to
connect 2 "hosts" and transfer files
UNIX ksh Tricks
- (Esc) --- enter history list
- (Esc) --- when in history list escape from history list
- k --- when in history list go back one comment from current
position in list
- j --- when in history list go forward one comment from current
position in list
- (cr) --- when in history list execute current command
- (Esc)(cr) --- escape history list and then execute current command
- /charString --- when in history list find last command containing
charString - note when string has been found then use (Esc) to
exit history list and then use UNIX vi Editor commands
to edit charString
Go to Doug's Home Page