Bare-Bones Linux
Roger S. Rowlett
Gordon & Dorothy Kline Professor, Emeritus
Colgate University Department of Chemistry
Gordon & Dorothy Kline Professor, Emeritus
Colgate University Department of Chemistry
Because so many X-ray crystallography data analysis and protein modeling and refinement programs are written for the Unix/Linux platform, some familiarity with the Linux operating system is desirable to do protein crystallography. Most protein crystallography programs have been ported to Windows and IOS, but in some cases not all of the program features are available in these operating systems. The following information is not intended to be an exhaustive Linux tutorial; rather, it is intended to be the bare minimum information required for starting, ending and navigating a Linux session using a workstation in the Colgate University Department of Chemistry Protein X-ray Crystallography Computing Facility. Some helpful tricks and tips will be given along the way. You are encouraged to consult the additional resources for more information.
To start a Linux session, type in your username and password at the welcome screen. Do not share your password with anyone, else others could potentially make mischief, either intentionally or unintentionally, in your work area. The system administrator will set up an account for you, and help you configure your desktop, which will look something like the following figure.
Figure 1. Typical Linux session (Ubuntu ) on a workstation in the Colgate Protein X-ray Crystallography Computing Facility. The Firefox browser, Pymol, CCP4i, and a terminal window are open on the desktop in this figure.
Most crystallography programs and utilities run from a shell window, which is basically a text window into which you can type Linux commands. There are many shell environments in Linux, but the preferred one for crystallographic software is tcsh, an enhanced variant of the C-shell. To open a new shell in Linux click on the terminal icon in the toolbar (7th from the left in Figure 1). A new window should open with a command prompt such as ancho%. In this case, ancho indicates the computer to which you are logged in, and % is the shell prompt. Commands that you type will appear after the prompt symbol. Shell windows can be closed by typing exit at the prompt or by clicking the upper right corner of the window.
To end a Linux session (not to be confused with exit from a shell window), right-click on the desktop and select Logout. Always log out of your session when you are away from your terminal for more than a few minutes.
File directory structures are similar to that of DOS (the precursor to Windows). Indeed, DOS (now called the Command Prompt in Windows) is a derivative of Unix and shares many common commands and functions. When you start a Linux session, you will be located in your home directory, and all commands you type will normally apply to the files in this, your local directory, unless instructed otherwise. Your local directory might be something like /home/jdoe. That is, unless instructed otherwise, all files will be read and written to the jdoe directory of the home directory of the machine you are logged in. You can find out where you currently are by typing the pwd command; you can make a new directory in the current directory with the mkdir command; or you can change your local directory to another with the cd command. These and other commands are described below.
The string /home/jdoe/filename describes an absolute path to the file filename,a complete set of instructions to locate the file in question. The leading slash indicates that this is a complete path, starting with the directory home. The string datafiles/filename is a relative path which describes how to locate a file from the local directory. A relative path does not start with a leading slash. For example if you were currently in the directory /home/jdoe, the relative path datafiles/filename would point to the absolute location /home/jdoe/datafiles/filename. Relative paths can save a lot of time when typing commands.
It is important for new Linux users to know that Linux will not generally protect you from yourself. For example, deleting files or directories in Linux is absolutely, positively, no-turning-back, irretrievably FINAL. You cannot recover files you delete accidentally. Therefore, proceed with care and caution when cleaning up data. A list of commonly used Linux commands follows in the next section.
File directory structures are similar to that of DOS (the precursor to Windows). Indeed, DOS (now called the Command Prompt in Windows) is a derivative of Unix and shares many common commands and functions. When you start a Linux session, you will be located in your home directory, and all commands you type will normally apply to the files in this, your local directory, unless instructed otherwise. Your local directory might be something like /home/jdoe. That is, unless instructed otherwise, all files will be read and written to the jdoe directory of the home directory of the machine you are logged in. You can find out where you currently are by typing the pwd command; you can make a new directory in the current directory with the mkdir command; or you can change your local directory to another with the cd command. These and other commands are described below.
The string /home/jdoe/filename describes an absolute path to the file filename,a complete set of instructions to locate the file in question. The leading slash indicates that this is a complete path, starting with the directory home. The string datafiles/filename is a relative path which describes how to locate a file from the local directory. A relative path does not start with a leading slash. For example if you were currently in the directory /home/jdoe, the relative path datafiles/filename would point to the absolute location /home/jdoe/datafiles/filename. Relative paths can save a lot of time when typing commands.
It is important for new Linux users to know that Linux will not generally protect you from yourself. For example, deleting files or directories in Linux is absolutely, positively, no-turning-back, irretrievably FINAL. You cannot recover files you delete accidentally. Therefore, proceed with care and caution when cleaning up data. A list of commonly used Linux commands follows in the next section.
File directory structures are similar to that of DOS (the precursor to Windows). Indeed, DOS (now called the Command Prompt in Windows) is a derivative of Unix and shares many common commands and functions. When you start a Linux session, you will be located in your home directory, and all commands you type will normally apply to the files in this, your local directory, unless instructed otherwise. Your local directory might be something like /home/jdoe. That is, unless instructed otherwise, all files will be read and written to the jdoe directory of the home directory of the machine you are logged in. You can find out where you currently are by typing the pwd command; you can make a new directory in the current directory with the mkdir command; or you can change your local directory to another with the cd command. These and other commands are described below.
The string /home/jdoe/filename describes an absolute path to the file filename,a complete set of instructions to locate the file in question. The leading slash indicates that this is a complete path, starting with the directory home. The string datafiles/filename is a relative path which describes how to locate a file from the local directory. A relative path does not start with a leading slash. For example if you were currently in the directory /home/jdoe, the relative path datafiles/filename would point to the absolute location /home/jdoe/datafiles/filename. Relative paths can save a lot of time when typing commands.
It is important for new Linux users to know that Linux will not generally protect you from yourself. For example, deleting files or directories in Linux is absolutely, positively, no-turning-back, irretrievably FINAL. You cannot recover files you delete accidentally. Therefore, proceed with care and caution when cleaning up data. A list of commonly used Linux commands follows in the next section.
The following is an alphabetical list of a common Unix commands that you might use for routine crystallography work and file maintenance. Please note that Linux commands, unlike DOS commands, are case-sensitive. So PWD is not the same as Pwd as pwd. Filenames are also case-sensitive; most users avoid using capitalized text in filenames for ease of typing and to prevent confusion.
Linux has many special characters that make it easier to type commands. Some of these are listed below, with examples.
Linux allows the user to redirect information from the keyboard or screen (defaults for input and output) to files or even other programs using redirection commands. A listing of common redirection commands is given below with examples.
It is possible to customize your Linux environment to make it easier to navigate through your directories and projects. To customize your environment, edit the .tcshrc file in your home directory. Commands in this directory will be executed each time you open a new shell window. The following types of commands are useful to have in your .tcshrc file: