Introduction to Bio-Linux

Introduction to Bio-Linux Introduction to Bio-Linux

nebc.nerc.ac.uk
from nebc.nerc.ac.uk More from this publisher
25.10.2014 Views

ls cat*hat list all files starting with the letters cat and ending in hat ? matches a single character ls cat??hat list all files starting with the letters cat followed by any 2 letters, and then hat . “the directory I am currently in” .. the directory one level above ~ my home directory ~username the home directory of the user username Changing directories The command used to change directories is cd If you think of your directory structure, (i.e. this set of nested file folders you are in), as tree structure, then the simplest directory change you can do is move into a directory directly above or below the one your are in. To change to a directory one below you are in, just use the cd command followed by the subdirectory name: cd subdir_name To change directory to the one above the one your are in, use the Unix shorthand for “the directory above” .. cd .. If you need to change directories to one far away on the system, you could explicitly state the full path: cd /usr/local/bin If you wish to return to your home directory at any time, just type cd by itself. cd To switch between directories, you can use the cd – command. This returns you to the last directory you were working in before this one. If you get lost and want to confirm where in the directory structure you are, use the pwd command (push working directory). This will return the full path of the directory you are currently in. Note also that by default in Bio-Linux, you see the name of the current directory you are working in as part of your prompt. This is to help you remember where you are in your account. Exercise Change directory from your home directory to the directory intro_pract. cd intro_pract Type pwd to see the full path to where you are. 6

Making a directory To make a new file folder, you use the command mkdir (make directory). E.g. mkdir newdir would create a new directory called newdir. Exercise Move to your home directory (recall the cd command). Make a new directory called testdir. mkdir testdir Hit the refresh button of the file manager of your account to update it. Move into the new directory testdir (using the command line) Move back into the intro_pract directory – try to do this with a single command. Using text editors There are a number of different text editors available on Bio-Linux. Note that what we are referring to here is not a word processor, (e.g. MS Word); text editors only deal in text. The text editors available range in ease of use from simple to complex, and each has its pros and cons. In this practical we will briefly look at two editors, pico and nedit. Pico Pros: • very easy – e.g. command options are visible at the bottom of the window • can be used when logged in without graphical support • fast to start up and use Cons: • by default it is set to put returns into lines too long for the screen (i.e. using pico for system administration is dangerous!) • is not completely intuitive for people who are used to word processors 7

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 of the file manager 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 />

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 />

7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!