AWS and Unix intro
Connecting and properly using a cloud computing cluster at the CBW
by Jose Hector Galvez, Zhibin Lu & Rob Syme
Schedule:
Today’s schedule can be found here.
Contents:
1. Logging into AWS
Description of the lab:
This section will show students how to login to AWS.
You can find the instructions here.
2. Introduction to the command line
Description of the lab:
This section will show students the basics of the command line, with a focus on navigation.
Exercise: Exploring the filesystem
-
Connect to your AWS instance
-
Type the
ls
command - what is the output?
Solution
```bash $ ls CourseData R workspace ``` The `ls` command lists the contents of a working directory.
- Type the
pwd
command - what is the output?
Solution
```bash $ pwd /home/ubuntu ``` The `pwd` command shows the absolute *path to the working directorpwy*.3. File manipulation
Description of the lab:
This section will show students how to manipulate files, including reading, editing, and renaming text files.
Additional material:
Here are two cheat-sheets that can be useful to have as a reference for common UNIX/Linux commands:
Exercise: Reading text files
Using the commands you just learned, explore the .gff file in your home directory.
- Is the file a text file?
Solution
Yes. You can use `less`, `cat`, `head`, or `tail` and get human-readable info. Note that this doesn't have anything to do with its file extension.- How many lines does the file have?
Solution
```bash $ wc -l GCF_009858895.2_ASM985889v3_genomic.gff 67 GCF_009858895.2_ASM985889v3_genomic.gff ``` There are 67 lines in this file.- Can you read the content of the file using less?
Solution
```bash $ less GCF_009858895.2_ASM985889v3_genomic.gff ```Exercise: Editing text files
Using the commands you just learned, create a file called helloworld.txt and edit it using nano.
- Write “Hello world” into the file. Save the file and exit nano.
- Create a subdirectory called “test”; move the helloworld.txt file into test.
-
Create a copy of the helloworld.txt file called helloworld2.txt
- First, use the
nano
command to open a file calledhelloworld.txt
Solution
```bash $ nano helloworld.txt ``` Inside the nano editor, write "Hello world", then use the `^O` option to write the changes and `^X` to exit.- Create a subdirectory called “test”; move the helloworld.txt file into test.
Solution
First, use the command `mkdir` to create this new directory. Then, use `mv` to move `helloworld.txt` into this directory. ```bash $ mkdir test $ mv helloworld.txt test/ ```- Create a copy of the
helloworld.txt
file calledhelloworld2.txt
.
Solution
First, change the working directory using `cd`, then use the `cp` command to create the copy. ```bash $ cd test $ cp helloworld.txt helloworld2.txt ```4. Searching and sorting files
Description of the lab:
This section will show students how to search for and in files.
Workshop notes and quiz questions here.
5. Putting it all together
Description of the lab:
This section will show students how the basic concepts fit together and how they apply in the context of bioinformatics.
Workshop notes and quiz questions here.