CBC DataTherapy Linux Introduction Week14

2y ago
13 Views
2 Downloads
2.37 MB
23 Pages
Last View : 30d ago
Last Download : 3m ago
Upload by : Hayden Brunner
Transcription

Introduction

Introduction: What is Unix? An operating systemDeveloped at AT&T Bell Labs in the 1960’sCommand Line InterpreterGUIs (Window systems) are now available

Introduction: Unix vs. Linux Unix was the predecessor of Linux Linux is a variant of Unix– So is Mac OS X, so much of this tutorial applies toMacs as well Linux is open source Most of the machines you’ll use in theBioinformatics program are running the LinuxOS

Linux os OSRedhatSUSEDebian .GentooCentOSRedhat

Introduction: Why Unix/Linux? Linux is free It’s fully customizable It’s stable (i.e. it almost never crashes) These characteristics make it an ideal OS forprogrammers and scientists

Connecting to a Unix/Linux system Open up a terminal:PuttyMac

Mac : Terminal : ssh your username@bbcsrv3.biotech.uconn.eduWindows : PuttyOpen Putty it will open window1.1. Provide host name e.g. ssh your username@bbcsrv3.biotech.uconn.eduExpandSSH tab and select X11 (shown in window2)2. Enable X11 forwarding by selecting it. (window2)3. Scroll up the left panel and select Session.(window1)4. Name your session e.g. BBC cluster and click save tab to save.5. Your session name should appear in saved sessions.Double click on your session name to connect to server with SSH session.

Connecting to a Unix/Linux system Open up a terminal:The “prompt”The current directory (“path”)The host

What exactly is a “shell”? After logging in, Linux/Unix starts another programcalled the shell The shell interprets commands the user types andmanages their execution The shell communicates with the internal part of the operatingsystem called the kernel The most popular shells are: tcsh, csh, korn, and bash The differences are most times subtle For this tutorial, we are using bash Shell commands are CASE SENSITIVE!

Unix/Linux File SystemNOTE: Unix file namesare CASE SENSITIVE!/home/mary//home/john/portfolio/The Path

Creating files in Unix/Linux Requires the use of an EditorVarious Editors:1) nano2) vim3) emacs

Login into remote serverssh -X your username @ host name ssh vsingh@bbcsrv3.biotech.uconn.eduBasic Linux commandspwdlsls -lls -als -Rls -t# Get full path of the present working directory(same as "echo HOME")# Content of pwd# Similar as ls, but provides additional info onfiles and directories# Includes all files including hidden files(.name) as well# Lists subdirectories recursively# Lists files in chronological order

Basic Linux commands cont .cd dir name cd# Brings you to the highest level of yourhome directory.cd .# Moves one directory upcd ././ # Moves two directories up (and so on)cd # Go back to you were previously (before the lastdirectory change)echo find ls # View the full (complete) path of your home# List all your files (including everything insub-directories)# List the top level files of your home directory

Basic Linux commands cont .mkdir dir name rmdir dir name rm file name rm -r dir name ####Creates specified directoryRemoves empty directoryRemoves file nameRemoves directory including itscontent, but asks for confirmation,'f'argument turns confirmation offcp name path # Copy file/directory as specified inpath (-r or -a to include content indirectories)mv name1 name2 # Renames directories or filesmv name path # Moves file/directory as specified in path

Basic Linux commands cont .man something # general help (press the 'q' key to exit)man wc# manual on program 'word count' wcwc --help# short help on wccat file1 # Print contents of file1cat file1 file2 cat.out # concatenate files in output file'cat.out’paste file1 file2 paste.out # merges lines of files andseparates them by tabs(useful for tables)cmp file1 file2 # tells you whether two files are identicaldiff fileA fileB # finds differences between two fileshead - number file # prints first lines of a filetail - number file # prints last lines of a file

Basic Linux commands cont .Files and permission“r” means “read only” permission“w” means “write” permission“x” means “execute” permissionIn case of directory, “x” grantspermission to list directory contentsxanadu-submit-ext total 892-rw-r--r-- 1 vsinghdrwxr-xr-x 7 vsingh-rw-r--r-- 1 vsinghdrwxr-xr-x 2 vsingh-rwxr-xr-x 1 vsingh-rw-r--r-- 1 vsingh ls –ldomaindomaindomaindomaindomaindomainusers257 Jun 2 09:18users 1601 May 2 21:26users499 Jun 2 00:39users 1431 Jun 2 00:39users 19384 Jun 16 12:07users649 Jun 14 13:30Other/world (safe: r-x) : oGroup (safe: r-x) : gUser : uFile(-) or directory (d).aening masurcaarrayjob.sharrayoutassemble xandu2.shbasemount cp.sh

Basic Linux commands cont .Change permissionIf you own the file, you can change it’s permissions with “chmod”Syntax: chmod [user/group/others/all] [permission] [file(s)]Below we grant execute permission to all:

Basic Linux commands cont .Running a program (a.k.a a job)Make sure the program has executable permissionschmod u x programUse “./” to run the program./ programINPUT/OUTPUT: STDIN STDOUT and redirecting (Pipes)program a file.txtprogram a’s output is written to a file called“file.txt”program a input.txtprogram a gets its input from a file called“input.txt”Programs can output to other programsCalled “piping”program a program bprogram a’s output becomes program b’s input

