The best way to follow this discussion is to sit in front of a Linux Terminal and try the examples while you read. Turn on your machine, fire up a shell and put your hands on the keyboard, NOW ;-).

The best way to follow this discussion is to sit in front of a Linux Terminal and try the examples while you read. Turn on your machine, fire up a shell and put your hands on the keyboard, NOW ;-).

Line 9:

Line 9:

An in-depth, nice and clean guide of the main linux commands is available online thanks to the [[http://​www.linfo.org/​command_index.html|Linux Information Project Linux Commands pages]].

An in-depth, nice and clean guide of the main linux commands is available online thanks to the [[http://​www.linfo.org/​command_index.html|Linux Information Project Linux Commands pages]].

-

We will now list the main Linux commands in what we consider a logical order, rather than an alphabetically.

+

We will now list the main Linux commands in what we consider a logical order, rather than alphabetically.

==== man ====

==== man ====

Line 283:

Line 283:

Let's create the script file and open it for editing with nano, all in one command:

Let's create the script file and open it for editing with nano, all in one command:

-

''​andrea@ubuntu:​~$ nano -w myscript.py''​

+

''​andrea@ubuntu:​~$ nano -w helloworld.py''​

-

We will then put a first line in the script, called shebang line, to point Linux to the correct interpreter for the code that follows. Since we will write in python, we must include the python path returned previously by the "which python"​ command:

+

We will then put a first line in the script, called ​[[http://​en.wikipedia.org/​wiki/​Shebang_(Unix)|shebang line]], to point Linux to the correct interpreter for the code that follows. Since we will write in python, we must include the python path returned previously by the "which python"​ command:

''#​!/​usr/​bin/​python''​

''#​!/​usr/​bin/​python''​

Line 292:

Line 292:

print "​Hello,​ World!"​

print "​Hello,​ World!"​

+

+

//The helloworld.py python script//

+

<​code>​

+

#​!/​usr/​bin/​python

+

print "​Hello,​ World!"​

+

</​code>​

That's it, we are done. We can save with Ctrl + o, press return to confirm the file name and then exit nano with Ctrl + x.

That's it, we are done. We can save with Ctrl + o, press return to confirm the file name and then exit nano with Ctrl + x.

Line 297:

Line 303:

If we try to then run the script like this:

If we try to then run the script like this:

-

''​andrea@ubuntu:​~$ ./myscript.py''​

+

''​andrea@ubuntu:​~$ ./helloworld.py''​

This will not work, because the file does not have execute permissions. Let's grant execute permission:

This will not work, because the file does not have execute permissions. Let's grant execute permission:

-

''​andrea@ubuntu:​~$ chmod +x myscript.py''​

+

''​andrea@ubuntu:​~$ chmod +x helloworld.py''​

Then we can execute it:

Then we can execute it:

-

''​andrea@ubuntu:​~$ ./myscript.py''​

+

''​andrea@ubuntu:​~$ ./helloworld.py''​

will print "​Hello,​ World!"​ to the screen. Please note that in order for Linux to understand that we want to run the script file, rather than executing a command with the same name as the script, we have to use the ./ notation for the relative path, or use an absolute path. So we have to type:

will print "​Hello,​ World!"​ to the screen. Please note that in order for Linux to understand that we want to run the script file, rather than executing a command with the same name as the script, we have to use the ./ notation for the relative path, or use an absolute path. So we have to type:

-

''​andrea@ubuntu:​~$ ./myscript.py''​

+

''​andrea@ubuntu:​~$ ./helloworld.py''​

or

or

-

''​andrea@ubuntu:​~$ /​home/​andrea/​myscript.py''​

+

''​andrea@ubuntu:​~$ /​home/​andrea/​helloworld.py''​

rather then:

rather then:

-

''​andrea@ubuntu:​~$ ​myscript.py''​

+

''​andrea@ubuntu:​~$ ​helloworld.py''​

that will raise an error about the command not existing.

that will raise an error about the command not existing.

Line 324:

Line 330:

It's now time to move ahead and turn our newly installed Linux distro in a full fledged web server. We will start by installing an SSH Server and learning to connect remotely to our machine. [[chapter_2_-_the_linux_operating_system:​installing and using openssh server for remote connections |Read on]]

It's now time to move ahead and turn our newly installed Linux distro in a full fledged web server. We will start by installing an SSH Server and learning to connect remotely to our machine. [[chapter_2_-_the_linux_operating_system:​installing and using openssh server for remote connections |Read on]]

Page Tools

The Web development for Bioinformatics document is a copyrighted work of cellbiol.com. Reproducing this material, as a whole or in part, in print, on other web sites or by other means is not allowed without explicit permission of the author.