Carnegie Mellon Linux Boot Camp Jenna MacCarley, Peter Pearson, Shashank Goyal 9/19/2015.

Slides:



Advertisements
Similar presentations
Introduction to Linux command line for bioinformatics Wenjun Kang, MS Jorge Andrade, PhD 6/28/2013 Bioinformatics Core, Center.
Advertisements

Linux commands exercise 1. What do you need, if you try to these at home? You need to download and install Ubuntu Linux from the Internet – DVD is need.
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
Dayu Zhang 9/8/2014 Lab02. Example of Commands pwd --- show your current directory This is home of venus, not your home directory Tilde: means you are.
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Jan. 27 th, 2009 Essential Unix Commands.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
T UTORIAL OF U NIX C OMMAND & SHELL SCRIPT S 5027 Professor: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015.
CS1020: Intro Workshop. Topics CS1020Intro Workshop Login to UNIX operating system 2. …………………………………… 3. …………………………………… 4. …………………………………… 5. ……………………………………
Very Quick & Basic Unix Steven Newhouse Unix is user-friendly. It's just very selective about who its friends are.
Virtual Machine and UNIX. What is a VM? VM stands for Virtual Machine. It is a software emulation of hardware. By using a VM, you can have the same hardware.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
A Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  Currently there.
Linux Shell. 2 Linux Command-Line Interface ■ Linux shells: A shell is a command interpreter that allows you to type commands from the keyboard to interact.
Linux Commands LINUX COMMANDS.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Using the “CLI” Unix / Linux Preparation Course May 25 Djibouti.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
Unix Basics Chapter 4.
Introduction to Computer Organization & Systems Topics: Intro to UNIX COMP John Barr.
Dedan Githae, BecA-ILRI Hub Introduction to Linux / UNIX OS MARI eBioKit Workshop; Nov , 2014.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
The UNIX development environment CS 400/600 – Data Structures.
1 Editing a C Program 01/16/15. 2 Objective Use Linux to edit, compile and execute a C program.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.
Using Commands Unix / Linux Preparation Course May 6, 2012 Serrekunda, The Gambia.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
Introduction to Programming Using C An Introduction to Operating Systems.
Using the “CLI” Unix / Linux Preparation Course June 9, 2013 Lusaka, Zambia.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
Learning basic Unix command It 325 operating system.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Unix Lab Fall Shell Scripting ●Through the shell (LXTerminal) you can: ●Run programs. ●Interact with the file system. ●Change settings. ●Send/receive.
Learning Unix/Linux Based on slides from: Eric Bishop.
ENEE150 Discussion 01 Section 0101 Adam Wang.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Tutorial of Unix Command & shell scriptS 5027
A Basic Introduction to the Linux Commandline
CS1010: Intro Workshop.
Development Environment Basics
Chapter 11 Command-Line Master Class
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
UNIX The Basics Source:
Andy Wang Object Oriented Programming in C++ COP 3330
Some Linux Commands.
The Command Prompt Commands are the way to “do things” in Unix
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Web Programming Essentials:
Tutorial of Unix Command & shell scriptS 5027
Andy Wang Object Oriented Programming in C++ COP 3330
Command line.
Video Notes.
Lab 2: Terminal Basics.
Linux Commands LINUX COMMANDS.
Presentation transcript:

Carnegie Mellon Linux Boot Camp Jenna MacCarley, Peter Pearson, Shashank Goyal 9/19/2015

