. . . . . . . . . ( end of section Typical Unix Commands) <<Contents | End>>
wrk working files
tmp temporary files that can be removed once used
bin binary files and executable scripts
src source code for programs
lib libraries: data for other programs to use
adm Administrative files
etc for unix system data files
misc miscelaneous files
include header files to be included in C & C++ program
News Used by tin and other newreaders
Mail Used by elm for handling mail
mail Used by pine for mail messages
usr Files need by users but owned by the system
u where we put home directories
var various variable administrative and temporary files
sbin shared binaries
share shared directories
mail for mail
local Things we put on the system
spool for things waiting to be processed
echo $TERM
trash files...
. . . . . . . . . ( end of section Syntax) <<Contents | End>>
~dick/bin/prep
~dick/bin/concordance
~dick/bin/textanal
~dick/bin/prep
diction name_of_your_text_file
:w Write this file
:n Next file
:e<file> Edit file
:e# Edit the other file
:e!# Edit the other file and forget my changes to this file
cut "cd<something>
copy "cy<something>
paste "cp pastes after cursor
paste "cP pastes before cursor
.exrc
ex the extended editor that vi is an interface to
rc read commands
!}br word wrap paragraph(CSUSB only)
!Gsort|uniq -c|sort -nr list and count words in file
!4!spell<enter>u spell check 4 lines
!'astats work out statistics...
:!generate_index_file >index.html &
:ab<enter>
. . . . . . . . . ( end of section Syntax) <<Contents | End>>
THis is a program I wrote and installed on most of the UNIXen that I administered -- or just compiled into my local ~/bin directory... Very useful and guarantee'd correct
Shell commands
br
br <infile >outfile
Used inside vi.
!!br word wrap this line
!Gbr word wrap rest of file
1G!Gbr 40 word wrap whole file to 40 characters
~|br[ br.l ] (manual) [ br.l.cat ] (printable manual) [ br.c ] [ brt.c ] (Source code -- K&R C) [ br.c ] (ANSI C) [ br.d.html ] (documentation).
chmod a+rx name_of_file
: comment
command arg1 arg2 arg3 ...
$0 is command
$1 is arg1
$2 is arg2
...
case $# in
0) echo Usage: $0 ..... ; exit 1;;
1) file=$1; do_something_to_file
;;
*) for file; do $0 $file; done ;;[ unix.syntax.html ]
if test -r .profile; then echo .profile exists.; fi
man test
if test $# -eq 3; then echo Command has three arguments; fi
if expr $1 : "-" ; then # first argument starts with a dash.
In vi Command mode :!cal
In vi Input mode <Esc>:!cal
Input it into text while
in vi command mode
on a blank line !!cal
In ex !cal
Sending mail with mailx ~!cal
Reading mail with mailx !cal
On the WWW with Lynx !cal (and then CTRL/D)