Unix for Beginners ____________________________________________________________________________

UNIX for Beginners

Gerard J. Kleywegt Department of Molecular Biology University of Uppsala Uppsala - Sweden

With help from Alwyn Jones, Erling Wikman and Arnold Andersson

Version 1.0 @ 930111 Version 2.0 @ 940116 Latest update @ 9/10/2002 2:20 PM


Unix for Beginners ____________________________________________________________________________

I - Table of contents

Chapter/Section Item _________________________________________________________________ I II II-1 II-2 II-3 III III-1 III-2 IV IV-1 IV-2 IV-3 IV-4 IV-5 IV-6 IV-7 IV-8 IV-9 IV-10 IV-11 IV-12 IV-13 IV-14 IV-15 IV-16 IV-17 IV-18 V V-1 V-2 V-3 VI VI-1 VI-2 VI-3 VI-4 VI-5 VI-6 VI-7 VI-8

Page 2 4 4 4 5 6 6 7 8 8 8 8 8 9 9 9 10 10 10 11 11 12 12 13 13 14 14 16 16 16 17 18 18 18 19 19 19 20 21 21

Table of contents Introduction Literature What is UNIX ? About this guide UNIX versus VMS Commands Miscellaneous Basic concepts Logging in Commands Getting help Control characters Editors I/O streams File system Pathnames Listing directory contents Meta-characters Simple file manipulation Linking files Changing file permissions Manipulating text files I/O redirection History facility Aliases Job control Example files .login .cshrc Other files Example scripts compressor split repeat police forall sln dirtar tardir

Unix for Beginners ____________________________________________________________________________

VII VII-1 VII-2 VII-3 VII-4 VII-5 VII-6 VII-7 VII-8 VII-9 VII-10 VII-11 VII-12 VII-13 VII-14 VII-15 VII-16 VII-17 VII-18 VIII IX

Miscellaneous ftp rlogin/telnet make tar more commands Files versus processes sed sed X-windows programs cut system-dependent Fortran functions and subroutines command-line arguments in Fortran dynamic memory allocation in Fortran saving disk space units w and who factor some more commands Index of Unix commands Inverted index of Unix commands

22 22 22 22 22 22 23 24 24 24 24 24 25 25 25 25 25 26 26 27 30


