A brief overview of Unix, tcsh and AFNI
Descriptions, examples, comments, sample commands, syntax and getting help...
Unix is a type of operating system (a standard), first developed in 1969
Examples of Unix operating systems:
Solaris, OpenSolaris, Irix, AIX, HP-UX, OS X, Linux, FreeBSD (actually, Linux and FreeBSD are not formally Unix, but are very similar)
Comments:
- has graphical environment, but strength is in command-line capabilities
- hundreds or more usually thousands of programs come with systems (not just a handful that have screen icons)
A Unix system often has thousands of programs, including:
ls, cat, less, mv, cp, date, ssh, vi, rm
Many characters special meanings on a Unix system, depending on the shell:
variables ($), quotes (', ", `), wildcards (\*, ?, []), pipes (|), redirection (>)
There are many places to get help...
‘man’ is short for manual, the on-line manual for unix commands:
man ls man less man man‘info’ is a newer help system
books, having one that also covers shell programming can be helpful (in our case, the focus is on tcsh rather than bash)
our on-line tutorials
examples with the class data
our message board
asking neighbors
T-shell is a Unix shell: a command-line interpreter
When the user types a command and hits <Enter>, the shell processes that command and decides what to do:
- processes special characters
- decides what program to run, if any
- runs the program, passing along any options and parameters
Examples of similar shell programs:
sh, bash, csh, tcsh, ksh, zsh
Note
regarding tcsh
tcsh has many sub-commands: commands that do not exist on the system, but are just part of the shell, e.g.:
cd, echo, set, setenv, alias, foreach, while, bg, exit, ...
For example, ‘cd’ is not a program, it just tells the shell that you want to be “sitting in a new location”.
Syntax (characters that mean something special):
home directories (~), history (!), jobs (%), redirecting stderr (>&)
Since ‘tcsh’ is just a Unix program, “man tcsh” is one way to get help.:
man tcsh
Again, consider getting a book that covers tcsh.
- AFNI is a suite of data analysis and viewing tools
- well over 500 programs, scripts and plugins
Examples of similar packages (there are many):
- AFNI, FSL, SPM, BrainVoyager
Note
regarding AFNI
afni, suma, 3dcalc, afni_proc.py, 3dDeconvolve
Syntax (characters that mean something special):
- sub-brick selection ([$,..]), range (<>), index ({}), transposition (') - many programs have their own special syntaxNote
The special syntax characters overlap with those of the shell, meaning they need to be hidden from the shell if they are to be passed on to an AFNI program.
Virtually every AFNI program provides help using the -help option, as in these examples:
afni_proc.py -help afni_proc.py -help | less afni_proc.py -h_view
- this output is also available at: help: all AFNI programs
- course material is available at: help: course handouts
- class data is available at: AFNI data packages