UNIX Quick Reference Sheet: 2.4 Comparing Files
UNIX Quick Reference Sheet: 2.4 Comparing Files
+ add permission
2 File System - remove permission
2.7 Move (or Rename) Files and Directories absolute: List of directory names from root directory to desired file or
mv src-file dest-file rename src-file to dest-file
directory name, each separated by /. Example: /src/shared
mv src-file dest-dir move a file into a directory
mv src-dir dest-dir rename src-dir, or move to dest- relative: List of directory names from working directory to desired file
dir or directory name, each separated by /. Example: Mail/inbox/23
mv -i src dest copy & prompt before overwriting
2.11 Change Working Directory 3.3 Printing (lp & lpr cmds)
cd return to your login (home) directory lpr file print file on default printer
cd dir change to directory dir lpr -Pprinter file print file on printer
lpr -c# file print # copies of file
2.12 Find Name of Current Directory lpr -d file interpret file as a dvi file
pwd display absolute path of working directory lpq show print queue (-Pprinter also valid)
lprm -# remove print request # (listed with lpq)
2.13 Pathnames
simple: One filename or directory name for accessing local file or
directory. Example: foo.c
UNIX Quick Reference Sheet
5 Information on Users
3.4 Redirection finger user or
finger user@machine get information on a user
command > file direct output of command to file finger @machine list users on machine
instead of standard output(screen), who list current users
replacing current contents of file chfn Change finger information
command > > file as above, except output is appendedto
the current contents of file
command < file command receives input from file instead
of standard input (keyboard) 6 Timesavers
cmd1 | cmd2 "pipe" output of cmd1 to input of cmd2
script file log everything displayed on the
terminal to file; end with exit
6.1 Aliases
alias string command abbreviate command to string
3.5 Talk
mesg n sets your account to reject talk
requests
6.2 History: Command Repetition
mesg y sets your account to accept a talk requests Commands may be recalled
(default) History show command history
talk userID initiates a talk request with !num repeat command with history number num
someone who has an account on !str repeat last command beginning with string
the same system str
talk userID@system-name initiates a talk request with !! repeat entire last command line
someone who has an account on a !$ repeat last word of last command line
different system