Exercise 1:Create a file myscript.sh:touch myscript.shCheck for file: lsOpen file to edit: vi myscript.sh: iWrite commands: interpretersave and exit::::Check permissions of file: ls –l myscript.shChange permission if required: chmod u x myscript.shRun script/Program: ./myscript.sh#!/bin/bashecho “Hello world”echo “This is my first script in Linux.”esc-:-w-q-!: sh myscript.shStore output to a file: sh myscript.sh myscript output.txtCheck the output (limited): less myscript output.txtprint the contents: cat myscript output.txtCount the number of lines: cat myscript output.txt wc -l

Transferring files between systemsFilezilla: https://filezilla-project.org/

1: Host: sftp://bbcsrv3.biotech.uconn.edu2: Username:3. Password4.Quickconnect

STDIN, STDOUT, STDERR, Redirections beginning-of-filename *ls filecommand my filecommand my filecommand tee my file#####* is wildcard to specify many filesprints ls output into specified fileuses file after ' ' as STDINappends output of one command to filewrites STDOUT to file and prints it toscreencommand my file; cat my file# writes STDOUT to file and prints it toscreencommand /dev/null# turns off progress info of applications byredirecting their output to /dev/nullgrep my pattern my file wc# Pipes ( ) output of 'grep' into 'wc'grep my pattern my non existing file 2 my stderr # prints STDERR to file file redirects stdout to file1 file redirects stdout to file2 file redirects stderr to file& file redirects stdout and stderr to file/dev/null is the null device it takes any input you want and throws it away. It can be used to suppress anyoutput.

xanadu-submit-ext ls –l total 892-rw-r--r--1 vsinghdomain users 257 Jun 2 09:18 . drwxr-xr-x 7 vsinghdomain users 1601 May 2 21:26 aening_masurca-rw-r--r--1 vsinghdomain users 499 Jun 2 00:39 arrayjob.sh drwxr-xr-x 2 vsinghdomain users 1431 Jun 2 00:39 arrayout-rwxr-xr-x 1 vsinghdomain users 19384 Jun 16 12:07 assemble_xandu2.sh

Related Documents:

AND active order (CBC OR CBC no differential, no platelets LAB OR CBC w/auto diff OR CBC w/auto diff/plt OR CBC with manual differential OR CBC w/ manual diff/plt OR CBC with diff OR CBC with differential OR CBC with differential, no platelets ) AND order frequency (Daily OR Every 24 ho

Linux in a Nutshell Linux Network Administrator’s Guide Linux Pocket Guide Linux Security Cookbook Linux Server Hacks Linux Server Security Running Linux SELinux Understanding Linux Network Internals Linux Books Resource Center linux.oreilly.comis a complete catalog of O’Reilly’s books on Linux and Unix and related technologies .

Other Linux resources from O’Reilly Related titles Building Embedded Linux Systems Linux Device Drivers Linux in a Nutshell Linux Pocket Guide Running Linux Understanding Linux Network Internals Understanding the Linux Kernel Linux Books Resource Center linu

Perfection PC Perfection PC Inc. Philips Philips Electronics Planar Planar Systems Inc PLEXON Plexon, Inc. Pogo Linux Pogo Linux, Inc. Pogo Linux Altura M2 Pogo Linux, Inc. Pogo Linux Velocity -D50 Pogo Linux, Inc. Pogo Linux Verona 330 Pogo Linux, Inc. Pogo Linux Vor

Official Kali Linux Documentation This PDF has been autogenerated on docs.kali.org - Apr 7, 2013 00. Introduction to Kali Linux What is Kali Linux ? Kali Linux is an advanced Penetration Testing and Security Auditing Linux distribution. Kali Linux Features Kali is a complete re-build of BackTrack Linux, adhering completely to Debian development .

2 LXC DOCKER MICHAEL LESSARD A bit of history - Virtualization and containers Chroot (version 7 Unix, 1979) FreeBSD Jails (FreeBSD 4, 2000) Linux vserver (Linux, Oct 2001) Para-virtualization Xen (Linux, 2003) Solaris zones (Solaris 10, 2004) OpenVZ (Linux, 2005) Full virtualization KVM (Linux, 2007) Linux Containers - LXC (Linux 2.6.29 2009)

Yes. Oracle Autonomous Linux, which is based on Oracle Linux, is 100% application binary compatible with IBM's Red Hat Enterprise Linux. This means that applications certified to run on Red Hat Enterprise Linux can run on Oracle Autonomous Linux unmodified. Oracle Linux binaries are provided for patching and updating Red Hat Enterprise Linux

Department of Aliens LAVRIO (Danoukara 3, 195 00 Lavrio) Tel: 22920 25265 Fax: 22920 60419 tmallod.lavriou@astynomia.gr (Monday to Friday, 07:30-14:30) Municipalities of Lavrio Amavissos Kalivia Keratea Koropi Lavrio Markopoulo . 5 Disclaimer Please note that this information is provided as a guide only. Every care has been taken to ensure the accuracy of this information which is not .