25.10.2014 Views

Introduction to Bio-Linux

Introduction to Bio-Linux

Introduction to Bio-Linux

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Note: While grep is a very useful utility, if you want <strong>to</strong> search biological sequences for patterns, there<br />

are sophisticated programs designed especially for this, and we advise against using grep in all but the<br />

most trivial cases.<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 />

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

12

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

Saved successfully!

Ooh no, something went wrong!