微生物基因體核心研究室

Microbial Genomics Core Laboratory, Graduate Institute of Genomics and Bioinformatics, NCHU, Taiwan

blog

Genomic Informatics for Beginners #1

Working with CLI – What you need to know

This is a summary of the lecture content for the course ‘Shotgun Sequencing – Principle and Experiments’ in IGB, NCHU. This course module is designed to enable students with preliminary computer skills to use some of the bioinformatics software to perform analysis of genomic data. This part of the course will be conducted in a computer classroom, where each of the students will use a computer classroom PC (Windows) or their own laptop to log into a Linux server and learn to operate the computer using the CLI (command line interface). The operating system installed on the server is ubuntu Linux. There are pre-existing accounts for all students on the server.

What is Linux? Why we use Linux?

About Ubuntu

Use SSH (secure shell protocol) to login remotely
Multiuser computer OS
Client and Server
Port in computer networking
Shell – CLI prompt, the cursor, typing with the keyboard, ‘enter’
The disturbing ‘command not found’

$ echo "Hello World"

date – print or set the system date and time
command options : date -R

$ date -R

users –  print the user names of users currently logged in to the current host
man – an interface to the system reference manuals

Navigating the hierarchical directory system

Home directory (wiggle key ‘~’)
Root directory (/)
Dot and Dot-dot (. and ..)
Path – absolute and relative paths
Get around in the directory system – pwd, cd, ls, auto completion and previous commands
Brief introduction on the common directories in Linux directory system – usr, bin, sbin, etc, lib,…
More on the file attributes: ls -al
Binary and text files

To play with text files and shell scripts

create a file
vi – introducing the the text editor
why you should learn vi
the command mode, insert mode, and escape mode – (‘esc’, ‘i’, and ‘esc’ then ‘:’)
more vi practices – typing, moving the cursor, delete characters, remove a line, save file, quit vi.
Assignment – hello.sh

#!/bin/bash
echo "Hello World!"

Run your first script
About the #! (shebang) : which bash, sh text_filename.sh, ./text_fileneme.sh
file attributes: chmod, chown
The concept of using scripts

Keep your files and directories in order

File naming conventions
Copy, move, rename, deletion of files and directories – cp, mv, rm, rmdir, rm with options
The uses of * (star)