Introduction to Bio-Linux
Introduction to Bio-Linux
Introduction to Bio-Linux
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Introduction</strong> <strong>to</strong> <strong>Bio</strong>-<strong>Linux</strong><br />
Logging in and exploring the desk<strong>to</strong>p<br />
You can log in<strong>to</strong> your <strong>Bio</strong>-<strong>Linux</strong> machine locally or remotely. Today you are logging on<strong>to</strong> a machine locally,<br />
which means that the moni<strong>to</strong>r you are looking at is attached directly <strong>to</strong> the machine running the system. You may<br />
also hear this referred <strong>to</strong> as logging in at the console.<br />
Log in using the username and password you have been given.<br />
The view you now see is referred <strong>to</strong> as the desk<strong>to</strong>p.<br />
Exercise<br />
Take some time <strong>to</strong> explore the desk<strong>to</strong>p. Look at what options are available under the menus, what clicking the<br />
icons on the desk<strong>to</strong>p does, etc. Also try using the right and middle mouse but<strong>to</strong>ns when the mouse pointer is over<br />
a blank area of the desk<strong>to</strong>p and explore the menus presented <strong>to</strong> you.<br />
At the right hand side of the <strong>to</strong>olbar on the bot<strong>to</strong>m of the screen are 4 “virtual desk<strong>to</strong>ps”. These effectively give<br />
you 4 times the working space of your moni<strong>to</strong>r. Try going <strong>to</strong> a different virtual desk<strong>to</strong>p and starting up some<br />
windows/applications there.<br />
Click on the icon for your “home” at the <strong>to</strong>p left of the screen. This is a graphical representation of your files,<br />
similar <strong>to</strong> what you might see on a Mac or PC. Leave this window open for the next part of the practical.<br />
How <strong>Linux</strong> and Unix files are organized<br />
Your <strong>Bio</strong>-<strong>Linux</strong> machine can be thought of as a huge file folder, inside of which are many other file folders, and<br />
inside these are more nested file folders, and so on. As in the real world, file folders can hold other file folders, or<br />
files (– for this course, consider these <strong>to</strong> be the same as documents.)<br />
In <strong>Linux</strong> /Unix systems, documents are usually referred <strong>to</strong> as files, and file folders are referred <strong>to</strong> as direc<strong>to</strong>ries.<br />
The graphical representation of your account can be a good initial way <strong>to</strong> visualise what folders and documents<br />
you have, and <strong>to</strong> move around in your account. However, as you grow more comfortable with <strong>Linux</strong>, you may<br />
begin <strong>to</strong> find it slow and unnecessary. It is a good way <strong>to</strong> learn about the overall filesystem of the machine<br />
though!<br />
Your account is one direc<strong>to</strong>ry (file folder) somewhere within the overall big file folder, i.e. your <strong>Bio</strong>-<strong>Linux</strong><br />
machine. In it you can create other direc<strong>to</strong>ries, s<strong>to</strong>re data, run programs, etc.<br />
Just like with a regular filing cabinet, if you threw all your documents in without any ordering or organisation, it<br />
would rapidly become difficult <strong>to</strong> find things. The same thing will happen <strong>to</strong> your account if you choose <strong>to</strong> keep<br />
all your documents in your home direc<strong>to</strong>ry instead of creating subdirec<strong>to</strong>ries and s<strong>to</strong>ring associated data <strong>to</strong>gether<br />
within them.<br />
If you look at the graphical representation of your home direc<strong>to</strong>ry – you should see the following next <strong>to</strong> the word<br />
location:<br />
/home/user1<br />
1
The name of the base file folder, the one within which everything else is, is “/”, usually referred <strong>to</strong> as the “root<br />
direc<strong>to</strong>ry”.<br />
/home<br />
/home/user<br />
home is a file folder located within the root direc<strong>to</strong>ry<br />
user is a file folder within the direc<strong>to</strong>ry home which is within the root direc<strong>to</strong>ry<br />
All the direc<strong>to</strong>ry names are separated with a forward slash – so the direc<strong>to</strong>ry user1 is located within the direc<strong>to</strong>ry<br />
home, which is within /.<br />
A <strong>Linux</strong> aside:<br />
The root direc<strong>to</strong>ry of <strong>Linux</strong>/Unix systems is / . However, <strong>Linux</strong> systems also have a direc<strong>to</strong>ry called /root with is a<br />
direc<strong>to</strong>ry called “root” within /<br />
/root is root’s “home” direc<strong>to</strong>ry. Usually if you someone refers <strong>to</strong> the root direc<strong>to</strong>ry, they probably mean just / not<br />
/root<br />
The real power on <strong>Linux</strong>/Unix systems is the command line. You usually access the command line using<br />
terminals.<br />
You can open a terminal by:<br />
• clicking on the icon on the <strong>to</strong>p <strong>to</strong>ol bar<br />
• right-clicking on the desk<strong>to</strong>p and choosing the menu option “New terminal”<br />
• or by going <strong>to</strong> the Utilities option under the Programs drop down menu, and choosing Terminal<br />
You can also start new terminals by typing their name on the command line.<br />
xterm &<br />
The & allows you <strong>to</strong> keep working in the original window by starting up the process, (in this case, an xterm), and<br />
putting that process in the “background”. If you want <strong>to</strong> know more about this, please ask a demonstra<strong>to</strong>r.<br />
If you don’t like the colour scheme of the terminal you are working in, you can change it using the Preferences<br />
option under the Settings menu on the terminal.<br />
Exercise<br />
Go <strong>to</strong> the Preferences option under the Settings menu on the terminal. Choose the panel Colours, and then<br />
choose the colour scheme you want. Please note that the option “black on white” actually produces black on grey.<br />
To get black print on a white background, choose Cus<strong>to</strong>m Colours and choose the colours you want.<br />
After this, any new terminal you open will inherit your new colour scheme.<br />
Pressing the right hand mouse but<strong>to</strong>n can bring up menus of options for the terminal you are working in.<br />
You can close terminals by typing exit on the command line or choosing Exit under the File menu.<br />
There is also a menu under the tiny icon <strong>to</strong> the left of the word Terminal at the <strong>to</strong>p of your terminal window. Try<br />
out some of the options. Try choosing the option Sticky under Toggle. This makes that terminal appear in every<br />
virtual desk<strong>to</strong>p, instead of just one desk<strong>to</strong>p. Note: please use the exit options mentioned above <strong>to</strong> close your<br />
terminal, rather than the Close option in this menu.<br />
2
File naming conventions<br />
a.) Certain characters should not be used in filenames in <strong>Linux</strong>/Unix.<br />
If you stick with letters, numbers, hyphens, underscores and full s<strong>to</strong>ps, you will be fine.<br />
b.) <strong>Linux</strong>/Unix cannot deal with spaces in filenames!<br />
Make sure your filenames do not contain them.<br />
Filenames with spaces in them are a common problem when transferring files <strong>to</strong> <strong>Linux</strong>/Unix from a computers<br />
running Windows, or Mac operating systems.<br />
If you end up with filenames with spaces in them, you will need <strong>to</strong> enclose the entire filename in quotation marks<br />
so that <strong>Linux</strong>/Unix understands that the space is part of the name.<br />
Alternatively, you can “escape” the space using a backslash. For example, if I have a file called<br />
my document<br />
<strong>Linux</strong>/Unix will see this as two filenames, “my” and “document”.<br />
But you could write either of the following <strong>to</strong> make it understand you mean a single file:<br />
“my document”<br />
my\ document<br />
We advise that you change the name of such files <strong>to</strong> remove the space. A common practice is <strong>to</strong> replace the space<br />
with an underscore. E.g.<br />
mv “my document” my_document<br />
Keeping points a and b in mind, the files in your account can be named whatever you like.<br />
Having said this, please note that there are common naming conventions in place that you should try <strong>to</strong> follow.<br />
More is said on this in the bioinformatics practical.<br />
3
Basic commands<br />
It is possible for users <strong>to</strong> achieve a great deal with only a small number of commands.<br />
Ana<strong>to</strong>my of a Command<br />
<strong>Linux</strong>/Unix commands usually take the form:<br />
command<br />
parameters arguments<br />
what I want <strong>to</strong> do how I want <strong>to</strong> do it on what do I want <strong>to</strong> do it<br />
E.g. To read a text file and number the lines, I can use the command less, give it the parameter –N and the<br />
argument of the filename I wish <strong>to</strong> read<br />
less –N mytextfile<br />
Some commands may not need parameters or arguments, but most will have options available <strong>to</strong> you if you<br />
choose <strong>to</strong> use them.<br />
You can find out more about options available <strong>to</strong> you for any command by using the man command.<br />
man less<br />
If a command is executed without problem, it will usually not report anything back <strong>to</strong> you, (unless reporting <strong>to</strong><br />
you was the purpose of the command!). If the command does not execute properly, you will often see an error<br />
message returned. Whether or not the error is meaningful <strong>to</strong> you depends on what your level of experience with<br />
<strong>Linux</strong>/Unix is and how user-friendly the errors generated by that command were designed <strong>to</strong> be.<br />
4
<strong>Linux</strong>/Unix shorthand and shortcuts<br />
At first understanding example Unix commands can seem daunting. This is often due <strong>to</strong> the shorthand employed.<br />
The most common shorthand characters are very useful.<br />
The following incomplete list covers the symbols you will see most often <strong>to</strong>day and describes their meanings as<br />
you will most likely encounter them in this course.<br />
Warning: some symbols have different meanings depending where they are used,<br />
A short incomplete list includes:<br />
* matches any character appearing 0 or more times, also known as a wildcard<br />
ls mydir/* list all the files under the direc<strong>to</strong>ry mydir<br />
ls cat* list all files starting with the letters cat<br />
ls cat*hat list all files starting with the letters cat and ending in hat<br />
? matches a single character<br />
ls cat??hat list all files starting with the letters cat followed by any 2 letters, and then hat<br />
. “the direc<strong>to</strong>ry I am currently in”<br />
.. the direc<strong>to</strong>ry one level above<br />
~ my home direc<strong>to</strong>ry<br />
~username<br />
the home direc<strong>to</strong>ry of the user username<br />
Changing direc<strong>to</strong>ries<br />
The command used <strong>to</strong> change direc<strong>to</strong>ries is cd<br />
If you think of your direc<strong>to</strong>ry structure, (i.e. this set of nested file folders you are in), as tree structure, then the<br />
simplest direc<strong>to</strong>ry change you can do is move in<strong>to</strong> a direc<strong>to</strong>ry directly above or below the one your are in.<br />
To change <strong>to</strong> a direc<strong>to</strong>ry one below you are in, just use the cd command followed by the subdirec<strong>to</strong>ry name:<br />
cd subdir_name<br />
To change direc<strong>to</strong>ry <strong>to</strong> the one above the one your are in, use the Unix shorthand for “the direc<strong>to</strong>ry above” ..<br />
cd ..<br />
If you need <strong>to</strong> change direc<strong>to</strong>ries <strong>to</strong> one far away on the system, you could explicitly state the full path:<br />
cd /usr/local/bin<br />
If you wish <strong>to</strong> return <strong>to</strong> your home direc<strong>to</strong>ry at any time, just type cd by itself.<br />
cd<br />
To switch between direc<strong>to</strong>ries, you can use the cd – command. This returns you <strong>to</strong> the last direc<strong>to</strong>ry you were<br />
working in before this one.<br />
5
If you get lost and want <strong>to</strong> confirm where in the direc<strong>to</strong>ry structure you are, use the pwd command (push working<br />
direc<strong>to</strong>ry). This will return the full path of the direc<strong>to</strong>ry you are currently in.<br />
Note also that by default in <strong>Bio</strong>-<strong>Linux</strong>, you see the name of the current direc<strong>to</strong>ry you are working in as part of<br />
your prompt. This is <strong>to</strong> help you remember where you are in your account.<br />
Exercise<br />
Change direc<strong>to</strong>ry from your home direc<strong>to</strong>ry <strong>to</strong> the direc<strong>to</strong>ry intro_pract.<br />
cd intro_pract<br />
Type pwd <strong>to</strong> see the full path <strong>to</strong> where you are.<br />
Making a direc<strong>to</strong>ry<br />
To make a new file folder, you use the command mkdir (make direc<strong>to</strong>ry). E.g.<br />
mkdir newdir<br />
would create a new direc<strong>to</strong>ry called newdir.<br />
Exercise<br />
Move <strong>to</strong> your home direc<strong>to</strong>ry (recall the cd command).<br />
Make a new direc<strong>to</strong>ry called testdir.<br />
mkdir testdir<br />
Hit the refresh but<strong>to</strong>n on the graphical representation of your account <strong>to</strong> update it.<br />
Move in<strong>to</strong> the new direc<strong>to</strong>ry testdir (using the command line)<br />
Move back in<strong>to</strong> the intro_pract direc<strong>to</strong>ry – try <strong>to</strong> do this with a single command.<br />
Listing files in a direc<strong>to</strong>ry<br />
Use the ls command <strong>to</strong> list files in a direc<strong>to</strong>ry<br />
By default, the command will list the filenames of the files in your current working direc<strong>to</strong>ry.<br />
You can specify many options <strong>to</strong> modify how much information is output by ls. You can also specify the name (or<br />
full path) of a direc<strong>to</strong>ry you wish <strong>to</strong> list the contents of.<br />
ls /usr/local/bin<br />
ls –lR /usr/software<br />
6
The meaning of the information returned <strong>to</strong> you when using the –l option with the ls command will be explained<br />
during the course.<br />
You can also use regular expressions <strong>to</strong> limit the files you wish <strong>to</strong> list. Recall:<br />
* means any character<br />
? means a single character<br />
[ ] can be used <strong>to</strong> designate a group of characters<br />
Exercise<br />
List the files in your current direc<strong>to</strong>ry.<br />
List the files in your current direc<strong>to</strong>ry with full details.<br />
List all the files in your direc<strong>to</strong>ry that start with the letters tes<br />
ls tes*<br />
List all the files in your direc<strong>to</strong>ry that start with tes, and end in 1.embl, 2.embl or 3.embl<br />
ls tes*[1-3].embl<br />
Using text edi<strong>to</strong>rs<br />
There are a number of different text edi<strong>to</strong>rs available on <strong>Bio</strong>-<strong>Linux</strong>. Note that what we are referring <strong>to</strong> here is not<br />
a word processor, (e.g. MS Word); text edi<strong>to</strong>rs only deal in text.<br />
The text edi<strong>to</strong>rs available range in ease of use from simple <strong>to</strong> complex, and each has its pros and cons. In this<br />
practical we will briefly look at two edi<strong>to</strong>rs, pico and nedit.<br />
Pico<br />
Pros:<br />
• very easy – e.g. command options are visible at the bot<strong>to</strong>m of the window<br />
• can be used when logged in without graphical support<br />
• fast <strong>to</strong> start up and use<br />
Cons:<br />
• by default it is set <strong>to</strong> put returns in<strong>to</strong> lines <strong>to</strong>o long for the screen (i.e. using pico for system administration<br />
is dangerous!)<br />
• is not completely intuitive for people who are used <strong>to</strong> word processors<br />
Nedit<br />
Pros:<br />
very easy<br />
quite intuitive<br />
colouring schemes are available for programming syntax<br />
Cons: it is an X program (i.e. graphical), and can’t be run from a text-only environment<br />
it s slower <strong>to</strong> start up than non-graphical edi<strong>to</strong>rs<br />
7
Exercise<br />
Editing a file with pico<br />
In a terminal, type pico.<br />
Write some information in<strong>to</strong> this file. Try the options listed at the bot<strong>to</strong>m of the screen. the ^ means the Control<br />
key (Ctrl). So, for example, <strong>to</strong> check the spelling, use Ctrl-t. The command Ctrl-o saves the file and allows you <strong>to</strong><br />
continue working on it, and Ctrl-x saves the file and exits pico.<br />
When you are done, save your file and exit.<br />
Editing a file with nedit<br />
Type nedit &<br />
Type some text in<strong>to</strong> the window.<br />
Look under the menus for the kinds of options available <strong>to</strong> you.<br />
Under the Shell menu, try the options wc (word count) and number lines.<br />
Save your file under a different name than the one you used for the file you created with pico and exit nedit.<br />
Reading text files<br />
There are many commands available for reading text files on <strong>Linux</strong>/Unix. Among the most common are cat,<br />
more, and less.<br />
cat streams the entire contents of a file <strong>to</strong> your terminal. It is not generally a good command <strong>to</strong> use <strong>to</strong> read files<br />
except ones with very little text. cat is a very useful command for concatenating files though!<br />
more and less are commands that show the contents of a file one page at a time. less has more functionality than<br />
more.<br />
With both more and less, you can use the space bar <strong>to</strong> scroll down the page, and typing the letter q causes the<br />
program <strong>to</strong> quit – returning you <strong>to</strong> your command line prompt.<br />
In addition, once you are reading a document with more or less, typing a forward slash / will start a prompt at the<br />
bot<strong>to</strong>m of the page, and you can then type in text that is searched for below the point in the document you were at.<br />
Typing in a ? also searches for a text string you enter, but it searches in the document above the point you were at.<br />
Hitting the n key during a search looks for the next instance of that text in the file.<br />
With less (but not more), you can use the arrow keys <strong>to</strong> scroll up and down the page, and the b key <strong>to</strong> move back<br />
up the document if you wish <strong>to</strong>.<br />
Exercise<br />
Read the file hsy14678.embl using the commands cat, more and less.<br />
8
cat hsy14768.embl<br />
more hsy14768.embl<br />
less hsy14768.embl<br />
Use the spacebar <strong>to</strong> scroll down<br />
Press q <strong>to</strong> quit.<br />
Use the spacebar <strong>to</strong> scroll down, b <strong>to</strong> go up a page, and the up and<br />
down arrow keys <strong>to</strong> move up and down the file line by line.<br />
Press the / key and search for the letters sequen in the file.<br />
Press the ? key and search for the letters gene in the file.<br />
Press the n key <strong>to</strong> search for other instances of gene in the file.<br />
There are many command line options available for each of the above commands, as well as functionality we do<br />
not cover here. To read more about them, consult the manual pages:<br />
man cat<br />
man more<br />
man less<br />
Copying and pasting text<br />
To select text for copying, press the left mouse but<strong>to</strong>n <strong>to</strong> highlight the text.<br />
To paste, you have the window you wish <strong>to</strong> paste <strong>to</strong> selected, (usually meaning it is the <strong>to</strong>p window on view), and<br />
press the middle mouse but<strong>to</strong>n once – if you have a two but<strong>to</strong>n mouse, press both but<strong>to</strong>ns simultaneously <strong>to</strong><br />
emulate the middle mouse but<strong>to</strong>n.<br />
Exercise<br />
Open two terminals. In one, use the command less <strong>to</strong> open one of the files you created in the previous exercise.<br />
Open up another terminal and start pico.<br />
Copy and paste text from the first terminal in<strong>to</strong> the window running pico.<br />
Command his<strong>to</strong>ry and filename completion<br />
Using the functionality of your command his<strong>to</strong>ry and command line can save you a lot of typing!<br />
If you use the up arrow key when you are at the prompt in your terminal, you can see previous commands you<br />
have run. This is particularly useful if you have mistyped something and want <strong>to</strong> edit the command without<br />
writing the whole command out again.<br />
You can view past commands using the command his<strong>to</strong>ry.<br />
To re-run a command listed by the his<strong>to</strong>ry command, you can just type the command number, preceded by an<br />
exclamation mark. E.g.<br />
9
!268<br />
If you type in a command with a filename, and instead of completing the filename, you press the tab key part way<br />
through, the system, (actually the shell), will try <strong>to</strong> complete the filename for you. If the part of the filename you<br />
have written is unambiguous, i.e. there is only one filename that would fit that pattern, the rest of the filename will<br />
be filled in for you. If the pattern is ambiguous, all the filenames that match it will be presented <strong>to</strong> you. You can<br />
then choose <strong>to</strong> type out the full name of the file, continue typing until the pattern is not ambiguous and press tab<br />
again, or, instead, if you press tab twice, you will see that the system will cycle through all the filenames that fit<br />
your pattern – you can just keep hitting tab until you get <strong>to</strong> the correct filename.<br />
Exercise<br />
Type<br />
ls hsy<br />
and hit the tab key.<br />
Type<br />
ls test<br />
and hit the tab key. Hit the tab key again. Cycle through the filename options given <strong>to</strong> you.<br />
Type<br />
his<strong>to</strong>ry<br />
Run one of your previous commands using ! followed by the number of the command.<br />
Clearing your terminal of text<br />
Your terminal windows can fill up with lots of text, and it can become difficult <strong>to</strong> see the information<br />
you want because of all the clutter.<br />
You can clear the terminal window of all previous text by typing<br />
clear<br />
The result is a prompt in a nice clean window.<br />
Copying files<br />
To copy files, the basic command is cp. At minimum, you must also specify the name of the file(s) <strong>to</strong> be copied,<br />
and the destination location.<br />
cp firstfile dest_location<br />
cp file1 file2 file3 location<br />
10
cp direc<strong>to</strong>ry/* location<br />
copies all files in the direc<strong>to</strong>ry <strong>to</strong> location<br />
To move whole direc<strong>to</strong>ries, with all the subfiles and subdirec<strong>to</strong>ries, use the –R option, (meaning recursive).<br />
cp –R mydir location<br />
The <strong>Linux</strong>/Unix shorthand for “this direc<strong>to</strong>ry right here” (a dot . )comes in very handy when copying:<br />
cp –R mydir .<br />
Copy all files/direc<strong>to</strong>ries under mydir <strong>to</strong> this direc<strong>to</strong>ry here<br />
Make sure you leave a space between the direc<strong>to</strong>ry name and the shorthand dot.<br />
Also useful is the shorthand for someone’s home account. e.g. instead of having <strong>to</strong> know and type the location of<br />
their account, you can use ~username In the case of your own account, you need only use ~<br />
cp ~user2/somefile . copy the file somefile from user2’s home direc<strong>to</strong>ry here. Note that user2 would have<br />
<strong>to</strong> have given you permission <strong>to</strong> do this!<br />
cp ~/somedir/somefile .<br />
copy the file somefile from within my account/somedir <strong>to</strong> here.<br />
Exercise<br />
Copy all the files that start with the letters tes and end in .embl in<strong>to</strong> the direc<strong>to</strong>ry testdir that you made earlier.<br />
There are many different ways <strong>to</strong> accomplish the above. If you have problems, or would like <strong>to</strong> know if you have<br />
done it in the most efficient way, then please ask a demonstra<strong>to</strong>r.<br />
Removing files and direc<strong>to</strong>ries<br />
To remove a file or files, use the rm command followed by the name of the file(s) you wish <strong>to</strong> delete.<br />
rm file1<br />
rm file2 file3 file4<br />
rm cat*<br />
remove all files starting with the letters cat<br />
Note<br />
On <strong>Bio</strong>-<strong>Linux</strong> the command rm has been aliased <strong>to</strong> rm –i.<br />
This means the system will ask you if you really mean <strong>to</strong> delete the file you have just asked <strong>to</strong> delete, and you<br />
must answer yes if you do. Other <strong>Linux</strong>/Unix systems may not be so polite, and unlike Windows systems, the files<br />
you delete are not s<strong>to</strong>red in a trash can for you <strong>to</strong> retrieve – they’re gone! (Unless the file has been there for some<br />
time and you are making proper backups….which you should be!)<br />
If you have a lot of files <strong>to</strong> delete, confirming each one can be tedious. You can escape this safety feature by using<br />
a backslash in front of the rm command.<br />
\rm files<br />
11
To remove an empty direc<strong>to</strong>ry, you can use the rmdir command:<br />
rmdir thisdir<br />
If that direc<strong>to</strong>ry contains any files, you will not able <strong>to</strong> delete the direc<strong>to</strong>ry using rmdir until you have deleted all<br />
the files within it.<br />
To delete a direc<strong>to</strong>ry and all the files in it, use the rm command with the options -rf<br />
rm –rf fulldir<br />
You may be prompted <strong>to</strong> confirm that you wish <strong>to</strong> delete each file.<br />
If this is <strong>to</strong>o tedious, and you are certain that you want <strong>to</strong> delete all the files in that direc<strong>to</strong>ry as well as the<br />
direc<strong>to</strong>ry itself, remember that you can “escape” this safety feature using the backslash:<br />
\rm –rf fulldir<br />
Exercise<br />
Delete one of the files you created earlier with pico or nedit.<br />
Delete the entire testdir direc<strong>to</strong>ry.<br />
Changing permissions on files and direc<strong>to</strong>ries<br />
The command <strong>to</strong> change permissions is chmod. You have <strong>to</strong> specify who you are modifying the permissions of,<br />
what the new permissions are, and what file or direc<strong>to</strong>ry <strong>to</strong> act on.<br />
The format of the chmod command is:<br />
Who can be:<br />
chmod who ± permissions filename<br />
u<br />
g<br />
o<br />
a<br />
means user and refers <strong>to</strong> the owner of the file<br />
means group, and refers <strong>to</strong> the group the file belongs <strong>to</strong><br />
means others, everyone on your systems apart from those above<br />
means all three, i.e. user, group and others<br />
Permissions can be:<br />
r<br />
w<br />
x<br />
means read permission<br />
means write permission<br />
means execute permission<br />
So, for example, <strong>to</strong> give read permission <strong>to</strong> someone in the same group for a file called<br />
“filename” in ~/intro_pract.<br />
chmod g+r ~<br />
gives permission <strong>to</strong> people in my group <strong>to</strong> read my home direc<strong>to</strong>ry<br />
12
chmod g+rx ~/intro_pract give permission <strong>to</strong> people in the group <strong>to</strong> list files in the intro_pract direc<strong>to</strong>ry<br />
chmod g+r ~/intro_pract/myfile give permission <strong>to</strong> people in the group <strong>to</strong> read the file<br />
myfile (assuming they already have permission <strong>to</strong> “see” in<strong>to</strong> the intro_pract<br />
direc<strong>to</strong>ry).<br />
A very basic way <strong>to</strong> s<strong>to</strong>p a process<br />
Sometimes a command or program goes on <strong>to</strong>o long, or is obviously doing something you did not plan. If it is not<br />
a situation where there is an obvious way (e.g. a menu option) <strong>to</strong> s<strong>to</strong>p the program running, try using Control-c.<br />
i.e. the Control key and c-key at the same time.<br />
Logging out of a session<br />
To logout, you can choose the option logout under the System menu.<br />
Please do this at the end of the day – but not now.<br />
13