Skip to content

Commit

Permalink
upate syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
DininduSenanayake committed Jul 28, 2024
1 parent 38ad0c9 commit 686e683
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 120 deletions.
56 changes: 11 additions & 45 deletions docs/01-introduction.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
---
title: Introducing the Shell
teaching: 20
exercises: 10
---
# 1. Introducing the Shell

::::::::::::::::::::::::::::::::::::::: objectives
!!! clipboard-list "Lesson Objectives"

- Describe key reasons for learning shell.
- Navigate your file system using the command line.
- Access and read help files for `bash` programs and use help files to identify useful command options.
- Demonstrate the use of tab completion, and explain its advantages.
- Describe key reasons for learning shell.
- Navigate your file system using the command line.
- Access and read help files for `bash` programs and use help files to identify useful command options.
- Demonstrate the use of tab completion, and explain its advantages.

::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::: questions
!!! clipboard-question "questions"

- What is a command shell and why would I use one?
- How can I move around on my computer?
- How can I see what files and directories I have?
- How can I specify the location of a file or directory on my computer?
- What is a command shell and why would I use one?
- How can I move around on my computer?
- How can I see what files and directories I have?
- How can I specify the location of a file or directory on my computer?

::::::::::::::::::::::::::::::::::::::::::::::::::

