<<

1 QED Quick Reference 2004 Jeremy Lise

File Utilities [-alF] List files in current directory using long format Display the present working directory directory Change directory cd .. Move up one directory directory a new directory directory Remove directory [-i] source destination Copy files [-i] file1 file2 ... fileN Remove files [-i] old-name new-name Move files

Remote Access ssh userid@@qed.econ.queensu.ca Connect to qed ssh qed This short form will often work scp localfile qed.econ.queensu.ca:remotefile Copy localfile to qed scp qed.econ.queensu.ca:remotefile localfile Copy remotefile from server to local directory finger List all users currently logged in Change your password

Job Control aux | userid List all processes userid is running List all running [-9] PID Kill process PID nice -20 programname Run programname maximum niceness renice 20 PID Change process PID to maximum niceness

Print Control lpr file.ps Print file.ps to Dunning 211 printer lpq View jobs in print queue lprm - Remove all your print jobs from queue

Econometrics and Mathematics Software nice tsp TSP, Series Package nice octave2.1 Octave, a free Matlab clone nice xstata Stata in graphical mode (stata for text mode) nice stata -b do program.do & Stata in batch mode nice rats RATS nohup nice oxl input.ox > output.out & Ox in batch mode nice R R in interactive mode nice xmaple Maple in graphical mode (use maple for text mode)

Text Editors emacs Emacs text editor (emacs -nw for text mode) nano Simple text editor (also pico) nedit An easy to use windowed text editor (also gedit)

Typesetting, Office Suites, and Viewers lyx WYSISYM/Scientific Word style LATEX editor ooffice Office Suite that can read/ MSOffice documents gnumeric Spreadsheets (this can export LATEX tables) latex file.tex LATEX a file (or use emacs menus) xdvi Viewer for dvi files gv Viewer for ps files acroread Acrobat Reader for pdf files mozilla Web browser (Netscape) xfig A program to draw high quality diagrams for use in LATEX

1This is meant as a quick reference. See Using Unix in the QED, Sean Parkinson 1998 for details and examples. Tips on using the Linux computer in your office

In the following examples userid refers to your qed username (this is the same as your email address) and $ refers to the command line prompt in a terminal window (you do not the $).

Getting the out of the office computer: Many of the computers in your offices are older and very low on physical memory. This makes running graphical programs locally painfully slow, and sometimes impossible. The solution is to run the programs on a remote server and display them locally. To use any of the software on the servers do the following: 1. Open a terminal window by clicking on the computer monitor icon in the bottom left corner of the screen 2. Connect to qed: $ ssh [email protected] 3. Type the name of the program you wish to use. For example, to use a web browser: $ mozilla or to solve symbolic math problems: $ xmaple for running windowed programs: If you are opening a program that runs in its own window, you can type & after the command to return the cursor the the terminal window. For example: $ mozilla & opens a web browser, and returns the cursor, allowing you to open other programs. Tip for running batch programs: The commands nohup and nice allow you to to start a program running and then logout. The program will continue to run at maximum niceness even after you log-off. The following command will run octave with maximum niceness on the file myfile.m and direct all output to a file called nohup.out: $ nohup nice -20 octave myfile.m & Cutting and pasting text: To and , place the cursor at the beginning of the text. Press and hold the left mouse button to select the text. Click the desired position to paste the text. Press the middle mouse button to paste text (If you don’t have a middle mouse button press both buttons at the same time). Command Completion: When you are typing a command it is generally only necessary to type the first few letters, then press the tab key to have the computer fill in the rest. If there is than one command that begins with the letters you type a list of these will be displayed. Continue typing letters until it is uniquely identified. Checking for runaway jobs: Use the command top to view all the jobs currently running on a server. If you notice a job belonging to you that is using up a lot of CPU, and you don’t want it running anymore you should kill it. Press k for kill. When prompted with “PID to kill:” type in the number under the column PID. When prompted with “Kill process # with what signal? [15]”, hit enter (signal 15 is kill safely). If this does not kill the job, repeat a second time, typing 9 when prompted for the signal. Renicing a running job: If you are running a job that will take several hours, days, or weeks, you need to run it at maximum niceness. This means that it will use all the CPU when it is available, but not prevent others from productively using the server at the same time. As mentioned above, $ nohup nice -20 octave myfile.m & will run an octave job at maximum niceness. If you forget to set the nice level to 20, you can renice you job buy using top, pressing r for renice, entering the PID, and typing 20.

2