As of July 2014, changing your login shell on the command line via chsh
is
disabled. Instead, create a help ticket. We’ll make the change for you.
Note that /bin/tcsh
is the ECE/CIS supported shell. If you choose another
shell, such as /usr/bin/ksh
or /bin/bash
you are on your own if you run
into problems.
The supported login shell is tcsh, although users may also select others if
they so desire. Tcsh is much more powerful than csh and should be used.
~/.cshrc is the startup file that csh/tcsh read. tcsh will read ~/.tcshrc
instead if it exists. ~/.login is read on login. These are the files that set
up a user’s environment. Prototypes of these files, the ones new users receive,
are in /usr/local/lib/startup
.
There are two sets of variables that csh and tcsh use. Environment variables
are passed down to child processes and are set with setenv
and can be viewed
with printenv
. Shell variable are only used by the shell and are set with
set
, and can be viewed with echo $var
. setenv
does not use an ‘=’ to
assign variables, but set
does. An example follows:
After changing something in your .cshrc you need to either source it by typing
«source .cshrc
» in each window you want the change to take effect or by
logging out and back in.
PATH
.path
.PATH
is a colon separated list of directories.path
is a space separated list of directories.These two variable do the same thing, sets the search path to find executable programs. You don’t have to worry about maintaining both, of them, just one will do, as csh/tcsh will automatically set the other when you change one of them. For example:
> echo $path
/usr/local/bin /bin
> printenv PATH
/usr/local/bin:/bin
> set path = ( /usr/local/bin /bin /usr/sbin )
> echo $path \\ /usr/local/bin /bin /usr/sbin
> printenv PATH
/usr/local/bin:/bin:/usr/sbin
> setenv PATH ${PATH}:/usr/local/etc
> echo $path
/usr/local/bin /bin /usr/sbin /usr/local/etc
> printenv PATH
/usr/local/bin:/bin:/usr/sbin:/usr/local/etc
> set path = ( ${path} . )
> echo $path
/usr/local/bin /bin /usr/sbin /usr/local/etc .
> printenv PATH
/usr/local/bin:/bin:/usr/sbin:/usr/local/etc:.
As the preceding shows $var or ${var} will give the value of var. The last example show include ‘.’ in the path. That is the current directory. If you include ‘.’ in your path it should be last, after all system directories, and not first as bad things can happen with it first.
Man is short for manual and is how things are documented in Unix. Run man man
to read the manual system’s manual page.
MANPATH is an environment variable used by man to find man pages. It is a colon
separated list of directories for man to look in for man pages. Alternatively
you man specify the directory to look in with the -M option to man. The
directory the man page is in must either be in MANPATH or in one specified by
the -M option for man to find it. The directories actually have subdirectories
for the different sections of the manual, which contain the files. For example,
ls -l /usr/man/.
.
The manual has several sections. Sometimes you need to know what section the
man page is in. For example, if you want the man page for the write()
system
call, you need to do man -s 2 write
as man would first find the write command
in section one which are user commands. On Linux the -s can be left off.
Another useful option to man is -k to search for a keyword. For example, man
-k write
.
Man pages are often in nroff format. What man basically does is find the man
page, then do an nroff -man filename| $PAGER
. So if you change this to nroff
-man filename | lpr
, it will be sent to the printer. This requires finding the
location of the man page however. On most systems with enscript
, you can
simply use man filename | enscript -PPrinterName
.
Note: If you have missing man pages on some systems such as mlb, you may need to add /usr/share/man to your manpath.
The command to get a listing of processes is ps
. This command comes in two
flavors, BSD and SYSV. If you are on a Solaris host, uname -sr is SunOS 5.x,
then do a which ps
to find out which ps you are using by default.
/usr/bin/ps
is SYSV and is faster, while /usr/ucb/ps
is BSD.
Now that you know which flavor ps you are using you now can give it the right
options to get what you want. With the SYSV version you probably will want to
use ps -elf
, which will list all processes on the host in long format. With
the BSD version ps -augxww
will do a similar job. Piping the output to grep
may be helpful, for example, ps -elf | grep $USER
. The SYV version also has a
-u option which takes a username to limit the output to processes running for
that user. Check the man page, man ps
, for more info. Solaris users may find
the -o
option to /usr/bin/ps
helpful.
To kill a process first try kill PID
, where PID is the PID of the process to
kill. See the previous answer on ps which will give you the PID. If that
doesn’t kill the process try kill -9 PID
instead.
Also, there are pgrep
and pkill
commands. pgrep
will return the PID(s) of
a process that matches the expression. pkill
will send a signal to
process(es) that match an expression. See their man page for more info.
ECE/CIS • University of Delaware — All Rights Reserved • Newark, DE 19716 • USA • 2015 • Website by AndrĂ© Rauh • Maintained by Labstaff
Comments • Contact Us • Accessibility Notice • Legal Notices