25.10.2014 Views

Introduction to Bio-Linux

Introduction to Bio-Linux

Introduction to Bio-Linux

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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 is (slightly) slower <strong>to</strong> start up than non-graphical edi<strong>to</strong>rs<br />

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! (More on this<br />

function later.)<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 />

8

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

Saved successfully!

Ooh no, something went wrong!