Unix. Examples: OS X and Ubuntu

Similar documents
Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

Introduction: What is Unix?

Linux Command Line Interface. December 27, 2017

Traditional Access Permissions

UNIX. The Very 10 Short Howto for beginners. Soon-Hyung Yook. March 27, Soon-Hyung Yook UNIX March 27, / 29

Part I. UNIX Workshop Series: Quick-Start

Introduction to the Linux Command Line January Presentation Topics

Unix Shells and Other Basic Concepts

Perl and R Scripting for Biologists

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1

CS CS Tutorial 2 2 Winter 2018

Introduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie

Mills HPC Tutorial Series. Linux Basics I

Linux for Beginners. Windows users should download putty or bitvise:

Review of Fundamentals

5/20/2007. Touring Essential Programs

Lec 1 add-on: Linux Intro

CENG 334 Computer Networks. Laboratory I Linux Tutorial

Using WestGrid from the desktop Oct on Access Grid

LAB #5 Intro to Linux and Python on ENGR

Crash Course in Unix. For more info check out the Unix man pages -orhttp:// -or- Unix in a Nutshell (an O Reilly book).

Lab #2 Physics 91SI Spring 2013

Assume that username is cse. The user s home directory will be /home/cse. You may remember what the relative pathname for users home directory is: ~

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Introduction to the shell Part II

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

CSCI 2132 Software Development. Lecture 3: Unix Shells and Other Basic Concepts

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1

Introduction To. Barry Grant

Linux Systems Administration Getting Started with Linux

Introduction to UNIX. SURF Research Boot Camp April Jeroen Engelberts Consultant Supercomputing

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

Linux Command Line Primer. By: Scott Marshall

bash startup files Linux/Unix files stty Todd Kelley CST8207 Todd Kelley 1

Setting up my Dev Environment ECS 030

Introduction To Linux

Lab 2: Linux/Unix shell

Traditional Access Permissions

9.2 Linux Essentials Exam Objectives

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

CS 246 Winter Tutorial 1

Introduction to Linux

Introduction to Linux for BlueBEAR. January

Introduction to the Linux Command Line

Basic UNIX commands. HORT Lab 2 Instructor: Kranthi Varala

Short Read Sequencing Analysis Workshop

Linux at the Command Line Don Johnson of BU IS&T

Version Control with Git

Getting Started With Cpsc (Advanced) Hosted by Jarrett Spiker

Introduction to remote command line Linux. Research Computing Team University of Birmingham

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

CSE 390a Lecture 4. Persistent shell settings; users/groups; permissions

Week 5 Lesson 5 02/28/18

CSE 390a Lecture 3. Multi-user systems; remote login; editors; users/groups; permissions

INTRODUCTION TO LINUX

Operating System Interaction via bash

UNIX Essentials Featuring Solaris 10 Op System

CS370 Operating Systems

Session 1: Accessing MUGrid and Command Line Basics

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:

Windows Subsystem for Linux Guide Documentation

INTRODUCTION TO BIOINFORMATICS

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Using bash. Administrative Shell Scripting COMP2101 Fall 2017

Unix basics exercise MBV-INFX410

CS197U: A Hands on Introduction to Unix

Connecting to ICS Server, Shell, Vim CS238P Operating Systems fall 18

Unix Processes. What is a Process?

Supercomputing environment TMA4280 Introduction to Supercomputing

Processes. Shell Commands. a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms:

: the User (owner) for this file (your cruzid, when you do it) Position: directory flag. read Group.

Command-line interpreters

CSE 390a Lecture 4. Persistent shell settings; users/groups; permissions

Assignment 1: Communicating with Programs

Chap2: Operating-System Structures

An Introduction to Unix Power Tools

Computer Systems and Architecture

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words

Introduction to UNIX Command Line

SBGrid RELION Workshop 2017

XSEDE Scholars Program Introduction to the Linux Environment. Tips and Tricks for Linux Users John Lockman III June 5 th, 2012

Unix Shell Environments. February 23rd, 2004 Class Meeting 6

Lab 1 Introduction to UNIX and C

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

Working With Unix. Scott A. Handley* September 15, *Adapted from UNIX introduction material created by Dr. Julian Catchen

Filesystem and common commands

Introduction. Let s start with the first set of slides

A Brief Introduction to Unix

Unix Introduction to UNIX

User Guide Version 2.0

Bashed One Too Many Times. Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009

Unix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011

UoW HPC Quick Start. Information Technology Services University of Wollongong. ( Last updated on October 10, 2011)

Command Line Interface Techniques

CS 143A. Principles of Operating Systems. Instructor : Prof. Anton Burtsev

ardpower Documentation

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

Essential Unix and Linux! Perl for Bioinformatics, ! F. Pineda

CSC209. Software Tools and Systems Programming.

Transcription:

The Command Line A terminal is at the end of an electric wire, a shell is the home of a turtle, tty is a strange abbreviation, and a console is a kind of cabinet. - Some person on SO

Learning Resources http://matt.might.net/articles/basic-unix/ http://matt.might.net/articles/settling-into-unix/ https://unix.stackexchange.com/ https://www.udacity.com/course/linux-command-line-basics--ud595

