Alcor... Concordia's Alcor System


Unix

The most reliable sources of information about individual Unix commands are the "manpages", or pages of the online manual.

The friendliest online Unix documentation we've found is UNIXhelp; several other sources are listed in the "other online documentation" section of Alcor's home page.

Finally, at the end of this page, you'll find a list of Frequently Asked Questions about Unix and the Alcor environment.

Applications

We have lots of locally installed software on Alcor. If you're looking for a particular package, try "which commandname". If you'd like to browse, the /local/paths directory contains symbolic links to all of the programs installed for public use on the system, and you are welcome to look there.

Also, if you are yourself interested in how we install the software, or in seeing the source code, you can look at our installation notes, transcripts, package provenances, and source code: all of that is available in the directory /local/src, under the names /local/src/packagename (a few packages are under /local/pkg instead of /local/src). You are welcome to look at those software directories; anything that is not for public viewing has been protected with appropriate file permissions.

If you're just wondering what path you should use to access the local software, this should have been set up for you already, but if you are having problems, read on.

Frequently Asked Questions about Unix and the Alcor environment:




What are command aliases and how do I make my own?

If you're using the menushell all this applies as well as long as your "preferred shell" is csh or tcsh. (If you don't know what this is, don't worry: the default is tcsh, so you're probably fine.)

A command alias is a mechanism for mapping a "real" command to an easy-to-remember name. For example, if you frequently access the Web site "http://longhostname.domain.com/some/directory/", and wish to avoid typing that long name each time, you could "alias" the command which starts up that lynx session to "goodweb", which would be easier to remember and to type. To do so, you would place the following command in your .cshrc (shell start-up) file, or in another file as described below:
alias goodweb 'lynx http://longhostname.domain.com/some/directory/'

You can define as many command aliases as you want. In fact, you already have some. Take a look in your .cshrc. (This is the file that resides in your home directory and gets executed when you first log in and every time you invoke a new csh or tcsh shell.) You'll notice that at the bottom it says
source /local/etc/prodef/aliases
This means that all of the aliases in the file "/local/etc/prodef/aliases" are set for you at the beginning of each shell session. If you want to see the list of default aliases, look at the file /local/etc/prodef/aliases on Alcor. Alternatively, if you type alias you will get a list of all your aliases at the current moment.

To add your own aliases just make a file with the aliases in it (one per line), and then modify your .cshrc to "source" that file. For example, I have a file in my home directory called .aliases (the name is arbitrary) that looks like this:

   alias ls 'ls -F'
   alias from 'mailx -H'
   alias tfix 'setenv TERM vt220'
   alias alynx 'lynx http://alcor.concordia.ca'
   alias mlynx 'lynx http://cug.concordia.ca/~dana'
   alias telent 'telnet'
   

In my .cshrc I added "source .aliases". Now, for example, every time I type "ls", the system executes "ls -F" for me. (Or if I make a mistake and type "telent" like I always do it will run "telnet" for me instead) :)

You can "escape" aliased command to their original meaning (if applicable) with the "\" character. For example, say I aliased exit to some other command(s). Every time I typed exit that command would be executed instead of the real "exit". If I wanted to really exit I would type \exit, and then I really would exit from my session.

If you like, you can take out the system aliases by removing the appropriate line from your .cshrc file, but be careful with the rm command. By default rm is aliased to rm -i so that "rm" prompts you before deleting each file. If you take that alias away, it is very easy to remove the wrong thing, and you cannot "undelete" files under UNIX. A good idea would be to keep "rm" aliased to rm -i, and if you need to remove something without confirmation, just use \rm to use the "original" rm.

Back to the question list



How do I kill a process?

First of all, what is a process? Well, anything you do on Alcor is a process. When you first log in you run a shell. (It may be tcsh, it may be bash, or it may be the menushell.) That is a process. If you start up Pine to send some mail you start another process. If you do a listing of your files you start another (small) process that will list your files for you. Each one of the processes terminates automatically when you finish doing whatever you were doing. (The Pine process goes away when you exit from Pine, etc.)

Occasionally you will need to kill a process manually. This is how it is done.

First, you need the process id (PID) number. If you type ps, you will see a list of your processes. Example:


  PID TTY      S           TIME COMMAND
 7831 ttyv5    S        0:01.24 -tcsh (tcsh)
 8646 ttyv5    S  +     0:00.40 -csh -c ps (tcsh)
18201 ttyv5    I        0:00.00 leave 1700
21368 ttyv5    S  +     0:00.14 /local/paths/menu main.m

As you can see, I'm running a menushell (local/paths/menu), two other shells (tcsh and csh), and the "leave" program. Each of these has a number on the same line. This is the process identification (PID) number.

To kill any of these all I have to type is (guess what) kill process_number. So to kill "leave", I type kill 18201.

Occasionally a process will just refuse do die. In that case zap it with the kill -9 command. It is the same as the kill command but more abrupt and should not be used unless the process will not die with the ordinary kill command.

It is not a good idea to kill your "login" shell process ("login" shells have a dash in front of their name, as does "-tcsh (tcsh)" above). If you do, you will get logged out immediately. (But there is no harm in trying if you're curious to see what it does!) :)

Back to the question list



How do I kill or control a job?

A "job" is a name for a process, or a bunch of processes, in the context of a shell's "job control". We are usually interested in jobs that have been put into the background by the user. Jobs can be either running in the background or suspended in the background. If you ever try to log out and get a message "There are stopped jobs", you will need to know how to kill them so that you can log out properly without leaving stray processes on the system.

You can use the command jobs to show the list of jobs controlled by your current shell. The output should look something like:

      [1]  - Suspended (signal)     pine
      [2]  + Suspended              write neden
(Note: I had to enable suspension w/i the pine configs - by default, this is off.) The jobs command shows only the jobs controlled by (which you started from) your current shell, unlike ps, which shows all of your processes.

To resume a stopped (suspended) job, the command is fg (which stands for "foreground"). By default, fg will resume the last job suspended (marked with '+' in the listing). To choose any other job, use fg %X. For example, I would use fg %1 to resume pine in this case.

You can make a job run in the background with bg, which works just like fg. You can use this command to run jobs in the background while you do other things. As soon as a job needs input, it will suspend itself and let you know.

Use kill to terminate jobs. Unlike fg and bg, kill doesn't default to killing the last job, or any process in particular. You must always specify the job number. To use "kill" with shell job numbers instead of PIDs, put a "%" sign in front of the number, e.g., kill %2.

Back to the question list



How do I get to the menushell?

If you usually use one of the other shells and need to use the menushell just for the session, just type menushell. If you would like to have the menushell as your login shell (as the default when you log in), type tom (short for "to menushell"). Next time you log in, you will end up straight in the menushell.

Back to the question list



How do I set my command search path?

Information is available on Unix command search paths.

Back to the question list


Copyright, © 2003, Concordia University, (IITS).
Author: Anne Bennett, Dana Echtner
Credits: Kevin Neden
Maintained by: webdoc@alcor.concordia.ca
Last update: 2000/06/12 -- Dana Echtner

  [Alcor Home]
  [Alcor Search]