Carnegie Mellon Connecting SSH Windows users: PuTTY ( Mac/Linux users: Use ‘ssh’ command at terminal ssh Files Windows: Tectia file transfer Mac/Linux users: Use ‘scp’ command at terminal: scp –r /some/local/folder scp myfile.c

Carnegie Mellon A message from Peter…. FOR THE LOVE OF ALL THAT IS HOLY AND SACRED, USE THE SHARK MACHINES FOR ALL OF YOUR ASSIGNMENTS

Carnegie Mellon Welcome! $ ls $ cd private $ mkdir $ cd $ mv ~/Downloads/datalab-handout.tar. $ tar xvf datalab-handout.tar $ cd datalab-handout

Carnegie Mellon Some Nice Terminal Shortcuts ■Pressing tab will autocomplete file and folder names! ■ Control+C will stop execution of your current program! ■ Control+R will let you search your command history! ■ Control+L will clear your screen! ■ cmd arg1 … argN > file1.txt will put the output of cmd into file1.txt ! ■cmd arg1 … argN < file2.txt will pull the input of cmd from file2.txt ! ■Use the up and down arrow keys to scroll through your command history!

Carnegie Mellon Linux file pathing ■ ~ is your HOME DIRECTORY ■This is where you start from after you SSH in ■On bash, you can also use $HOME ■. is an alias for your PRESENT WORKING DIRECTORY! ■.. is the file path for the PARENT DIRECTORY of your present working directory! ■/ is the file path for the TOP-LEVEL DIRECTORY ■You probably won’t use this too much in this class

Carnegie Mellon ls - LiSt ■Lists the files in the present working directory, or, if specified, dir. ■ pwd tells you your Present Working Directory.

Carnegie Mellon cd - Change Directory ■Changes your present working directory to directory ■ Your main tool for navigating a unix file system

Carnegie Mellon mkdir - MaKe DIRectory ■Makes a directory dirname in your present working directory. ■Directories and folders are the same thing!

Carnegie Mellon mv - MoVe ■ cp works in exactly the same way, but copies instead ■for copying folders, use cp -r ■ dest can be into an existing folder (preserves name), or a file/folder of a different name ■Also used to re-name files without moving them ■ src can be either a file or a folder

Carnegie Mellon tar - Tape ARchive ■Compression utility, similar to zip files on Windows ■For full list of options, see man tar ■As name suggests, was used on tapes! ■ x - extract, v - verbose, f - file input ■All of our handouts will be in tar format.

Carnegie Mellon chmod ■ chmod is used to change the permissions of a file or directory. ■ 777 will give all permissions ■ src can be either a file or a folder

Carnegie Mellon scp ■Allows files to be copied to/from or between different hosts. ■The full path to the remote host needs to be specified ■Use the -r option to copy folders

Carnegie Mellon rm … - ReMove ■Essentially the delete utility ■To remove an (empty) directory, use rmdir ■To remove a folder and its contents, use rm -rf ▪ Please be careful, don’t delete your project. ▪ There is no “Trash” here. It’s gone. ▪ If someone asks you to use rm –rf / ignore them

Carnegie Mellon What’s in a file? (using cat ) ■ cat … lets you display the contents of a file in the terminal window. ■Use cat -n to add line numbers! ■You can combine multiple files into one! ■cat … > file.txt ■Good for seeing what’s in small files. ■Try cat -n bits.c. Too big, right?

Carnegie Mellon What’s in a file? (using less ) ■ less will give you a scrollable interface for viewing large files without editing them. ■To find something, use / ▪To view the next occurrence, press n ▪To view previous occurrence, press N ■To quit, use q ■Try it: Type “ /isPower2 ”

Carnegie Mellon What’s in a file? (using grep ) ■ grep will output any lines of file that have pattern as a substring ■ grep -v will output lines without pattern as substring ■ grep -R will search recursively ■Try it: grep ‘isPower2’ bits.c ■grep -v ‘*’ bits.c ■grep -R ‘unsigned’.

Carnegie Mellon man ■What is that command? What is this C standard library function? What does this library do? Check to see if it has a man page! ■Pages viewed with less ■Try it! ■man grep ■man tar ■man printf ■man strlen

Carnegie Mellon Editors (a touchy subject)

Carnegie Mellon Vim (vi – improved) Basics ■Some different modes: ■ Normal mode: ▪ The first mode you enter. Hit the escape key to return to this mode at any time ▪ Everything entered here is interpreted as a command ■ Command-line mode: ▪ Used for entering editor commands (necessary to save file & quit the editor) ▪ Enter “:” in Normal mode to get to this mode ■ Insert mode: ▪ To edit text ▪ Enter “i” in Normal mode to get to this mode

Carnegie Mellon Vim Basics ■Useful commands: ■Copying/pasting/deleting lines: ▪ yy (yank) or 5 yy (yank next 5 lines) ▪ dd (delete) or 5 dd (delete next 5 lines) ▪ p (paste) ■ Search (/search_string or ?search_string) ■Useful editor commands: ■Write (w) ■ Quit (q) quit no-save (q!)

Carnegie Mellon Vimrc File ■Stores vim configuration info ■Can make your editing experience even better! ■Notably: ■ Smart indentation ■ Line numbers ■ Changing tabs to default to 2 or 4 spaces ■ Colors ■To edit, type: vim ~/.vimrc

Carnegie Mellon Vim colors ■Download a.vim color scheme file from the web (or make your own) ■Copy to ~/.vim/colors folder (make this folder if it doesn’t exist) ■Some useful places to download color schemes: ■ ■ color-gallery/ color-gallery/ ■Makes your editor pretty!

Carnegie Mellon Jenna’s Vimrc File set tabstop=2 set shiftwidth=2 set expandtab set viminfo='100,h colorscheme desertedocean set number syntax on filetype on filetype indent on filetype plugin on set smartindent

Carnegie Mellon More resources on Vim ■A good intro tutorial: ■An interactive tutorial: ■man vim ■Google

Carnegie Mellon Commands related to ■ gdb, the GNU Debugger, will be used for bomb lab. ■ objdump –d displays the symbols in an executable. ■ gcc is the GNU C Compiler. ■ make reads a configuration file to run a series of commands. Often used for compiling your programs. ■We will provide other tools in the handouts as well

Carnegie Mellon