Linux/Unix Tutorial: 1 Setting Up Your Account
Linux/Unix Tutorial: 1 Setting Up Your Account
2008
This document in intended to introduce students to the Linux/Unix operating system used on computers
in the Department of Statistical Science at Duke University. If you need help with computing you can always
ask other students, faculty, or send an email to help@stat.duke.edu.
3. R - opens R.
4. matlab - opens MATLAB.
1
5. acroread filename - opens filename in Adobe acrobat.
6. gv filename - opens filename in ghostview.
7. xdvi filename - previews a device independent (dvi) file.
8. pwd - prints your current working directory.
15. ls -a - lists all (that is what the “a” stands for) files in the current working directory.
16. ls -la - outputs a detailed list of all files in the directory.
17. chmod -rwx filename - changes the permission of filename. For example, chmod +rwx thesis.tex will
allow anyone to read, write, and delete your thesis file (if they want to).
3 Printing
Several printers are available for student use. You are asked to please use the department resources wisely
by not wasting paper, ink, or printing excessively. To print a document, first change your default printer to
the printer in your office by opening the file .cshrc by typing:
emacs .cshrc
in the terminal window. Look for the section of the document that looks like:
#setenv PRINTER mono112
#setenv PRINTER mono211
#setenv PRINTER mono214
#setenv PRINTER mono222
#setenv PRINTER mono223
2
and delete the “#” symbo on the line which matches the printer in your office. A list of printer names and
locations can be found at http://stat.duke.edu/comp/printing.html.
To print, type:
lpr filename
and the file will print to your default printer. If you type:
lpr -P printer filename
then the document will print to the printer specified by printer.
If you want to print from a personal laptop, you will need to send an email to help@stat.duke.edu and
ask before you can set it up. More detail about printing can be found at http://stat.duke.edu/comp/
printing.html.
r10 pid
which will renice pid to level 10 (or whatever number you put there).
If you notice that your computer is running slowly, go to the top enviroment to see if anyone is running
something on your computer. If they are and you want them to nice it to a higher level, write them an
email. DO NOT KILL ANYONE ELSE’S PROCESS!
3
ssh computername@stat.duke.edu
into your terminal window. You will then be logged in to the desktop computername just as if you were
sitting at that computer. A list of computer names, the computers primary user, room number, and computer
specificiations can be found on the statistics computing website. To exit your login to another computer
type exit.
Any student is allowed to use up to three computers for running processes at a given time. If you need
more computers than this you should ask for permission before using more than 3.
4
vncserver -geometry 1024x768 -depth 24
in the terminal window. You can set up the resolution by the geometry argument, and the depth of the color
by the depth argument. If you expect slow internet connect at your remote computer, use a small value of
depth, such as 8.
If it is the first time to set up the VNC session, it will prompt you for a password. It could be different
than your computer password, and it is used to access the VNC desktop remotely. You may need to type it
twice to confirm the password. If you want to change the password in the future, delete the file passwd in
the .vnc directory, and re-start the VNC session using the same command above.
Notice that you should see a PID associated with the session, which is typically 1, unless there are already
active VNC sessions on the computer. You can set up multiple VNC desktop sessions on one computer, but
you need to keep track of those PID numbers.
To kill an active VNC session, type
vncserver -kill :1
in the terminal window and the command should look for computername.isds.duke.edu:1.pid in .vnc directory,
and obtain the program ID, then kill it. Of course, if you have multiple sessions, change 1 to the corresponding
session id you would like to kill. To see the session id, use the ls command within the .vnc directory.
After you have an active VNC session on the department desktop, you are ready to access the computer
remotely. There are two main ways to access the remote desktops. One is to use a VNC client software, and
the other is to use web-browser. You need to enable JAVA for your web-browser, but it is not enabled by
default on the departmental computers.
The VNC viewing software vncviewer is installed by default on the departmental computers. To access
your VNC desktop from a department computer, just run
vncviewer :1
if the computer you are using is exactly the one you set up the VNC session. Otherwise, run
vncviewer computername.stat.duke.edu:1
and a window will pop up and ask for your VNC password. After that, you are good to go.
If you want to access your VNC desktop from a computer in which you don’t want to install anything
(like library computers for example), then type the following address in a web browser (such as firefox):
http://computername.stat.duke.edu:5801
Notice that the port number begins with 58. If the VNC session you have set up on the department computers
is not 01 then change the last two digits accordingly. The web browser will have the basic functions, but
you won’t be able to run it in full screen mode, for example.
If you have a personal computer or laptop and you want to access the department computers from your
laptop then it is better to use a dedicated VNC viewer software. There are couple of open-sourced softwares,
for example, tightvnc is available for both linux and windows users at http://www.tightvnc.com/. If you
are a Mac user, then download and install Chicken of the VNC at http://sourceforge.net/projects/
cotvnc/. You only need to download the viewer software, not the server part.