Unix Function over form (as opposed to Windows form over function) In Unix, a word is worth a thousand mouse clicks. More efficiency and quicker (once you get some experience) Can automate many tasks Examples: OS X and Ubuntu

Logging in with Git Bash Username: your email address Everything before @ All lowercase ssh <username>@grok Password It will ask you for a password. Initially this will be: HELLO_CLASS It will then prompt you to change your password You first must type HELLO_CLASS again Then your new password twice

SSH Keys Setup SSH Keys ssh-keygen t rsa ssh-copy-id <username>@grok <blank passphrase> Note: you will only have access to Grok for once semester, but you can get access for other classes if you request it Access Grok from off campus using the MSU VPN https://experts.missouristate.edu/display/kb/vpn

Copying Files rsync is my preferred command But scp is available with Git-Bash scp local_file aclark@grok:~/ scp aclark@grok:~/remote_file.

Basic Commands cd : change to a different directory (.,..,../..) ls : list files and directories in the current working directory pwd : print the current working directory cat : easy way to print a file (does quite a bit more though) less : read through a longer file (press q to quit) vim : pretty powerful command-line text editor (or nano or emacs) man : a command for accessing the manual of different commands grep : search for text inside files (ripgrep is better) find : search for files by name (fd is better) ssh : secure shell to remotely control a different computer

Basic Commands Every file and directory has: An owner, A group, and A set of permissions chmod chown chgrp : change file modes (permissions) : change the owner of a file : change the group of a file

Pipes, Redirection, and Flags/Options Most commands take input from STDIN Most commands write output to STDOUT Most commands write errors to STDERR Input and output act as if you were interacting with a Python program You can redirect STDIN and STDOUT using < and > You can use a pipe to direct one programs STDOUT to another s STDIN Many commands take flags to change the output ls -lah

Glob Matching You can use a * to match any number of unknown characters (*.py) You can use a? To match exactly one unknown character (*.c??) You can use [ ] to match a set of characters (*.c[px][px])

Environment Variables and PATH Run env to see all environment variables Available to all programs run in the shell PATH is a list of directories in which the shell will look for programs

Terminals and Consoles (or Konsole) tty: teletype, dating back to the late 1800s Interfacing with computers (a terminal or a physical console) These are terms for things you use to interact with a computer Examples: iterm, iterm2, konsole, xterm, etc. Now, when you hear terminal it is an emulated input/output device It is more or less just a GUI (or a windowed program) that acts like the old physical terminals/consoles

Shell A shell is the software that a user interacts with It interprets user commands and starts/runs/monitors other programs Examples: bash, fish, zsh Users can also write scripts in a language provided by the shell

Terminal or Shell? Terminal Handles key and turns them into control sequences Scroll-back history Acts on display commands Shell Handles control sequences Command history, tabcompletion, etc. Sets display info (color, text, etc.) Manages the prompt

Options on Windows 1. PuTTY: is a free implementation of SSH and Telnet for Windows and Unix platforms, along with an xterm terminal emulator. 2. Bash on Ubuntu on Windows: enabled by Windows Subsystem for Linux 3. Git for Windows: Git for Windows provides a BASH emulation used to run Git from the command line. It is essentially a Cygwin-derived shell using a terminal called mintty. Our choice out of these three options doesn t matter too much since we are just going to login to Grok. Cygwin: I m not going to consider this as an option, but you are free to try it out.

Options on Windows 1. PuTTY: is a free implementation of SSH and Telnet for Windows and Unix platforms, along with an xterm terminal emulator. 2. Bash on Ubuntu on Windows: enabled by Windows Subsystem for Linux 3. Git for Windows: Git for Windows provides a BASH emulation used to run Git from the command line. It is essentially a Cygwin-derived shell using a terminal called mintty. Our choice out of these three options doesn t matter too much since we are just going to login to Grok. Cygwin: I m not going to consider this as an option, but you are free to try it out.

Cygwin vs WSL You can think of Cygwin as a set of libraries that help you port code from POSIX to the Win API The WSL, on the other hand, let s you run ELF binaries directly on windows without porting It does this by effectively translating POSIX system calls to WIN system calls on the fly Wine is the opposite of Cygwin

Cygwin vs WSL You can think of Cygwin as a set of libraries that help you port code from POSIX to the Win API The WSL, on the other hand, let s you run ELF binaries directly on windows without porting It does this by effectively translating POSIX system calls to WIN system calls on the fly Wine is the opposite of Cygwin

For Reference: Customizing Bash on Grok ~/.bash_profile should be super-simple and just load.profile and.bashrc (in that order) ~/.profile ~/.bashrc has the stuff NOT specifically related to bash, such as environment variables (PATH and friends) has anything you'd want at an interactive command line. Command prompt, EDITOR variable, bash aliases for my use A few other notes: Anything that should be available to graphical applications OR to sh (or bash invoked as sh) MUST be in ~/.profile ~/.bashrc should not output anything Anything that should be available only to login shells should go in ~/.profile Ensure that ~/.bash_login does not exist.

https://blog.flowblok.id.au/2013-02/shell-startup-scripts.html