Survival Command Line
Total Page:16
File Type:pdf, Size:1020Kb
ABSTRACT Survival This short workshop will provide hands-on overview of commands in a text Terminal. We'll review the handful of commands that are most useful. command line JEAN-YVES SGRO for Text Terminal workshops :14 The Biochemistry Computational Research Facility (BCRF) provides access to a computational computer cluster and hands-on tutorials Image credits: Wingding font icons Workbook – © 2019 – All Rights Reserved Corresponding author: Jean-Yves Sgro - [email protected] - All rights reserved. Instructor: Jean-Yves Sgro, Ph.D Distinguished & Data Scientist II. Biotechnology Center & Biochemistry Dept. Biochemistry Office: 433 Babcock Drive, room 201 Madison WI 53706 Email: [email protected] Survival command-line for Biologists Jean-Yves Sgro December 03,2019 INTRODUCTION ....................................................................................................................................................................... 3 Learning objectives: ............................................................................................................................................................................... 3 TERMINAL AND SHELL .......................................................................................................................................................... 5 Text terminal ............................................................................................................................................................................................ 5 The shell ...................................................................................................................................................................................................... 5 Shells ............................................................................................................................................................................................................. 6 SET-UP ........................................................................................................................................................................................ 7 WORKING IN TERMINAL ...................................................................................................................................................... 8 Username .................................................................................................................................................................................................... 8 Home ............................................................................................................................................................................................................. 8 Prompt ......................................................................................................................................................................................................... 9 Preferences, $ and Variables .............................................................................................................................................................. 9 Home anD username revisiteD ........................................................................................................................................................ 10 Who am I .................................................................................................................................................................................................. 10 Where am I looKing ............................................................................................................................................................................. 11 HARD DRIVE: WHERE THINGS ARE ............................................................................................................................... 12 Summary so far: .................................................................................................................................................................................... 13 DIRECTORIES ........................................................................................................................................................................ 15 New Directories ..................................................................................................................................................................................... 15 Path ............................................................................................................................................................................................................ 18 Home again ............................................................................................................................................................................................. 18 FILES ........................................................................................................................................................................................ 19 Exploring file contents ....................................................................................................................................................................... 19 File editing .............................................................................................................................................................................................. 21 CompresseD web files .......................................................................................................................................................................... 22 Section summary: ................................................................................................................................................................................. 24 STREAMS AND PIPES: KEY CONCEPTS .......................................................................................................................... 25 StanDard input anD output .............................................................................................................................................................. 25 Data stream and pipes ....................................................................................................................................................................... 26 Redirection .............................................................................................................................................................................................. 27 Pipes ........................................................................................................................................................................................................... 28 REMOTE CONNECTION ....................................................................................................................................................... 30 SUMMARY ............................................................................................................................................................................... 31 Concepts ................................................................................................................................................................................................... 31 Symbols ..................................................................................................................................................................................................... 31 1 CommanDs learneD or mentioneD: ............................................................................................................................................... 32 RESOURCES .................................................................................................................................................................................................. 33 REFERENCES .......................................................................................................................................................................... 34 2 Introduction This short tutorial/workshop is meant to review and understand basic command-line as they are typed on a text terminal. This specific workshop will focus on Macintosh Terminal, but most commands would also work on all Unix-style operating system (Linux, or Windows with added software.) The goal is to review the most useful commands in order to operate the terminal for later workshops including those focused on Docker. Learning objectives: The main objective is to become at ease with the command-line to perform routine tasks: • Open a Terminal • Understand the computer organization (file structure and “path”) • Create, delete and navigate directories • Create, delete, explore and edit text files • Download Internet data files • Apply key concepts (standards and streams) to tasks 3 digital VT100 text terminal DEC VT100 terminal at the Living Computer Museum (apparently connected to the museum's DEC PDP- 11/70). Introduced in August 1978 by Digital Equipment Corporation (DEC) Jason Scott - Flickr: IMG_9976 CC BY 2.0 Source: https://commons.wikimedia.org/wiki/File:DEC_VT100_terminal.jpg 4 Terminal and Shell Text terminal In the early 1990’s “dumb terminals” were still used to access a remote, shared computer. The terminal was called “dumb” because it did not contain any operating system. The digital VT100 (“VT100” 2019) was a very popular terminal: In contrast, a “personal