**This lesson has been adapted from the original [Data Carpentry - Shell Genomics](https://datacarpentry.org/shell-genomics/) to be run using the NeSI infrastructure as part of the Otago Bioinformatics Spring School instead of AWS.**

Expand Down Expand Up @@ -65,34 +59,6 @@ We will learn the basics of the shell by manipulating some data files. Some of t
We will also be using several bioinformatic packages in later lessons and installing all of the software
would take up time even more time. A 'ready-to-go' server lets us focus on learning.

## How to access the remote server

During this workshop we will be running the material on the NeSI platform, using the Jupyter interface, however it is
also possible to run this material locally on your own machine.

One of the differences between running on NeSI or your own machine is that on NeSI we preinstall popular software and make it available to our users, whereas on your own machine you need to install the software yourself (e.g. using a package manager such as conda).

### Connect to Jupyter on NeSI

1. Connect to [https://jupyter.nesi.org.nz](https://jupyter.nesi.org.nz)
2. <p>Enter NeSI username, HPC password and 6 digit second factor token (as set on <a href="https://my.nesi.org.nz/account/hpc-account">MyNeSI</a>)<br>![image](fig/nesi_images/Login_jupyterhubNeSI.png)</p>
3. <p>Choose server options as below
<br>make sure to choose the correct project code `nesi02659`, number of CPUs **4**, memory **4GB** prior to pressing the Start button.

<br>![image](fig/nesi_images/ServerOptions_jupyterhubNeSI.png){width="700"}

4. <p>Start a terminal session from the JupyterLab launcher<br>![image](fig/nesi_images/ga-vl01jupyterhubNeSI.png){width="500"}

::::::::::::::::::::::::::::::::::::::::: callout

You can log-in to the remote server using the [instructions from the Introduction to Cloud Computing for Genomics lesson](https://datacarpentry.org/cloud-genomics/02-logging-onto-cloud#logging-onto-a-cloud-instance).
Your instructor will supply to you the `ip_address` and password that you need to login.

Each of you will have a different `ip_address`. This will
prevent us from accidentally changing each other's files as we work through the
exercises. The password will be the same for everyone.

After logging in, you will see a screen showing something like this:

```output
Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-137-generic x86_64)
Expand Down
28 changes: 11 additions & 17 deletions docs/02-the-filesystem.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
---
title: Navigating Files and Directories
teaching: 30
exercises: 20
---
# 2. Navigating Files and Directories

::::::::::::::::::::::::::::::::::::::: objectives
!!! clipboard-list "Lesson objectives"

- Use a single command to navigate multiple steps in your directory structure, including moving backwards (one level up).
- Perform operations on files in directories outside your working directory.
- Work with hidden directories and hidden files.
- Interconvert between absolute and relative paths.
- Employ navigational shortcuts to move around your file system.
- Use a single command to navigate multiple steps in your directory structure, including moving backwards (one level up).
- Perform operations on files in directories outside your working directory.
- Work with hidden directories and hidden files.
- Interconvert between absolute and relative paths.
- Employ navigational shortcuts to move around your file system.

::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::: questions
!!! clipboard-question "questions"

- How can I perform operations on files outside of my working directory?
- What are some navigational shortcuts I can use to make my work more efficient?
- How can I perform operations on files outside of my working directory?
- What are some navigational shortcuts I can use to make my work more efficient?


::::::::::::::::::::::::::::::::::::::::::::::::::

## Moving around the file system

Expand Down
27 changes: 11 additions & 16 deletions docs/03-working-with-files.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
---
title: Working with Files and Directories
teaching: 30
exercises: 15
---
# 3. Working with Files and Directories

::::::::::::::::::::::::::::::::::::::: objectives

- View, search within, copy, move, and rename files. Create new directories.
- Use wildcards (`*`) to perform operations on multiple files.
- Make a file read only.
- Use the `history` command to view and repeat recently used commands.
!!! clipboard-list "Lesson objectives"

::::::::::::::::::::::::::::::::::::::::::::::::::
- View, search within, copy, move, and rename files. Create new directories.
- Use wildcards (`*`) to perform operations on multiple files.
- Make a file read only.
- Use the `history` command to view and repeat recently used commands.

:::::::::::::::::::::::::::::::::::::::: questions
!!! clipboard-question "questions"

- How can I view and search file contents?
- How can I create, copy and delete files and directories?
- How can I control who has permission to modify a file?
- How can I repeat recently used commands?
- How can I view and search file contents?
- How can I create, copy and delete files and directories?
- How can I control who has permission to modify a file?
- How can I repeat recently used commands?

::::::::::::::::::::::::::::::::::::::::::::::::::

Expand Down
23 changes: 9 additions & 14 deletions docs/04-redirection.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
---
title: Redirection
teaching: 30
exercises: 15
---
# 4. Redirection

::::::::::::::::::::::::::::::::::::::: objectives

- Employ the `grep` command to search for information within files.
- Print the results of a command to a file.
- Construct command pipelines with two or more stages.
- Use `for` loops to run the same command for several input files.
!!! clipboard-list "Lesson Objectives"

::::::::::::::::::::::::::::::::::::::::::::::::::
- Employ the `grep` command to search for information within files.
- Print the results of a command to a file.
- Construct command pipelines with two or more stages.
- Use `for` loops to run the same command for several input files.

:::::::::::::::::::::::::::::::::::::::: questions
!!! clipboard-question "questions"

- How can I search within files?
- How can I combine existing commands to do new things?
- How can I search within files?
- How can I combine existing commands to do new things?

::::::::::::::::::::::::::::::::::::::::::::::::::

Expand Down
22 changes: 8 additions & 14 deletions docs/05-writing-scripts.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
---
title: Writing Scripts and Working with Data
teaching: 20
exercises: 20
---
# 5. Writing Scripts and Working with Data

::::::::::::::::::::::::::::::::::::::: objectives

- Use the `nano` text editor to modify text files.
- Write a basic shell script.
- Use the `bash` command to execute a shell script.
- Use `chmod` to make a script an executable program.
!!! clipboard-list "Lesson objectives"

::::::::::::::::::::::::::::::::::::::::::::::::::
- Use the `nano` text editor to modify text files.
- Write a basic shell script.
- Use the `bash` command to execute a shell script.
- Use `chmod` to make a script an executable program.

:::::::::::::::::::::::::::::::::::::::: questions
!!! clipboard-question "questions"

- How can we automate a commonly used set of commands?
- How can we automate a commonly used set of commands?

::::::::::::::::::::::::::::::::::::::::::::::::::

<script language="javascript" type="text/javascript">
function set_page_view_defaults() {
Expand Down
23 changes: 9 additions & 14 deletions docs/06-organization.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
---
title: Project Organization
teaching: 15
exercises: 15
---
# 6. Project Organization

::::::::::::::::::::::::::::::::::::::: objectives

- Create a file system for a bioinformatics project.
- Explain what types of files should go in your `docs`, `data`, and `results` directories.
- Use the `history` command and a text editor like `nano` to document your work on your project.
!!! clipboard-list "Lesson objectives"

::::::::::::::::::::::::::::::::::::::::::::::::::
- Create a file system for a bioinformatics project.
- Explain what types of files should go in your `docs`, `data`, and `results` directories.
- Use the `history` command and a text editor like `nano` to document your work on your project.

:::::::::::::::::::::::::::::::::::::::: questions
!!! clipboard-question "questions"

- How can I organize my file system for a new bioinformatics project?
- How can I document my work?

- How can I organize my file system for a new bioinformatics project?
- How can I document my work?

::::::::::::::::::::::::::::::::::::::::::::::::::

## Getting your project started

Expand Down
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<center>
# Introduction to Shell
</center>

<center>
![image](./fig/icon.png){width="350"}
</center>

Command line interface (CLI) and graphic user interface (GUI) are different ways of interacting with a computer's operating system. They have different pros and cons. Most people are familiar with the GUI as it is the default interface for most software, particularly on Windows and Mac OS. When using the GUI, you see and interact with visual representations of files, folders, applications, and most other functions of your computer.
When using the CLI, you work largely with text representations of software, files, folders, input and output.
The _shell_ is a program that allows you to control your computer by typing instructions on the CLI with a keyboard.
Expand Down

0 comments on commit 686e683

Please sign in to comment.