terminals. Standardisation is.E. files. Nowadays.Training Course”. 4 .“CONVEX UNIX for the Advanced User . After 1975. 1985 (usually found in the Patterson room). on the other hand. System V UNIX is available on most computers but contrary to popular belief. CONVEX Computer Corporation.). UNIX was developed on a PDP-7 by Dennis Ritchie and Ken Thompson at Bell Laboratories in the late 1960s. “UNIX for VMS Users”. more “Macintosh-like”). knowing your operating system(s) well can make life a lot easier for you. .S. easy to change..H. Hayden Book Company. Kochan & P. . 1988 (available on request from Gerard). however. it was first called UNIX in 1970. Fortunately. . OSF/1. An operating system is merely a computer program through which the user interacts with the computer and its components and peripheral devices (processor. the first proceed. Wood.G. Bourne. in skilled hands. Prentice-Hall. on the modern graphics workstations more and more tools become available which make life easier (in this case. etc. 1990 (in Alwyn’s room). separately. Also. Since every computer has one. operating systems are a necessary evil that you have to deal with if you do protein crystallography. being undertaken by the Open Software Foundation (OSF) and. printers. Berkeley. UNIX has evolved into the operating system of choice for most machines (probably because it is cheap for a hardware vendor to adopt it). it supports multiple users and multi-tasking.“CONVEX UNIX for the Beginning User . disks. which means that users in a multi-vendor computer environment no longer have to learn a new operating system whenever they get a new computer (now they only have to familiarise themselves with the system-specific extensions). there is no such thing as a “standard” UNIX version. by Unix International.G. processes. Anderson. Digital Press. but to the novice end-user it is sometimes a nightmare (system-specific extensions. it is very powerful.Unix for Beginners ____________________________________________________________________________ II . CONVEX Computer Corporation. Since the mid-1980s approximately. inconsistent syntax). is running on the new DEC Alpha computers. Although the basic commands are available in most UNIX implementations.Introduction II-1 • Literature: . flexible (i. . “The UNIX C Shell Field Guide”. 1988 (available on request from Gerard).Training Course”. “UNIX Shell Programming”.P. adapt and extend) and contains several powerful utilities. plotters. Englewood Cliffs. UNIX developed along two separate branches leading to Berkeley (BSD) UNIX and System N UNIX (with N currently being V). Anderson & P. UNIX is still very much an operating system for computer jocks (programmers). hardware vendors like to add nonstandard options and ditto commands to tailor their UNIX to their machines. II-2 • What is UNIX ? UNIX is a so-called operating system which nowadays runs on most computer systems.e. UNIX does have some strong points: it is fairly portable. Nevertheless. 1986 (in Erling’s room).

except the Mac (and nobody cares about it). Just about every computer on the market today runs Unix. you see. A UNIX saleslady. This means that not all commands and scripts are necessarily identical or even available if you use other machines ! Novice users who have used VAX-VMS will be interested in chapter III. Bill Joy Making files is easy under the UNIX operating system.Unix for Beginners ____________________________________________________________________________ II-3 • About this guide. A very intelligent turtle Found programming UNIX a hurdle The system. This guide attempts both to help novice UNIX users to get started and to help more experienced users to get more out of their operating system. She found a good way To combine work and play: She sells C shells by the seashore. Lenore. It has been written by a reasonably spoiled SGI/IRIX/C-shell user. System V. more experienced users will probably want to skip sections III and IV. but she likes the beach more.2 administrator's guide 5 . Enjoys work. And that's not saying much for the turtle. Therefore. Ran as slow as did he. It has been said that the only standard thing about all UNIX systems is the message-of-the-day telling users to clean up their files. users tend to create numerous files using large amounts of file space.

dir. ____________________________________________________________________________ VMS command UNIX command description ____________________________________________________________________________ show default pwd show current directory show system ps show current processes show users who OR finger show current users show symbol * alias show symbols/aliases show dev d df show file system sh queue * at -l show batch queues show process ps show my processes ____________________________________________________________________________ set def sys$login cd go to home directory set def [-] cd . options etc..] ls -R list directory tree dir/size/total du disk usage rename f_1 f_2 mv f_1 f_2 rename/move a file/dir.UNIX versus VMS III-1 • Commands: The following is a list of common VAX/VMS commands and their UNIX counterparts. edit type cat list file contents type/page more OR less list file(s) in portions ____________________________________________________________________________ 6 . purge --------------delete older versions set protection chmod change file protection ---------------------chown change ownership ____________________________________________________________________________ append a b cat a >> b append file a to file b diff a b diff a b list differences search a "str" grep str a find "str" in file(s) edit vi OR jot OR emacs OR .. go to parent directory ____________________________________________________________________________ create/dir [..mydir] mkdir mydir create new directory del my. rmdir mydir delete directory copy cp copy delete rm delete file(s) delete/confirm rm -i delete after confirmation dir/size=all/date/prot ls -FartCos extended directory listing dir [. Use the manual pages for more information regarding the precise syntax.Unix for Beginners ____________________________________________________________________________ III ..

DAT refer to the same file under VMS but to different files under UNIX ! 7 .for f77 -c file.1.login (executed when you log in) and .. a file which is called DISK5:[USER.inp on a UNIX system.Unix for Beginners ____________________________________________________________________________ ____________________________________________________________________________ VMS command UNIX command description ____________________________________________________________________________ fortran file. but also that you overwrite a file if you send output to it more than once ! Under VMS you usually have a file LOGIN. TexT. these are replaced by .com. in other words: three files called text.INP.o link run file file execute program @file source file execute command script spawn cmd cmd & spawn a command submit at OR batch submit a job a:=cmd alias a cmd define symbol/alias write sys$output echo write to output device ____________________________________________________________________________ recall/all history show recent commands recall cmd !cmd execute previous cmd ---------------------set history=100 remember last 100 commands help cmd man cmd give help about cmd phone talk exchange messages mail mail OR Mail electronic mail show terminal stty show terminal settings set terminal stty set terminal characteristics backup tar backup file(s) ____________________________________________________________________________ III-2 • Miscellaneous: One of the most important differences between VMS and UNIX is that UNIX does not allow for different versions of the same file (e. File names under UNIX are also different.XPLOR]XPLOR.Dat and TEXT.COM in your home directory which is executed when you log on to the VAX.cshrc (executed whenever you start a C-shell process).2 etc.f compile file link file.dat. login.35 on the VAX might be called /disk5/user/xplor/xplor.com.obj f77 -o X file. under UNIX. for instance. This means that you never have to purge your directories.). on the VAX you may have login.g. Another major difference is the case-sensitivity of UNIX.

user id. it has the syntax man command_name.g. you would enter stty erase ^F). “demo” and “ftp”. Your user name should not contain special characters (such as “/” or “-”) and be unique. often they are single letters preceded by a dash (“-”.Unix for Beginners ____________________________________________________________________________ IV . for example. you will notice that there are several “special” users.Basic concepts IV-1 • Logging in: In order to be able to use a computer. for example. IV-3 • Getting help: The help command under UNIX is called man (for “manual”). he or she can log on to the system and do a lot of damage (deleting your files. provided you separate them with semicolons (“. Change your password regularly (use the command passwd)! Passwords are to be taken extremely seriously ! If anyone obtains a valid username/password combination. The arguments are usually files (sometimes other devices. Please note that some commands mix options and arguments. don’t use your own name. Under UNIX they usually consist of lower-case letters.login file (e.CTRL-h or BACKSPACE to erase the last character . etc. the find command. etc.e.CTRL-w to erase the last word . some use a “+” instead of a “-” or even nothing at all. Also note that sometimes you have to provide “obvious” arguments. IV-2 • Commands: Commands tell the system what to do. to define CTRL-f as the erasecharacter keystroke.CTRL-s to suspend output to the terminal 8 . your cat’s name. minus sign). If you need to continue a command on the next line. you have to log in.”). use the backslash character (“\”) at the end of the first line. Anther useful command: apropos anything (lists all commands which contain the string “anything” in their manual header). which looks for specific files in a directory tree. You may type several commands in a row.. Other useful control characters are: . needs the -print option if you want to see the results on your screen .CTRL-u to erase the whole line You may change these definitions in your . usually several options can be combined and prefixed by a single dash. home directory and default shell-type... your phone number. “root” (system manager). The general syntax is: command [option(s)] [argument(s)].). or installing virus programs) !!! The system file /etc/passwd contains a list of all authorised users with their (encrypted) passwords. The options modify the way a command works. a password and a home directory (all three are provided by the system manager the first time). If you cat (type the contents of) this file.. IV-4 • Control characters: If you make mistakes while you type a command you may use: . for instance. group id. such as a display window or a printer) upon which the command will act. Your password should be long and hard to guess (i. For this you need a user name.

whenever you want output to go down the drain. Under normal circumstances.CTRL-q to resume output . emacs is not available on all machines.CTRL-c to kill the current process . data files. zip. input and (error) output can easily be redirected.Unix for Beginners ____________________________________________________________________________ . As under VMS. xedit (4) stream editors (will edit files for you using a command script): awk. ex (2) full-screen editors (soon obsolete ?): vi. it is the user’s initial working directory when he or she logs in. sed Note that jot and zip only run on SGIs. redirect it to this “file”). under UNIX it is possible to “pipe” the output from one command or program straight into another one (this will be discussed later). etc (system files). tmp. a file is a sequence of bytes of raw data. physical devices and communication channels (there even exists a “non-file”: /dev/null . for “foreground” to resume it) . standard input is expected from the keyboard and both standard output and standard error are associated with the terminal screen. text files. in addition. On a system disk. IV-8 • Pathnames: 9 . Files may therefore be executable programs. emacs (3) window-based editors (Macintosh-like): jot. but also directory files. lib (libraries) and usr. sed and awk are very powerful tools (they make a lot of “jiffy” programs obsolete) ! IV-6 • I/O streams: There are three I/O streams associated with UNIX (see table). I/O stream stdin stdout stderr VMS-equivalent sys$input sys$output sys$error C unit 0 1 2 Fortran unit 5 6 6 default keyboard terminal terminal IV-7 • File system: UNIX organises information into files.CTRL-o to discard output to the terminal . The home directory usually has the same name as the username. in general. Files are organised hierarchically in a so-called directory tree.CTRL-z to suspend the current process (type fg. The usr directory in turn contains the home directories of the users of the machines (and their subdirectories). this directory typically contains subdirectories such as bin (UNIX commands). Files are more than just collections of characters sitting on disks. at the top is the “root directory” / (a single slash).CTRL-d to log out IV-5 • Editors: There are four types of editors under UNIX: (1) line editors (obsolete): ed. xedit is available on most machines running Xwindows.

e. other users in the same group and anyone else (in that order): “r” means read permission. the options you provide determine how much information is displayed (my favourite on SGIs is: ls -FartCos)... ls file[135].g. These meta-characters may be used with nearly all UNIX commands. (2) “?” . The number (1) is the number of names that are linked to the file (default is 1./bubba/xplor/xplor.g. The next nine characters show the permissions (in three groups of three) of the user.inp. (3) “[]” . a file “xplor.f will list file1.. if the file is linked to other files this number will be higher). except for periods and underscores. so “test” and “TEST” are two different files ! Try to avoid special characters (such as: / \ | ‘ “ ? $ # . Bubba himself could also use ~/xplor/xplor.f and so on.inp (a single “~” refers to one’s own home directory).” refers to the parent directory) and users on other disks might use either /nfs/taj/bubba/xplor/xplor. one which is defined starting in the root directory) is called an absolute pathname. file1. Another user in his home directory on the same disk might use: . “c” character device. they are case-sensitive. the “~bubba” means: Bubba’s home directory. Filenames may contain up to 256 characters. or a range of characters separated by a dash.matches any single character. file3. 2.f and file5. A typical entry in a directory listing may look as follows: -rwxr-xr-1 bubba 17632 Apr 1 23:59 xplode* The first character indicates the file type.f.inp or ~bubba/xplor/xplor. “l” symbolic link or “s” socket.f etc. this will display for example: /nfs/taj/bubba if your username is “bubba” and you work in Alwyn’s group.. This is followed by the username of the owner of the file (bubba) and the size of the file in bytes (17632).. filexyz. ~ .f. For example. but not file2.f will list all Fortran source files in the current directory and all of its sub-directories. file2. The “*” after the file line is produced by the -F option of the ls command and indicates that this is an executable file (program or script).e. ls [A-Z1-4]*.f will list all Fortran files whose name begin either with an uppercase letter or with 1.f etc. The date and time when the file was last modified are also listed as is the actual name of the file (xplode). ls file?.within the brackets you may put a list of ASCII characters which are considered to match.f. “b” block device. it may be: “-” ordinary file. To see the complete pathname of your current directory.f.g.f will list file0.matches any number of characters. You may also use relative pathnames.).inp” in Bubba’s subdirectory “xplor” may be referred to as xplor/xplor. IV-10 • Meta-characters: You may use several meta-characters (wildcards) in filenames: (1) “*” . e. A pathname which begins with a slash (i.. 3 or 4. IV-9 • Listing directory contents: The ls (list) command lists the contents of a directory. they are given relative to your current directory.inp when Bubba is in his home directory. but not file10. “d” directory.f. not just with ls ! 10 .inp (the “.! @ % & etc.Unix for Beginners ____________________________________________________________________________ The complete name of a directory (or file) is called its pathname. whereas a “-” means that the corresponding permission has not been granted. the -F option will also put a “/” after directory files and an “@” after linked files.. use pwd (print working directory). ls */*. e.. “w” write permission and “x” (sometimes “s”) execute permission.

whenever you edit any of the linked files the changes are made to all the files “lab_notes” since in reality they all correspond to one single file somewhere on the disk.Unix for Beginners ____________________________________________________________________________ IV-11 • Simple file manipulation: You may copy a file with the command: cp oldfile newfile. use cp -r dir1 dir2. If you want be prompted and asked if you really. the second argument should be the name of the target directory (i.. use the cd command. this string is substituted whenever the name of the linked file appears in a pathname. you could create it in your home directory and later make links from all your subdirectories (you may give the linked files different names if you like)./notes/xplor. If you want to copy a file to another directory. If you want to copy a file from another directory to your current directory. If you want to move or rename a file. The link file really only contains a text string (the pathname of the file to which it is linked).out . To create a new directory. however: the second method recursively deletes all sub-directories and their files as well ! IV-12 • Linking files: A hard link allows you to assign multiple names to a single file (usually both files have to be on the same disk). use the command: mv oldfilename newfilename. rm oldfilename. Another useful example (if you use the scratch disk a lot): ln -s /nfs/scratch/bubba scr (now it will seem as if /nfs/scratch/bubba is a sub-directory called scr of your current directory).out to the sister directory “notes”./joey etc. this will make an exact duplicate of oldfile.. use: mkdir newdir.out . The syntax is: ln existing_file link_file (note: if you swap the arguments you will effectively delete the existing_file !!!). There is one difference.. It establishes another pathname to an existing file. Now. rmdir mydir or rm -r mydir. these can be made across disks and even to disks attached to computers which are physically quite far apart (so you could link a file in Stockholm to one in Uppsala).. examples: cd xplor/old.f etc. A familiar example: ln -s /nfs/taj/alwyn/o/data odat (note the “-s” which makes this a soft link and please note the order of the arguments: existing file first !). if newfile existed it will be overwritten (the -i option prevents this).. A directory which contains files can be removed completely in two ways: rm mydir/* . cd ~billybob/mail. If you want to copy a directory structure. use either the absolute pathname of your current directory or simply a dot (“. cd . Use the -i option to prevent files from being overwritten. this always means “current directory”): cp . otherwise it will be created.”./. not of the new file !): cp xplor.e. To change directories. For example. if you want to be able to edit a file “lab_notes” in all of your directories. A file can be removed with the command: rm myfile. this is equivalent to: cp oldfilename newfilename . use the -i option: rm -i file?. really want to remove a file. IV-13 • Changing file permissions: 11 ./notes will copy the file xplor. A better way of linking is through so-called soft links.

one for u. The “permission_bits” is a set of three digits between 0 and 7.Unix for Beginners ____________________________________________________________________________ File permissions (read.sort filename : sorts a file alphabetically or numerically. the filename and page numbers. write permission 2. o (others) or a (all three classes) .exe will give the owner rwx-permission (4+2+1=7) and all other users rx-permission (4+1=5). execute permission 1 and no permission 0.g. the process goes into an endless loop printing everything that is added to the file to your screen (use this to monitor your XPLOR jobs. . this is a window-mouse-based implementation of diff). chmod a+x file2. use the chown command. write.operator = + (add). use in conjunction with pr to get a nice listing including a header.head filename : print the first 10 lines of a file (use: head -5 filename to see just the first five lines. the same is true for script files and program executables. IV-14 • Manipulating text files: The following commands are often used for manipulating text files: . chmod o-wx file3 etc. This can be used in two different ways.permission = r (read) and/or w (write) and/or x (execute) Examples: chmod g=rx file1. execute permission) can be altered with the chmod command. etc. use the commands lpq to list current print jobs and lprm to remove them.f | lpr -P2up 12 .: pr -h “Source” -l80 prog.who = u (user). words and characters in a file .lpr -Pprinter filename : print a file on the printer (in our lab: “printer” would be “qms” or “2up” etc. if you use the option -f.).cmp file1 file2 : tells you whether or not two files are identical . g (group). for example.cat filename : type the contents of the file on the screen . but paginated (type a SPACE to see the next page or a “q” to quit. you may use the option -5 or -123 similar to head. for example: chmod 755 xplor. g and o.wc filename : print the number of lines. If you want to change the ownership of a file. where: .tail filename : print the last 10 line of a file.more filename : ditto. Read permission has been assigned the value 4.diff file1 file2 : finds differences between two files (on SGIs use /usr/sbin/gdiff.(remove) or = (assign permission(s)) . the files will be merged and then sorted .grep string filename : list all occurrences of “string” in file “filename”. use the -i option to ignore uppercase-lowercase differences . Also note that you may prevent a file from being overwritten or deleted by giving yourself no write permission. The second syntax involves octal protection indicators: chmod permission_bits filename(s). some versions of UNIX offer the command less as well with which you can go back and forth in a file) . use the -s or -r option to compare two directories . the appropriate permission_bits are found by adding the values of the granted permissions. The easiest one has the syntax: chmod who operator permission filename(s). if you provide several filenames. terminate with CTRL-c) . e.) . Note that directories are only accessible if you have read and execute permission.

unless you put the statement noclobber in your . You may also extend previous commands. For example.cshrc file (then you may only overwrite files by using “>!” instead of “>”). use “>&” or “>>&”. to list the CA-atoms of all alanyl residues. use: grep ALA file.). If you also want to pipe the standard error output.omacro stop end-of-input Of course. To redirect standard input from a file.out and so on. you may type !! -a /usr | more which will result in the execution of ls -l -a /usr | more ! You may also “recycle” parts of previous command lines (for instance. use: grep “ CA “ file.o << end-of-input yes (use display) @lsq. Another way of I/O redirection is the use of “pipes”: a pipe causes the standard output of one command to be transferred into the standard input of another command. for example if the previous command was ls -l. !l repeats the most recent command beginning with the letter “l”..com >>& all_trans. !-4 goes back four commands and !?s? repeats the most recent command that contained the letter “s”. !142 repeats command number 142 (in the list produced by history). To re-execute a previous command. A more useful example: to count the number of amino acids in a PDB file. Example: to append file2 to file 1. use “>>”. use “!”: !! repeats the previous command. you may use “<< string” to indicate that everything that follows on standard input until the line which contains only “string” is to be used as input. or who | sort | more. use “|&” instead of “|”.pdb | wc -l. the number of commands that is saved can be set as follows: set history=100 (you may want to put this into your . then the command plus its options are called :0. IV-16 • History facility: The csh-command history lists previously issued commands (use “-8” to get just the previous eight commands). the second file name :2 and the last file name :3 or $. For example: 4d_ono crap. while all files collectively may be referred to by *.inp. If you mistyped a command. The syntax to do this is: command > outfile. you may use combinations of input and output redirection: xplor < trafun. use: command < inputfile. type who | wc -l.cshrc file). The following table gives some of the possible history references for this command: 13 . for instance: xplor < xplor. If you also want to redirect the standard error output to the same file. long file names). if command number 5 in the history list was ls -al file1 file2 file3. to find out how many users are logged in. If you want to append the output to an existing file. if you typed: who|sort|moer. the first file name is :1 or ^. type ^er^re next and the correct command who|sort|more is executed. type who | sort..pdb | grep “ CA “. for example. Alternatively. The syntax is: command1 | command2.Unix for Beginners ____________________________________________________________________________ IV-15 • I/O redirection: Often it is handy to redirect the output of a command or program to a file (or a printer or . This will overwrite “outfile” if it existed already. use: cat file2 >> file1. for example. The C-shell divides each command in separate “words” delimited by spaces or tabs. you may use: ^wrong^correct to correct the typo and execute the command. to get a sorted list of logged in users.

The command also allows you to rename or abbreviate commands. if the previous command was ls -l *. Should you at some stage want to use the original rm command without the -i option. To stop a job running in the background. the shell prompts for a new command without waiting for the command to complete.old. IV-18 • Job control: A command may be executed in either the foreground or the background. for example: !!:s^old^new. An alias may contain more than one command. the new command will be ls -l *. use kill %2. [2] etc. \rm does the same. Background jobs may never read from the terminal (they will be stopped if they try to) but they may write to it (this can be switched off by stty tostop).out” will be displayed on your terminal. If there are more than one.in >& x. 14 . /bin/rm executes the rm program itself without any option.. The job will receive a background job number ([1]. The command jobs gives you a list of background jobs initiated at your terminal. who | sort’. type %3 (to start job number 3). type !! to execute it. IV-17 • Aliases: The csh-command alias lists all defined aliases. use \!* (there is actually some perverted logic behind this .new. type :p immediately after the event identifier: !!:p:s^old^new.in >& x.) at the position of the argument: alias ala ‘grep ALA \!* | grep CA | wc -l’. When it is completed. Foreground jobs may read from and write to the terminal and the shell will wait until a command is finished before prompting the user for a new command. If you want to create aliases for commands which require an argument (usually. use stop %5. for example: alias status ‘date .out &.pdb the result will be the number of alanyl residues in that file. A job which was started in the foreground can be stopped with CTRL-z and then be continued in either the background (command bg) or the foreground (fg). In order to execute a command in the background put an ampersand (&) after the command: xplor < x. if it is correct. then you have the following options: unalias rm removes the alias. a message like “[2] Done xplor < x. To verify that the edited command is correct. the one labelled “+” will be started if you type fg. for example: alias rm ‘rm -i’ will mean that every time you type rm you actually execute rm -i. a filename).Unix for Beginners ____________________________________________________________________________ You type: !5 more !5:2-3 cat !5:$ more !5^ lpr !5:2 lpr !5* What is executed: ls -al file1 file2 file3 more file2 file3 cat file3 more file1 lpr file2 lpr file1 file2 file3 You may also modify previous commands. to terminate it completely..) and a process ID. if you want to start another one in the foreground. now if you type ala file.

submit it with the nohup command (no hang-up): nohup xplor. etc. for example: kill -9 1734. will be killed when you log out ! Use nice and renice to run background jobs with lower priority (so your big calculations are not in the way of interactive users). The kill command can also be used to terminate or interrupt processes by referring to their PID (process id. all your processes. these are listed by the ps command). kill -CONT 182. If you start a job in the background and you plan to log out before it is finished. type: ps -ef | grep -i xplor). if you want to know if anybody else is already running XPLOR on an SGI before submitting your own XPLOR job. including your XPLOR job. use the ps command (for example. if you don’t do this.Unix for Beginners ____________________________________________________________________________ To get information about your (and other people’s) processes. kill STOP 182.com &. 15 .

umask 022 eval `tset -s -Q` stty line 1 erase '^H' kill '^U' intr '^C' echoe V-2 • .older .f./' alias left 'cd . # set path = (.15 -t"new shell"' alias ftp 'ftp -i' alias diff 'diff -lsbwit' alias comp 'compress -v' alias unco 'uncompress -v' alias note 'cat ~/stuff/notes | grep \!*' alias down 'cd \!*' alias up 'cd . ~ ~/bin /usr/bsd /bin /usr/bin /usr/bin/X11 /usr/sbin /usr/demos /usr/demos/bin /usr/etc /usr/local/bin /usr/bin/dn /usr/ucb /nfs/taj/alwyn/o/bin /usr/people/alwyn/a/bin /nfs/vega/people/alwyn/a/bin /nfs/public/IRIX/bin /usr/new /user/bin /user2/bin) limit coredumpsize 0 source /nfs/public/IRIX/ccp4/include/ccp4.a .setup >& /dev/null set autologout=240 set ignoreeof set history=100 set savehist=250 set filec set fignore = (..o .Unix for Beginners ____________________________________________________________________________ V . I prefer to keep all my settings in the . note that this particular one is tailored to SGI’s IRIX../\!* ' alias home 'cd' alias dir ls alias dsd 'ls -laF \!* | sort' alias dsds 'ls \!* | grep "`date | cut -c5-10`"' alias ls '\ls -FartCos' alias l '\ls -Cal' alias lc '\ls -C' alias lss '\ls -FartCos \!* | sort' alias fint 'find * -print | grep \!*' alias sus 'who -a' alias sss 'ps -ef | sort' alias time '/bin/time' alias h 'history' alias h5 'history | tail -5' alias hg 'history | grep \!*' alias hg5 'history | grep \!* | tail -5' alias grep 'grep -i' 16 .login: I recommend that you keep it to an absolute minimum.oldest) set notify set time=5 set prompt = " > " alias newsh 'wsh -s40x80 -f Screen.cshrc: The following are fragments of my .f.cshrc file..f. .old .Example files V-1 • .old .cshrc file.

your name and address. head $x .uu.Xdefaults. ESV.project . echo head $x .sgisession. tail $x' alias xterm 'xterm -sb' alias show 'ps -ef | grep $user | grep -i \!*' V-3 • Other files: Some other files in your home directory might be: . ALPHA/OSF1 alias f77sgi '/bin/time f77 -Olimit 3000 -v -check_bounds -u -w0 -c' alias f77esv '/bin/time f77 -Olimit 3000 -v -check_bounds -u -c' alias f77al '/bin/time f77 -Olimit 3000 -C -O -u -v -c' # head AND tail a file alias ht 'set x=\!* .setenv|grep -i display' # a quick way to set your terminal to VT100 alias vt100 'setenv TERM vt100 . Examples of all these types of files can be found in (and copied from) /nfs/public/shell. there may be window-manager specific files such as .bmc.echo tail $x . will be appended to every mail you send .se:0.4Dwm.setenv DISPLAY $x. .bmc. 17 . .se alias disp 'set x=\!* .uu. and/or .csh-script which is executed when you log out .logout .signature . for example.Unix for Beginners ____________________________________________________________________________ alias count 'grep -c' alias help man alias ta 'tail -100' alias he 'head -100' alias lo logout alias du 'du -rk' alias grand '\du -sk *' alias df 'df -k' alias s source alias rm 'rm -i' alias dorm '\rm' alias del 'rm' # disp alien will set the environment variable DISPLAY to alien.plan and .used by the finger command In addition. setenv | grep -i term' # Fortran compilation for SGI.chestrc.

. cp $file fsplit fsplit fsplit/$file \rm fsplit/$file end exit 0 endif echo ERROR . -f.).e..gj kleywegt @ 920311 if (-e fsplit) then set sources=*.c => specifies minimum file size in bytes # -type f => only look for files (i.no subdirectory called "fsplit" here .. => command to be executed for each "hit" (compress -v or ls) set echo find /nfs/taj \( -name '*...o' \) -size +20000c -type f atime +2 -exec compress -v {} \.. not links or directories) # -atime +2 => only use files which haven't been accessed in two days # -exec . splitting $file . # compressor . => specify file names (-o is "OR-function") # -size ..f) to a subdirectory called fsplit (must exist). in a given directory.Unix for Beginners ____________________________________________________________________________ VI . # split .. => search there (/ => entire file system) # -name . exit -2 18 . exit -1 endif foreach file ($sources) echo . while.Example scripts The following script files can be copied from /nfs/public/shell. VI-1 • compressor: This script can be used to automatically find and compress large map files (or it can easily be changed to find and act on other files).f files in this directory . Consult the manual pages of the find command for an explanation of all possible options. $#argv etc.. -e. foreach. Note the uses of the set command.map' -o -name '*. do an fsplit and remove the original sources (beware of filename duplications !).f set numfiles=$#sources echo Split $numfiles sources if ($numfiles == 0) then echo ERROR . copy all Fortran files (.. unset echo VI-2 • split: This script will. For more information on shellspecific constructs (if. consult the manual pages for the csh command......no . gerard kleywegt @ 920318 # find /.

. if there are any (and if they’re not owned by root). I am going to sleep a little .. # forall file_id command ..f' tail -20 and forall '*... In order to circumvent this problem.gj kleywegt . This version of the script can only be executed by root. # police .renice long-running non-root processes regularly # activate with: nohup /nfs/taj/police >& /dev/null & while (2 > 1) set allproc=`ps -ef | cut -c9-15 | sort` foreach proc ($allproc) if ($proc == "PID") then else set root=`ps -lf -p $proc | grep root | wc -l` if ($root == 0) then set nice=`ps -lf -p $proc | grep $proc | cut -c33-34` set cput=`ps -lf -p $proc | grep $proc | cut -c74-76` if ($cput > 60) then if ($nice < 39) then /etc/renice +19 $proc endif endif endif endif end sleep 600 end VI-5 • forall: Some UNIX commands (such as tail and lpr) do not allow for wildcards in the filename specifications.Unix for Beginners ____________________________________________________________________________ VI-3 • repeat: This script will execute a given command repeatedly at regular time intervals (using the sleep command). arg7 exit endif set echo while ($#argv > 1) $2 $3 $4 $5 $6 $7 $8 $9 echo ". the following script takes a file description containing multiple arguments or wildcards and a command and will execute the command for each of the files.gj kleywegt @ 911025 if ($#argv < 2) then echo usage: repeat sleep_seconds command arg1 arg2 arg3 .. Examples: forall '*.gj kleywegt @ 920803/920917 if ($#argv < 2) then 19 .ps' lpr -Pqms. they will be reniced. # repeat ." sleep $1 end exit VI-4 • police: This script will check every ten minutes whether there are processes which have consumed more than 60 minutes of CPU-time and still do not have the highest nice-value.

existing file : " $exist echo " . arg6]" echo exit 1 endif set sour=$1 set comm="$2 $3 $4 $5 $6 $7 $8" echo "===> FORALL (" $sour ") DO " $comm foreach file ($sour) echo $comm $file $comm $file end echo "Done .overwrite (Y/N) ???" set answer=$< if ($answer == "y") then \ln -s $exist $linkf \ls -FartCos $linkf endif else \ln -s $exist $linkf \ls -FartCos $linkf endif else echo "ERROR . In order to prevent you from accidentally erasing files by swapping the arguments to ln -s.Unix for Beginners ____________________________________________________________________________ echo echo "usage: forall file_id command [arg1 . try : sln " $linkf $exist endif endif 20 ." echo " . you should put the following in your .file does not exist" if (-f $linkf) then \ls -FartCos $linkf echo " .but the link file DOES ." exit 0 VI-6 • sln: This script is a safe soft-linker...a SAFE soft linker .link file : " $linkf if (-f $exist) then \ls -FartCos $exist if (-f $linkf) then \ls -FartCos $linkf echo "WARNING . it checks if the first file actually exists.if so.link file exists ..Gerard Kleijwegt @ 920812 if ($#argv < 2) then echo echo "usage: sln existing_file link_file" echo exit 1 endif set exist=$1 set linkf=$2 echo "sln . If you put this script in your private /bin directory. # sln .maybe you swapped the arguments ???" echo " ...cshrc file: alias ln 'echo USE ~/bin/sln INSTEAD OF ln'..

. uncompressing $1 ...... this is most efficiently done by first using tar to archive all files into one archive file. tarring $1 .Z echo . compressing $1. compressing the resulting archive file and deleting the original directory (tree). \ls -FartCos $1. # dirtar ..Unix for Beginners ____________________________________________________________________________ VI-7 • dirtar: If you want to archive or ftp a whole directory (tree)..dirtar \rm $1.$1 > $1.dirtar tar xovpf $1.dirtar..dirtar. tar cvqqqf .Z uncompress -v $1... untarring $1 .dirtar \ls -FartCos $1.gj kleijwegt @ 920803/921029 if ($#argv < 1) then echo echo "usage: tardir dir_name" echo exit 1 endif set dirnam=$1 echo .. \ls -FartCos $1..dirtar...dirtar \ls -FartCos $1 exit 0 21 ..dirtar .dirtar echo .dirtar \rm -r $1 \ls -FartCos $1.Z exit 0 VI-8 • tardir: This script takes an output file from the previous script and restores the original directory (tree). compress -v $1. This script does the work for you. # tardir .gj kleijwegt @ 920803/921029 if ($#argv < 1) then echo echo "usage: dirtar dir_name" echo exit 1 endif set dirnam=$1 echo .

use either rlogin (remote login. you may also use rcp (remote copy) or uucp (UNIX-to-UNIX copy). ASCII file dump banner text_up_to_10_chars : prints large text on stdout 22 . a VAX) to another.Unix for Beginners ____________________________________________________________________________ VII .g. a VAX or another UNIX machine).g. and only that subroutine will be compiled and all object files and libraries will be linked together. decimal. etc.bmc. To copy files to tape. VII-4 • tar: If you want to copy files to tape.Miscellaneous VII-1 • ftp: File-transfer protocol. followed by the name of the host computer. The idea is that you define a dependency-tree (the executable depends on the object files and libraries. If you copy from one UNIX machine to another. all you have to do is type make executable_name. use something like tar cv ~bubba >& ~bubba/tarlist. Use something like: ftp -i xray. each object file depends on a Fortran file plus one or more include files. use tar xovp (filename). hex.login file if you go to a UNIX machine) or telnet.) : different versions of grep : split Fortran file into one file per routine : compile and link a Fortran file : compile and link a C file : archive and library maintenance : clear terminal screen : list information about a user : octal. to restore files.se if you want to copy files from XRAY to an SGI or ESV. will not execute the . changes date-last-changed : show allocated memory : show limits (memory etc.) in a “makefile”. make is an excellent utility for you. If you have edited one subroutine file. VII-3 • make: If you have many or large programs to maintain. VII-5 • more commands: file filenames date factor integer fold -75 file > newfile last -5 gerard strip file touch file alloc limit (-h) egrep/fgrep fsplit file f77 options files cc options files ar clear finger username od file : list the types of the filenames : print current time and date : print prime factors of an integer : fold long lines : print last 5 sessions of user "gerard" : strip an executable of unused routines : “touches” a file. can be used to copy files from one computer (e. VII-2 • rlogin/telnet: If you want to log on to another computer (e.uu. you may use the tar command (tape archiver).

the effect will be the same as in (2) (5) modify the file xplor.com which contains the line “xplor < xplor. Each process has an “environment” which it inherits from its parent process. it doesn’t matter whether or not you execute or spawn the file. arbitrary text or data. XPLOR will be run (in the directory /home/user/xplor) and when it is finished. the effect will be the same as in (1) (4) now type “xplor. Each type of shell offers an additional set of commands.inp”: a sub-process will be created which inherits the characteristics of the parent (i. except that the process will now be spawned.com”.g. unless the subprocess is run in a batch queue or spawned. An example may help to clarify these concepts: suppose that you are in directory /home/user/xplor and you want run XPLOR with an input file called xplor.. UNIX provides command line interpreters (comparable to VAX/DCL) which are called shells. control will be returned to your terminal.inp & 23 . but there are others (e.inp”.e.inp &”: this does the same.inp &”. Fortran or C instructions (program files).com so that it contains the lines: # script for running xplor xplor < xplor. your terminal session)..com &”. the XPLOR process will be run as a separate process and you will be able to continue to work in your terminal session while XPLOR is running.Unix for Beginners ____________________________________________________________________________ cal cron mail/Mail sort stty talk time which/whereis paste setenv printenv df dd : print calendar : execute commands at a specified date/time : send and read mail : sort or merge files : set or list terminal characteristics : talk to another user (like phone on the VAX) : time a command : locate a program or script : list two or more file side-by-side : set environmental variables : list environmental variables : show disk usage : file conversion VII-6 • Files versus processes: Files contain static information such as operating system commands (script files). the Bourne shell and the Korn shell). Processes do the actual work. in general they execute programs (for example. (2) type “xplor < xplor. You will probably use the standard C-shell (csh). the parent process waits until it is finished. (3) create a file xplor.inp. You then have the following options: (1) type “xplor < xplor. in this case. in both cases control will be returned to the terminal almost immediately (6) modify xplor. Whenever a sub-process is started. a UNIX command or a program of your own or a CCP4 program).com to read “xplor < xplor. change its protection to make it executable (chmod) and execute it by typing “xplor. In addition. in other words.

text editor.font display. for example: tty | cut -c1-9 gives: "/dev/ttyq" VII-11 • system-dependent Fortran functions and subroutines: . rather than execute it. xfd . put the string 'draw ' in front of each of them and put them in a file: \ls -c m24_cav*.call itime (real(3)) => array contains hrs.f.calculator. xcalendar calendar & time management VII-10 • use cut to grab certain columns or fields of a stream. get all files named m24_cav*. VII-8 • sed stream editor.dt = dtime (real(2)) => ditto. they will put you in a different directory and (re)define certain symbols ! This is the reason why. you have to insert a line “cd xplor” between the two lines. In order to get the script to work.o | sed -e s/"m"/"draw m"/g > odraw.iday.mac. for example: sed -e s/random/rannew/g conezd.sec . but increments since last call to dtime . execute the .o. xterm . xman .window dump (redisplay with xwud). VII-7 • generating files with instructions for all files of a certain kind: for example.min. The resulting file can be executed by O immediately. xwd . if you have cd and set statements in the script. xmag . etime(.val) => returns value of env var NAM in VAL (both str*) .f > new.script test. VII-9 • X-windows programs (on SGIs at least): xedit . 24 .guess what.inp does not exist in your home directory. Hence.et = etime (real(2)) => real(1)=elapsed user time.iyear) . This means that the process will start in your home directory (/home/user).com > new. you should always source the new . xload show cpu load.)=sum of these two . xcalc . with its own environment (directories etc.cshrc file.call getenv (nam. except that any statements executed in the sub-shell will also affect your own shell.call idate (imon.call fdate (str24) => flushes buffer of output unit IUNIT => returns date and time real(2)=elapsed system time.magnify a part of the screen.Unix for Beginners ____________________________________________________________________________ If you execute this “script” you will find that it doesn’t work. (7) source the modified script file. xclock .terminal window. xfig "MacDraw/MacPaint" (use f2ps to get PostScript). This will fail since the file xplor.i = mclock() => returns time accounting info . now the same will happen as in (6).call getlog (str*) => returns user's login name .man pages.cshrc file (this can be avoided by starting the script file with “#!/bin/csh -f” instead of with “#”) and then try to run XPLOR.com or (using a script file) sed -f sed. This is because the “#” on the first line means that you want the child process to run in a separate C-shell.).call flush (iunit) .cshrc file. if you have altered your ..

i = ierrno() . so 134 is invalid since 134 = 2 * 67 and 67 > 19. use the factor command...i = alarm(nsecs.narg = iargc () ..call perror (str*) .. Use zcat to look at the contents of compressed text files without uncompressing them.str* = ttynam(iunit) => returns name of tty (or blanks) .nbytes .g...: nl myfile | more 25 .Unix for Beginners ____________________________________________________________________________ . This is very useful when you are trying to find grids for CCP4 programs ! CCP4 does not allow you to have grids which contain a factor > 19. The new file will have “. nbytes = 4*nvars iptr = malloc(nbytes) . e. arr) dimension arr(1) integer malloc.logi = isatty(iunit) => true if iunit is a tty .call getarg (iarg. call free(iptr) VII-14 • saving disk space: use compress (and uncompress) to reduce the amount of disk space occupied by large.) . stime. handy in combination with cat/zcat/more.call system(str*) => execute str* as a sh-command . 132 (2*2*3*11) and 136 (2*2*2*17) would both be okay VII-18 • some more commands: bc .arbitrary-precision arithmetic language nl .g. infrequently used files.Z” appended to its name. VII-16 • the commands w and who tell you who is logged in on your machine VII-17 • to find the factorisation of an integer number. str*) VII-13 • dynamic memory allocation in Fortran: pointer (iptr.extproc) => call external procedure after VII-12 • command-line arguments in Fortran: . kg to/from lbs.adds line numbers.call gerror (str*) .time. gmtime => see man pages . VII-15 • use the units command to convert between different units. ctime.call qsort (.call sleep (nsecs) => print str* and last detected error's message to stderr => get last detected error's message => return number of last error => see man page => suspend process for nsecs seconds nsecs seconds . ltime. e.

quick-and-dirty editor (gets its own window).cshrc file in order to avoid multi-megabyte core dumps: limit coredumpsize 0 uuencode/uudecode .put the following line in your .echo a text of up to 10 characters to the screen in BIG letters 26 . useful for changing a file from UPPER.to lowercase.translate or delete characters. uuencode them: uuencode binary_file coded_file > coded_file banner .check a file for spelling errors xedit . for example (from O): O > $ xedit map_macro & limit .if you want to send BINARY files by E-mail. for example: cat infile | tr '[A-Z]' '[a-z]' > outfile spell .Unix for Beginners ____________________________________________________________________________ tr .

VII-5 V-2.VI-3.V-2 IV-18 IV-5 IV-18 27 .VI-2.VI-1 V-3.VII-6 IV-13 IV-13 VII-5 IV-14 V-2.IV-18.V-2 V-2 list to terminal V-2.V-2 VII-5 IV-3 VII-5 IV-5 VII-5.VII-17 IV-18 VII-5 VII-5 IV-2.VII-5 VII-5 VI-2. full-screen IV-5 editor.VII-5 IV-14.Index of Unix commands alias alloc apropos ar awk banner bc bg cal cat cc cd chmod chown clear cmp compress cp cron cut date dd df diff du echo ed egrep emacs ex exit f77 factor fg fgrep file find finger fold fsplit ftp grep head history jobs jot kill abbreviate common commands list allocated memory help on available commands archive files editor.V-2.VI-6.V-2 IV-16.V-2.VI-6.VI-5.V-2 VII-5 IV-11.VI-2 VII-5 V-2.VII-18 VII-18 IV-18 VII-5 IV-14.VI-5.IV-17.VII-5 VII-5. stream-based list text in big letters calculator with arbitrary precision put job in background list calendar list file contents compile/link C program change directory change file protection change file ownership clear terminal screen compare files compress files copy files execute commands regularly extract columns from files list date and time convert files list file-system usage list differences between files list disk usage IV-17.VI-1.VI-7.VI-3. line-based IV-5 exit from a command script VI-2.VII-14 IV-11.VII-10 IV-17.V-2 IV-14.IV-15.VI-7.Unix for Beginners ____________________________________________________________________________ VIII . window-based interrupt/terminate job V-2.IV-15. line-based IV-5 version of grep VII-5 editor.VI-4.VII-1 IV-14.VI-7.V-2 VII-5 V-2.VI-8 editor.VI-8 compile/link Fortran program list prime factors of a number put job in foreground version of grep list type of files find files list user information list file and fold long lines split Fortran source file copy files from/to other machines find/count string in files list file header list recent commands list jobs editor.

VI-5 remove print job IV-14 list files IV-9.VII-6 set environment variable V-2.IV-15.IV-16.IV-10.VI-5 stop a session V-2 list print jobs IV-14 print files IV-14.Unix for Beginners ____________________________________________________________________________ last less limit ln logout lpq lpr lprm ls Mail mail make man mkdir more mv nice nl nohup od passwd paste pr printenv ps pwd rcp renice rlogin rm rmdir sed set setenv sleep sort source spell stop strip stty tail talk tar telnet time touch tr tty list last sessions of a user VII-5 list file contents.VI-6.VI-4.VI-2.VI-6.VI-8 remove directories IV-11 IV-5.VII-5 wait N seconds VI-3 sort files IV-14.VI-5.V-1.VI-8.VII-5 execute script V-2.IV-16 IV-11 IV-18 VII-18 IV-18 VII-5 IV-1 VII-5 IV-14. VI-7.IV-17.VI-2.V-2 IV-11 IV-14.VII-5 list file footer talk to other user archive files log in on other machine time a command change access date of files translate/delete characters list terminal IV-14.VI-7.V-2 IV-8 copy files from/to other machines VII-1 change priority of a command IV-18.V-2.IV-17 VII-5 IV-18.VII-7 mail facility mail facility manage dependent files help with a command create directory list file contents.VI-8. stream-based define value for a variable 28 .VII-7.VI-7.VI-7. paginated move/rename files execute command with lower priority add line numbers execute command in background list dump of any file change password list two files side by side list file nicely list values of environment variables list processes list present work directory VII-5 VII-5 VII-3 IV-3.VII-4 VII-2 V-2.VII-8 V-2.V-2.IV-18.VII-18 link files IV-12.VII-5 VII-5 VII-18 VII-10 editor.VI-3.V-2.IV-17.VI-4 log in on other machine VII-2 remove files IV-11.IV-15.IV-16.VI-5. paginated IV-14 list/set hardware limits V-2.VI-6.V-2.VI-5 VII-5 VI-6.VII-6 check spelling VII-18 interrupt job IV-18 strip executable VII-5 set/list terminal characteristics IV-4.VI-8.

window-based show available fonts draw pictures show CPU load help terminal window list contents of compressed text file editor.VII-14 units convert unit systems VII-15 unset remove a variable VI-1 uucp copy files from/to other machines VII-1 uudecode convert ASCII file back to binary VII-18 uuencode convert binary files to ASCII VII-18 vi w wc whereis which who xcalc xcalendar xclock xedit xfd xfig xload xman xterm zcat zip editor.IV-16.IV-17 VII-5 VII-5 IV-15.VI-8.VII-9. bytes in files list filename of program/script list filename of program/script list current users calculator calendar and time manager clock editor.VII-16 VII-9 VII-9 VII-9 IV-5.V-2. window-based IV-5 VII-16 IV-14.Unix for Beginners ____________________________________________________________________________ unalias remove an alias IV-17 uncompress decompress files V-2.IV-15. full-screen list current users count lines. words.VII-9 VII-14 IV-5 29 .VII-18 VII-9 VII-9 VII-9 VII-9 V-2.

VI-8 cut V-2.VII-14 uudecode VII-18 uuencode VII-18 dd VII-5 units VII-15 cp IV-11.VII-4 xcalc VII-9 bc VII-18 xcalendar VII-9 touch VII-5 cd IV-11. window-based editor.VII-6 exit VI-2.VI-5.V-2 30 .VII-1 rcp VII-1 uucp VII-1 wc IV-14.VI-2 ftp V-2.VI-2.VI-8.VII-14 set V-2.IV-15.IV-18.VII-6 chown IV-13 chmod IV-13 passwd IV-1 renice IV-18.VI-4.VI-7.VI-5.VI-7.VII-18 zip IV-5 nohup IV-18 nice IV-18 cron VII-5 source V-2.VI-8.Inverted index of Unix commands abbreviate common commands add line numbers archive files archive files calculator calculator with arbitrary precision calendar and time manager change access date of files change directory change file ownership change file protection change password change priority of a command check spelling clear terminal screen clock compare files compile/link C program compile/link Fortran program compress files convert ASCII file back to binary convert binary files to ASCII convert files convert unit systems copy files copy files from/to other machines copy files from/to other machines copy files from/to other machines count lines. line-based editor.VI-6. window-based execute command in background execute command with lower priority execute commands regularly execute script exit from a command script extract columns from files find files find/count string in files alias nl ar tar IV-17. line-based editor.VI-6.VII-5 compress V-2.IV-15.VI-1 IV-14.V-2 VII-18 VII-5 VI-6.IV-17. bytes in files create directory decompress files define value for a variable draw pictures editor. full-screen editor. VI-7.V-2. stream-based editor.VI-7.VI-3.VII-9.VI-4 spell VII-18 clear VII-5 xclock VII-9 cmp IV-14 cc VII-5 f77 V-2.Unix for Beginners ____________________________________________________________________________ IX .IV-17 mkdir IV-11 uncompress V-2.VI-8.V-2.VI-3.VII-10 find grep IV-2. stream-based editor.VI-4. window-based editor.VII-6 xfig VII-9 emacs IV-5 vi IV-5 ed IV-5 ex IV-5 awk IV-5 sed IV-5. full-screen editor. words.VII-7.VI-1.VII-8 jot IV-5 xedit IV-5.

VII-5 printenv VII-5 limit V-2.V-2.VII-18 rlogin VII-2 telnet VII-2 Mail mail make mv lpr bg fg unset unalias VII-5 VII-5 VII-3 IV-11 IV-14. VI-6.VI-6.VI-5.IV-16 tail IV-14.V-2 pr IV-14.V-2 du V-2 od VII-5 fold VII-5 cat IV-14.VI-5.V-2 history IV-16.IV-16.V-2.VII-16 date IV-17.VI-5 head IV-14. paginated file contents.V-2 tty VII-10 banner VII-5.IV-16.VI-8.VII-18 echo V-2.V-2 less IV-14 more IV-14.VI-2.VII-17 lpq IV-14 ps IV-18.VI-5 IV-18 IV-18 VI-1 IV-17 .V-2.VI-3.V-2 IV-18 IV-18 list two files side by side list type of files list user information list values of environment variables list/set hardware limits log in on other machine log in on other machine mail facility mail facility manage dependent files move/rename files print files put job in background put job in foreground remove a variable remove an alias 31 ln IV-12.VII-5 whereis VII-5 which VII-5 ls IV-9. VI-7.IV-17 df V-2.V-2 diff IV-14.IV-10.VI-5 alloc VII-5 cal VII-5 zcat VII-14 w VII-16 who IV-15.IV-15. paginated file footer file header file nicely file-system usage filename of program/script filename of program/script files jobs last sessions of a user present work directory prime factors of a number print jobs processes recent commands terminal text in big letters to terminal stop kill VII-9 IV-3 IV-3.VI-8 paste VII-5 file VII-5 finger V-3.IV-15.Unix for Beginners ____________________________________________________________________________ help xman help on available commands apropos help with a command man interrupt job interrupt/terminate job link list list list list list list list list list list list list list list list list list list list list list list list list list list list list list list files allocated memory calendar contents of compressed text file current users current users date and time differences between files disk usage dump of any file file and fold long lines file contents file contents.VI-7.VII-7 jobs IV-18 last VII-5 pwd IV-8 factor VII-5.

VI-6.VII-5 VII-18 VII-5 VII-5 VI-3 32 .VII-5 VII-9 VII-9 IV-14.IV-17.VI-2.VII-5 VI-2.Unix for Beginners ____________________________________________________________________________ remove directories rmdir IV-11 remove files rm IV-11.VII-5 V-2 VII-5 VII-5 V-2.VII-9 V-2. V-2. VI-7.V-2.IV-17.IV-15.V-1.VII-5 IV-4.VI-8 remove print job lprm IV-14 set environment variable set/list terminal characteristics show CPU load show available fonts sort files split Fortran source file stop a session strip executable talk to other user terminal window time a command translate/delete characters version of grep version of grep wait N seconds setenv stty xload xfd sort fsplit logout strip talk xterm time tr egrep fgrep sleep V-2.IV-16.IV-18.

Sign up to vote on this title
UsefulNot useful