Unix Commands for Beginners

Total Page:16

File Type:pdf, Size:1020Kb

Unix Commands for Beginners Unix commands for beginners D. Puthier TAGC/Inserm, U1090, [email protected] Matthieu Defrance, ULB, [email protected] Stéphanie Le gras, Igbmc, [email protected] Christophe Blanchet, IFB, [email protected] MATE Desktop Demo Quick overview. Installation: http://www.france-bioinformatique.fr/?q=fr/core/cellule-infrastructure/documentation-cloud Dashboard: https://cloud.france-bioinformatique.fr/cloud/instance/ The terminal… Demo Type ‘ls’ in the terminal (list files) # list files root@vm: ls How can I speak to the terminal ● Answer : you can speak in BASH (Bourne Again Shell) * ○ BASH is one of numerous shell dialect (ksh, csh, zsh,...). ○ All this shell languages are extremely similar. ○ These languages are based on commands. ○ These modular commands allows one to perform tasks. * Reférence (calembour) au premier langage Shell écrit par Stephen Bourne :) Command prototype(s) (1) ● One command performs a task (sort, select, open, align reads,...). ● A command has arguments that may be facultative and modify the way it works. ● These arguments may take some values. ● Most of the time an instruction (command line) starts with a command name (or path to the command). ● In the example below we will say minus v’. # Argument without any associated value # depending on the command v means verbose, version (or other) fastqc -v # An argument with an associated value man -k jpeg Command prototype(s) (1) ● Most of the time arguments can be written in their short of long form (more explicit/better readability). ● Long form are generally precede with ‘--’ (for instance ‘minus minus apropos’) # Long form without any associated value. fastqc --version # Long form with an associated value. man --apropos jpeg Getting help ! Call you friends or better use man (manuel) # Demo root@vm: man ls # getting help about ls root@vm: man man # getting help about man ... Help shortcuts: /foo : search for ‘foo’. n : (next) next occurence of ‘foo’. p: (previous) previous occurrence of ‘foo’. q : quit help page. Our first command: ls The ls command and some of its arguments ● ls can take several arguments. ● Main arguments: ○ -l : (long) get lot of information. ○ -a (all) show all files including hidden files*. ○ -1 : show results as 1 column. ○ -t (time) sort results by date/time. ○ -r (reverse) reverse sort order. ● One can combine arguments ○ ls -l -a ○ ls -la * Under linux hidden files start with a ‘.’ (e.g ‘.thehiddenfile.txt’). The ls command and some of its arguments # Demo root@vm: ls # list files root@vm: ls -a # list files including hidden files * root@vm: ls -l # get lot of information about files root@vm: ls -1 # list file (one column) root@vm: ls -t # List file by modification date ** # Combining arguments root@vm: ls -rtl # lot of info, sort by date, reverse order * WARNING with spaces. Instruction should start with a command. The ls-a command does not exists ! ** Default sorting is case-sensitive sorting. Create directories and files File system tree ● The file system can be viewed as a tree in which nodes are directories or files. ● This tree has a root: / ● The root folder (/) contains ○ A root folder an various additional folder* ■ Under IFB machine your root folder contains a Documents folder * Under IFB VM, you are the root/sysadmin, this is a particular case. Hos should I refer to a file/directory ● 1) By specifying the path from the root. Absolute path. e.g; /root/Documents /root/Music ● 2) By referring to the current location/directory (the working/current directory). Relative path. Syntax for relative path # The upper directory relative to the working directory .. # Two directories up ../.. # Three ../../.. # The current working directory ./ File system: Demo pwd (print working directory); cd (change directory). * root@vm: pwd # The current working directory (/root) root@vm: cd /root/Documents # We go into Documents root@vm: pwd # /root/Documents root@vm: cd .. # go up one level (/root) root@vm: cd /root/Music # Go to the Music folder root@vm: pwd # /root/Music root@vm: cd ../.. # Go to the root of the file system root@vm: ls # You should see the root directory root@vm: cd /root/Music # Let’s go to the root/Music directory root@vm: cd ../Documents # And to the Document folder * Use complétion (tab key) for file, directories and commands. File system: some hints ● If you are the /root your data are stored in /root ○ i.e ‘user directory’ or home. ● ~ (tilda) contains the path to your home (same as $HOME). root@vm: cd / # At the root root@vm: pwd # / root@vm: cd ~/Documents # The Document directory of your home folder. root@vm: cd ~ # go to your home dir. root@vm: cd /usr/local/bin # Go to /usr/local/bin root@vm: ls ~ # list files in your ‘home’ directory root@vm: cd ~/Music # Go to the Music folder inside your home dir. root@vm: cd # == cd ~ Make directories ● We will use the mkdir (make directory) command. root@vm: mkdir projet_roscoff # Create a directory root@vm: cd ./projet_roscoff # == cd projet_roscoff * root@vm: mkdir rna-seq # Let’s create a folder root@vm: mkdir chip-seq dna-seq # and several sub-folders root@vm: ls -1 # list files and folders root@vm: cd chip-seq # == ./chip-seq root@vm: pwd # the current working dir root@vm: cd ../.. # go back home * ./ is most of the time facultative Hands on ● 1) go to ~/projet_roscoff/chip-seq ● 2) From this directory create a directory named annotation in ~/projet_roscoff/ ● Go inside annotation directory ● Check you are in the write place ● Go back home. Hands on ● 1) go to ~/projet_roscoff/chip-seq ● 2) From this directory create a directory named annotation in ~/projet_roscoff/ ● Go inside annotation directory ● Check you are in the write place ● Go back home. ● # Solution root@vm: cd ~/projet_roscoff/chip-seq root@vm: mkdir ../annotations root@vm: cd ../annotations root@vm: cd Manipulate files Download and uncompress files ● We will use the wget command to download files. ● To uncompress we will use gunzip if the file was compressed with the gzip algorithm (extension .gz) root@vm: cd ~/projet_roscoff/annotations # on se déplace dans annotations # On télécharge le fichier root@vm: wget http://pedagogix-tagc.univ-mrs.fr/courses/data/roscoff/hg19_exons.bed.gz root@vm: ls # le fichier compressé root@vm: ls # le fichier compressé root@vm: gunzip hg19_exons.bed # on le décompresse root@vm: ls # le fichier a perdu l’extension gz The hg19_exons.bed file Contains coordinates (start/end) of humand exons in bed format. Bed format (Bed6) ( http://genome.ucsc.edu/FAQ/FAQformat.html#format1 ) * Tabulated format (how to check that ???) Chromosome Start End Name Score Strand (Others…) * Start and End position are always given relative to the 5’/3’ orientation of the + strand. Coordinates are ‘zero-based, half-open’. Visualising file content ● With a pager: less or more (do more or less the same). ● With head ou tail to display the n first or n last lines of a file. ● The cat command allows to send file content to the screen. <ctrl> + c to cancel. ● The shortcuts for less are the same as for the man command. Raccourcis dans less: ↑ : go up. ↓ : go down. > : go to first line. < : go to last line. /foo : search for ‘foo’. n : next occurrence of foo. p: previous occurrence of foo q : quit. Hands on ● 1) Look at the ten first lines of hg19_exons.bed with head. ● 2) look at the ten last lines of hg19_exons.bed with tail. ● 3) Go through the hg19_exons.bed file with less. ● 4)Send file content to the screen with cat. Exercices ● 1) Look at the ten first lines of hg19_exons.bed with head. ● 2) look at the ten last lines of hg19_exons.bed with tail. ● 3) Go through the hg19_exons.bed file with less. ● 4)Send file content to the screen with cat. # Solution root@vm: head -n 10 hg19_exons.bed root@vm: tail -n 10 hg19_exons.bed root@vm: less hg19_exons.bed root@vm: cat hg19_exons.bed Counting line number This can be done with the wc (word count) command with -l (line) argument. root@vm: wc -l hg19_exons.bed # 484127 exons Extract columns ● Use the cut command with the -f (field) argument ● The columns must be tabulated or use the -d argument (‘delimiter’) root@vm: cut -f1 hg19_exons.bed # Column 1 root@vm: cut -f1,2 hg19_exons.bed # Columns 1 and 2 root@vm: cut -f3-5 hg19_exons.bed # Columns from 3 to 5 root@vm: cut -f3- hg19_exons.bed # Column 3 to the last column Sort a file ● On should use the sort command (alphabetic sorting by default). ○ -k (key): e.g ■ -k1,1: sort by column 1. ■ -k2,2nr: sort by column 2 using a numeric sorting in reverse order. ■ -k2,2g: sort by column 2 (decimal sorting). Example: sort hg19_exons.bed by chromosomes then by genomic coordinates: root@vm: sort -k1,1 -k2,2nr hg19_exons.bed Redirections Command pipes Input Output Input Output Input Output Commande Commande Commande Error Error Error ● Standard Input: a file or text stream. ● Standard output: screen by default. ● Standard error: may be capture for log purpose. Demo: command pipes Obtenir la liste de chromosomes présents dans le fichier root@vm: cut -f1 hg19_exons.bed | sort | uniq # La liste non-redondante des chromosomes Obtenir la liste des chromosomes présents dans le fichier et leur nombre root@vm: sort hg19_exons.bed | uniq -c # -c pour ‘count’ Compter le nombre de transcript non codant (contenant ‘NR_’). root@vm: cut -f4 hg19_exons.bed | grep "NR_" | sort | uniq | wc -l #11675 Note: La commande uniq permet d’éliminer les doublons dans un fichier trié. Note: la commande grep permet de chercher une chaîne de caractères. Exercices (notés) ● How many exons on chromosome 22 ? ● What is the most frequent chrom-start-end tuple ? ○ i.e The most frequent exon.
Recommended publications
  • At—At, Batch—Execute Commands at a Later Time
    at—at, batch—execute commands at a later time at [–csm] [–f script] [–qqueue] time [date] [+ increment] at –l [ job...] at –r job... batch at and batch read commands from standard input to be executed at a later time. at allows you to specify when the commands should be executed, while jobs queued with batch will execute when system load level permits. Executes commands read from stdin or a file at some later time. Unless redirected, the output is mailed to the user. Example A.1 1 at 6:30am Dec 12 < program 2 at noon tomorrow < program 3 at 1945 pm August 9 < program 4 at now + 3 hours < program 5 at 8:30am Jan 4 < program 6 at -r 83883555320.a EXPLANATION 1. At 6:30 in the morning on December 12th, start the job. 2. At noon tomorrow start the job. 3. At 7:45 in the evening on August 9th, start the job. 4. In three hours start the job. 5. At 8:30 in the morning of January 4th, start the job. 6. Removes previously scheduled job 83883555320.a. awk—pattern scanning and processing language awk [ –fprogram–file ] [ –Fc ] [ prog ] [ parameters ] [ filename...] awk scans each input filename for lines that match any of a set of patterns specified in prog. Example A.2 1 awk '{print $1, $2}' file 2 awk '/John/{print $3, $4}' file 3 awk -F: '{print $3}' /etc/passwd 4 date | awk '{print $6}' EXPLANATION 1. Prints the first two fields of file where fields are separated by whitespace. 2. Prints fields 3 and 4 if the pattern John is found.
    [Show full text]
  • Application for a Certificate of Eligibility to Employ Child Performers
    Division of Labor Standards Permit and Certificate Unit Harriman State Office Campus Building 12, Room 185B Albany, NY 12240 www.labor.ny.gov Application for a Certificate of Eligibility to Employ Child Performers A. Submission Instructions A Certificate of Eligibility to Employ Child Performers must be obtained prior to employing any child performer. Certificates are renew able every three (3) years. To obtain or renew a certificate: • Complete Parts B, C, D and E of this application. • Attach proof of New York State Workers’ Compensation and Disability Insurance. o If you currently have employees in New York, you must provide proof of coverage for those New York State w orkers by attaching copies of Form C-105.2 and DB-120.1, obtainable from your insurance carrier. o If you are currently exempt from this requirement, complete Form CE-200 attesting that you are not required to obtain New York State Workers’ Compensation and Disability Insurance Coverage. Information on and copies of this form are available from any district office of the Workers’ Compensation Board or from their w ebsite at w ww.wcb.ny.gov, Click on “WC/DB Exemptions,” then click on “Request for WC/DB Exemptions.” • Attach a check for the correct amount from Section D, made payable to the Commissioner of Labor. • Sign and mail this completed application and all required documents to the address listed above. If you have any questions, call (518) 457-1942, email [email protected] or visit the Department’s w ebsite at w ww.labor.ny.gov B. Type of Request (check one) New Renew al Current certificate number _______________________________________________ Are you seeking this certificate to employ child models? Yes No C.
    [Show full text]
  • Program #6: Word Count
    CSc 227 — Program Design and Development Spring 2014 (McCann) http://www.cs.arizona.edu/classes/cs227/spring14/ Program #6: Word Count Due Date: March 11 th, 2014, at 9:00 p.m. MST Overview: The UNIX operating system (and its variants, of which Linux is one) includes quite a few useful utility programs. One of those is wc, which is short for Word Count. The purpose of wc is to give users an easy way to determine the size of a text file in terms of the number of lines, words, and bytes it contains. (It can do a bit more, but that’s all of the functionality that we are concerned with for this assignment.) Counting lines is done by looking for “end of line” characters (\n (ASCII 10) for UNIX text files, or the pair \r\n (ASCII 13 and 10) for Windows/DOS text files). Counting words is also straight–forward: Any sequence of characters not interrupted by “whitespace” (spaces, tabs, end–of–line characters) is a word. Of course, whitespace characters are characters, and need to be counted as such. A problem with wc is that it generates a very minimal output format. Here’s an example of what wc produces on a Linux system when asked to count the content of a pair of files; we can do better! $ wc prog6a.dat prog6b.dat 2 6 38 prog6a.dat 32 321 1883 prog6b.dat 34 327 1921 total Assignment: Write a Java program (completely documented according to the class documentation guidelines, of course) that counts lines, words, and bytes (characters) of text files.
    [Show full text]
  • Administering Unidata on UNIX Platforms
    C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\ADMINUNIX\ADMINUNIXTITLE.fm March 5, 2010 1:34 pm Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta UniData Administering UniData on UNIX Platforms UDT-720-ADMU-1 C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\ADMINUNIX\ADMINUNIXTITLE.fm March 5, 2010 1:34 pm Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Notices Edition Publication date: July, 2008 Book number: UDT-720-ADMU-1 Product version: UniData 7.2 Copyright © Rocket Software, Inc. 1988-2010. All Rights Reserved. Trademarks The following trademarks appear in this publication: Trademark Trademark Owner Rocket Software™ Rocket Software, Inc. Dynamic Connect® Rocket Software, Inc. RedBack® Rocket Software, Inc. SystemBuilder™ Rocket Software, Inc. UniData® Rocket Software, Inc. UniVerse™ Rocket Software, Inc. U2™ Rocket Software, Inc. U2.NET™ Rocket Software, Inc. U2 Web Development Environment™ Rocket Software, Inc. wIntegrate® Rocket Software, Inc. Microsoft® .NET Microsoft Corporation Microsoft® Office Excel®, Outlook®, Word Microsoft Corporation Windows® Microsoft Corporation Windows® 7 Microsoft Corporation Windows Vista® Microsoft Corporation Java™ and all Java-based trademarks and logos Sun Microsystems, Inc. UNIX® X/Open Company Limited ii SB/XA Getting Started The above trademarks are property of the specified companies in the United States, other countries, or both. All other products or services mentioned in this document may be covered by the trademarks, service marks, or product names as designated by the companies who own or market them. License agreement This software and the associated documentation are proprietary and confidential to Rocket Software, Inc., are furnished under license, and may be used and copied only in accordance with the terms of such license and with the inclusion of the copyright notice.
    [Show full text]
  • DC Console Using DC Console Application Design Software
    DC Console Using DC Console Application Design Software DC Console is easy-to-use, application design software developed specifically to work in conjunction with AML’s DC Suite. Create. Distribute. Collect. Every LDX10 handheld computer comes with DC Suite, which includes seven (7) pre-developed applications for common data collection tasks. Now LDX10 users can use DC Console to modify these applications, or create their own from scratch. AML 800.648.4452 Made in USA www.amltd.com Introduction This document briefly covers how to use DC Console and the features and settings. Be sure to read this document in its entirety before attempting to use AML’s DC Console with a DC Suite compatible device. What is the difference between an “App” and a “Suite”? “Apps” are single applications running on the device used to collect and store data. In most cases, multiple apps would be utilized to handle various operations. For example, the ‘Item_Quantity’ app is one of the most widely used apps and the most direct means to take a basic inventory count, it produces a data file showing what items are in stock, the relative quantities, and requires minimal input from the mobile worker(s). Other operations will require additional input, for example, if you also need to know the specific location for each item in inventory, the ‘Item_Lot_Quantity’ app would be a better fit. Apps can be used in a variety of ways and provide the LDX10 the flexibility to handle virtually any data collection operation. “Suite” files are simply collections of individual apps. Suite files allow you to easily manage and edit multiple apps from within a single ‘store-house’ file and provide an effortless means for device deployment.
    [Show full text]
  • UNIX Cheat Sheet – Sarah Medland Help on Any Unix Command List a Directory Change to Directory Make a New Directory Remove A
    THE 2013 INTERNATIONAL WORKSHOP ON STATISTICAL METHODOLOGY FOR HUMAN GENOMIC STUDIES UNIX cheat sheet – Sarah Medland Help on any Unix command man {command} Type man ls to read the manual for the ls command. which {command} Find out where a program is installed whatis {command} Give short description of command. List a directory ls {path} ls -l {path} Long listing, with date, size and permisions. ls -R {path} Recursive listing, with all subdirs. Change to directory cd {dirname} There must be a space between. cd ~ Go back to home directory, useful if you're lost. cd .. Go back one directory. Make a new directory mkdir {dirname} Remove a directory/file rmdir {dirname} Only works if {dirname} is empty. rm {filespec} ? and * wildcards work like DOS should. "?" is any character; "*" is any string of characters. Print working directory pwd Show where you are as full path. Copy a file or directory cp {file1} {file2} cp -r {dir1} {dir2} Recursive, copy directory and all subdirs. cat {newfile} >> {oldfile} Append newfile to end of oldfile. Move (or rename) a file mv {oldfile} {newfile} Moving a file and renaming it are the same thing. View a text file more {filename} View file one screen at a time. less {filename} Like more , with extra features. cat {filename} View file, but it scrolls. page {filename} Very handy with ncftp . nano {filename} Use text editor. head {filename} show first 10 lines tail {filename} show last 10 lines Compare two files diff {file1} {file2} Show the differences. sdiff {file1} {file2} Show files side by side. Other text commands grep '{pattern}' {file} Find regular expression in file.
    [Show full text]
  • Types and Programming Languages by Benjamin C
    < Free Open Study > . .Types and Programming Languages by Benjamin C. Pierce ISBN:0262162091 The MIT Press © 2002 (623 pages) This thorough type-systems reference examines theory, pragmatics, implementation, and more Table of Contents Types and Programming Languages Preface Chapter 1 - Introduction Chapter 2 - Mathematical Preliminaries Part I - Untyped Systems Chapter 3 - Untyped Arithmetic Expressions Chapter 4 - An ML Implementation of Arithmetic Expressions Chapter 5 - The Untyped Lambda-Calculus Chapter 6 - Nameless Representation of Terms Chapter 7 - An ML Implementation of the Lambda-Calculus Part II - Simple Types Chapter 8 - Typed Arithmetic Expressions Chapter 9 - Simply Typed Lambda-Calculus Chapter 10 - An ML Implementation of Simple Types Chapter 11 - Simple Extensions Chapter 12 - Normalization Chapter 13 - References Chapter 14 - Exceptions Part III - Subtyping Chapter 15 - Subtyping Chapter 16 - Metatheory of Subtyping Chapter 17 - An ML Implementation of Subtyping Chapter 18 - Case Study: Imperative Objects Chapter 19 - Case Study: Featherweight Java Part IV - Recursive Types Chapter 20 - Recursive Types Chapter 21 - Metatheory of Recursive Types Part V - Polymorphism Chapter 22 - Type Reconstruction Chapter 23 - Universal Types Chapter 24 - Existential Types Chapter 25 - An ML Implementation of System F Chapter 26 - Bounded Quantification Chapter 27 - Case Study: Imperative Objects, Redux Chapter 28 - Metatheory of Bounded Quantification Part VI - Higher-Order Systems Chapter 29 - Type Operators and Kinding Chapter 30 - Higher-Order Polymorphism Chapter 31 - Higher-Order Subtyping Chapter 32 - Case Study: Purely Functional Objects Part VII - Appendices Appendix A - Solutions to Selected Exercises Appendix B - Notational Conventions References Index List of Figures < Free Open Study > < Free Open Study > Back Cover A type system is a syntactic method for automatically checking the absence of certain erroneous behaviors by classifying program phrases according to the kinds of values they compute.
    [Show full text]
  • Introduction to Linux – Part 1
    Introduction to Linux – Part 1 Brett Milash and Wim Cardoen Center for High Performance Computing May 22, 2018 ssh Login or Interactive Node kingspeak.chpc.utah.edu Batch queue system … kp001 kp002 …. kpxxx FastX ● https://www.chpc.utah.edu/documentation/software/fastx2.php ● Remote graphical sessions in much more efficient and effective way than simple X forwarding ● Persistence - can be disconnected from without closing the session, allowing users to resume their sessions from other devices. ● Licensed by CHPC ● Desktop clients exist for windows, mac, and linux ● Web based client option ● Server installed on all CHPC interactive nodes and the frisco nodes. Windows – alternatives to FastX ● Need ssh client - PuTTY ● http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html - XShell ● http://www.netsarang.com/download/down_xsh.html ● For X applications also need X-forwarding tool - Xming (use Mesa version as needed for some apps) ● http://www.straightrunning.com/XmingNotes/ - Make sure X forwarding enabled in your ssh client Linux or Mac Desktop ● Just need to open up a terminal or console ● When running applications with graphical interfaces, use ssh –Y or ssh –X Getting Started - Login ● Download and install FastX if you like (required on windows unless you already have PuTTY or Xshell installed) ● If you have a CHPC account: - ssh [email protected] ● If not get a username and password: - ssh [email protected] Shell Basics q A Shell is a program that is the interface between you and the operating system
    [Show full text]
  • The Ifplatform Package
    The ifplatform package Original code by Johannes Große Package by Will Robertson http://github.com/wspr/ifplatform v0.4a∗ 2017/10/13 1 Main features and usage This package provides the three following conditionals to test which operating system is being used to run TEX: \ifwindows \iflinux \ifmacosx \ifcygwin If you only wish to detect \ifwindows, then it does not matter how you load this package. Note then that use of (Linux or Mac OS X or Cygwin) can then be detected with \ifwindows\else. If you also wish to determine the difference between which Unix-variant you are using (i.e., also detect \iflinux, \ifmacosx, and \ifcygwin) then shell escape must be enabled. This is achieved by using the -shell-escape command line option when executing LATEX. If shell escape is not enabled, \iflinux, \ifmacosx, and \ifcygwin will all return false. A warning will be printed in the console output to remind you in this case. ∗Thanks to Ken Brown, Joseph Wright, Zebb Prime, and others for testing this package. 1 2 Auxiliary features \ifshellescape is provided as a conditional to test whether shell escape is active or not. (Note: new versions of pdfTEX allow you to query shell escape with \ifnum\pdfshellescape>0 , and the pdftexcmds package provides the wrapper \pdf@shellescape which works with X TE EX, pdfTEX, and LuaTEX.) Also, the \platformname command is defined to expand to a macro that represents the operating system. Default definitions are (respectively): \windowsname ! ‘Windows’ \notwindowsname ! ‘*NIX’ (when shell escape is disabled) \linuxname ! ‘Linux’ \macosxname ! ‘Mac OS X’ \cygwinname ! ‘Cygwin’ \unknownplatform ! whatever is returned by uname E.g., if \ifwindows is true then \platformname expands to \windowsname, which expands to ‘Windows’.
    [Show full text]
  • HEP Computing Part I Intro to UNIX/LINUX Adrian Bevan
    HEP Computing Part I Intro to UNIX/LINUX Adrian Bevan Lectures 1,2,3 [email protected] 1 Lecture 1 • Files and directories. • Introduce a number of simple UNIX commands for manipulation of files and directories. • communicating with remote machines [email protected] 2 What is LINUX • LINUX is the operating system (OS) kernel. • Sitting on top of the LINUX OS are a lot of utilities that help you do stuff. • You get a ‘LINUX distribution’ installed on your desktop/laptop. This is a sloppy way of saying you get the OS bundled with lots of useful utilities/applications. • Use LINUX to mean anything from the OS to the distribution we are using. • UNIX is an operating system that is very similar to LINUX (same command names, sometimes slightly different functionalities of commands etc). – There are usually enough subtle differences between LINUX and UNIX versions to keep you on your toes (e.g. Solaris and LINUX) when running applications on multiple platforms …be mindful of this if you use other UNIX flavours. – Mac OS X is based on a UNIX distribution. [email protected] 3 Accessing a machine • You need a user account you should all have one by now • can then log in at the terminal (i.e. sit in front of a machine and type in your user name and password to log in to it). • you can also log in remotely to a machine somewhere else RAL SLAC CERN London FNAL in2p3 [email protected] 4 The command line • A user interfaces with Linux by typing commands into a shell.
    [Show full text]
  • Software Developement Tools Introduction to Software Building
    Software Developement Tools Introduction to software building SED & friends Outline 1. an example 2. what is software building? 3. tools 4. about CMake SED & friends – Introduction to software building 2 1 an example SED & friends – Introduction to software building 3 - non-portability: works only on a Unix systems, with mpicc shortcut and MPI libraries and headers installed in standard directories - every build, we compile all files - 0 level: hit the following line: mpicc -Wall -o heat par heat par.c heat.c mat utils.c -lm - 0.1 level: write a script (bash, csh, Zsh, ...) • drawbacks: Example • we want to build the parallel program solving heat equation: SED & friends – Introduction to software building 4 - non-portability: works only on a Unix systems, with mpicc shortcut and MPI libraries and headers installed in standard directories - every build, we compile all files - 0.1 level: write a script (bash, csh, Zsh, ...) • drawbacks: Example • we want to build the parallel program solving heat equation: - 0 level: hit the following line: mpicc -Wall -o heat par heat par.c heat.c mat utils.c -lm SED & friends – Introduction to software building 4 - non-portability: works only on a Unix systems, with mpicc shortcut and MPI libraries and headers installed in standard directories - every build, we compile all files • drawbacks: Example • we want to build the parallel program solving heat equation: - 0 level: hit the following line: mpicc -Wall -o heat par heat par.c heat.c mat utils.c -lm - 0.1 level: write a script (bash, csh, Zsh, ...) SED
    [Show full text]
  • BIMM 143 Introduction to UNIX
    BIMM 143 Introduction to UNIX Barry Grant http://thegrantlab.org/bimm143 Do it Yourself! Lets get started… Mac Terminal PC Git Bash SideNote: Terminal vs Shell • Shell: A command-line interface that allows a user to Setting Upinteract with the operating system by typing commands. • Terminal [emulator]: A graphical interface to the shell (i.e. • Mac users: openthe a window Terminal you get when you launch Git Bash/iTerm/etc.). • Windows users: install MobaXterm and then open a terminal Shell prompt Introduction To Barry Grant Introduction To Shell Barry Grant Do it Yourself! Print Working Directory: a.k.a. where the hell am I? This is a comment line pwd This is our first UNIX command :-) Don’t type the “>” bit it is the “shell prompt”! List out the files and directories where you are ls Q. What do you see after each command? Q. Does it make sense if you compare to your Mac: Finder or Windows: File Explorer? On Mac only :( open . Note the [SPACE] is important Download any file to your current directory/folder curl -O https://bioboot.github.io/bggn213_S18/class-material/bggn213_01_unix.zip curl -O https://bioboot.github.io/bggn213_S18/class-material/bggn213_01_unix.zip ls unzip bggn213_01_unix.zip Q. Does what you see at each step make sense if you compare to your Mac: Finder or Windows: File Explorer? Download any file to your current directory/folder curl -O https://bioboot.github.io/bggn213_S18/class-material/bggn213_01_unix.zip List out the files and directories where you are (NB: Use TAB for auto-complete) ls bggn213_01_unix.zip Un-zip your downloaded file unzip bggn213_01_unix.zip curlChange -O https://bioboot.github.io/bggn213_S18/class-material/bggn213_01_unix.zip directory (i.e.
    [Show full text]