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

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

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

Introduction: What is Unix?

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

Introduction to Unix: Fundamental Commands

Chapter-3. Introduction to Unix: Fundamental Commands

Perl and R Scripting for Biologists

Introduction to the Linux Command Line

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

Introduction to Linux for BlueBEAR. January

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

Introduction to Linux. Augustine Abaris Research Computing Services Information Services & Technology

Getting Started with UNIX

CS Fundamentals of Programming II Fall Very Basic UNIX

CISC 220 fall 2011, set 1: Linux basics

Using WestGrid from the desktop Oct on Access Grid

Introduction to the UNIX command line

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

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

Introduction to the Linux Command Line January Presentation Topics

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

Operating Systems. Copyleft 2005, Binnur Kurt

Introduction to Linux

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Computer Systems and Architecture

Linux Shell Script. J. K. Mandal

CS CS Tutorial 2 2 Winter 2018

Exercise 1: Basic Tools

Carnegie Mellon. Linux Boot Camp. Jack, Matthew, Nishad, Stanley 6 Sep 2016

Introduction to Linux

Introduction to Linux

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Mauro Ceccanti e Alberto Paoluzzi

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Introduction to Supercomputing

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

Introduction of Linux

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

Introduction to Linux Basics

UNIX COMMANDS AND SHELLS. UNIX Programming 2015 Fall by Euiseong Seo

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Esercitazione Introduzione al linguaggio di shell

COMS 6100 Class Notes 3

Intermediate Programming, Spring Misha Kazhdan

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

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

Introduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie

EECS 470 Lab 5. Linux Shell Scripting. Friday, 1 st February, 2018

Introduction to Linux

LAB #5 Intro to Linux and Python on ENGR

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

Linux Command Line Primer. By: Scott Marshall

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

Computer Systems and Architecture

Oregon State University School of Electrical Engineering and Computer Science. CS 261 Recitation 1. Spring 2011

Introduction to Linux

CS370 Operating Systems

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

EE516: Embedded Software Project 1. Setting Up Environment for Projects

Lecture 01: welcome and intro what LSD and Unix have in common

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

Lab Working with Linux Command Line

INF322 Operating Systems

Introduction to Linux

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

Intro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab

CS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 1

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

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

Linux Training. for New Users of Cluster. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala

Commands are in black

Outline. Structure of a UNIX command

Introduction to Linux. May 9, 2010 Isaac Ye SHARCNET York University

Review of Fundamentals

Unix basics exercise MBV-INFX410

Unix Tutorial Haverford Astronomy 2014/2015

unix intro Documentation

A Brief Introduction to Unix

CSE 390a Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

Linux Essentials Objectives Topics:

Short Read Sequencing Analysis Workshop

Using Linux as a Virtual Machine

Practical Computing-II. Programming in the Linux Environment. 0. An Introduction. B.W.Gore. March 20, 2015

Introduction to Linux Organizing Files

CENG 334 Computer Networks. Laboratory I Linux Tutorial

AOS Linux Tutorial. Introduction to Linux. Michael Havas Dept. of Atmospheric and Oceanic Sciences McGill University. September 15, 2011

Practical Session 0 Introduction to Linux

Linux Command Line Interface. December 27, 2017

Lab 2: Linux/Unix shell

Introduction To. Barry Grant

Working with Basic Linux. Daniel Balagué

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1

Introduction to Linux

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]

Laboratory 1 Semester 1 11/12

Session 1: Accessing MUGrid and Command Line Basics

User Guide Version 2.0

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.

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.

Mills HPC Tutorial Series. Linux Basics I

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

Transcription:

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

We ll start with a sign in sheet. We ll end with a class evaluation. We ll cover as much as we can in the time allowed; if we don t cover everything, you ll pick it up as you continue working with Linux. This is a hands-on, lab class; ask questions at any time. Commands for you to type are in BOLD

The Most Common O/S Used By BU Researchers When Working on a Server or Computer Cluster

Linux is a Unix clone begun in 1991 and written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. 64% of the world s servers run some variant of Unix or Linux. The Android phone and the Kindle run Linux.

Linux is an O/S core written by Linus Torvalds and others AND a set of small programs written by Richard Stallman and others. They are the GNU utilities. http://www.gnu.org/

Network: ssh, scp Shells: BASH, TCSH, clear, history, chsh, echo, set, setenv, xargs System Information: w, whoami, man, info, which, free, echo, date, cal, df, free Command Information: man, info Symbols:, >, >>, <, ;, ~,.,.. Filters: grep, egrep, more, less, head, tail Hotkeys: <ctrl><c>, <ctrl><d> File System: ls, mkdir, cd, pwd, mv, touch, file, find, diff, cmp, du, chmod, find File Editors: gedit, nedit

You need a xterm emulation software that emulates an X terminal and that connects using the SSH Secure Shell protocol. Windows Use StarNet X-Win32: http://www.bu.edu/tech/support/desktop/ distribution/xwindows/xwin32/

Mac OS X Terminal is already installed Why? Darwin, the system on which Apple's Mac OS X is built, is a derivative of 4.4BSD-Lite2 and FreeBSD. In other words, the Mac is a Unix system!

Your Instructor Today The Ideal Lab Facility

X-Win32/X-Config Wizard Name: scc1 Type: ssh Host: scc1.bu.edu (Off-campus, must include domain bu.edu ) Login: <userid> Password: <password> Command: Linux Click scc1 then Launch Accept the host server public key (first time only)

Terminal Type ssh Y scc1.bu.edu (less secure)

From the lab computer Using File Explorer, copy the directory \\scvfiles.bu.edu\scv\training\2013 fall tutorials\linux_class to My Documents on your lab machine Linux Connect to scc1.bu.edu using X-Win32 and run this command: cp -Rv /project/earth/linux_class ~/ From a browser, download: http://ssrc.bu.edu/linux_class

A shell is a computer program that interprets the commands you type and sends them to the operating system. Secondly, it provide a programming environment consisting of environment variables. Most BU systems, including the BU Linux Cluster, support at least two shells: TCSH and BASH. The default shell for your account is TCSH. The most popular and powerful Linux shell today is BASH. To determine your shell type: echo $SHELL (shell prints contents of env echo $SHELL (shell still processes env. variable) echo $SHELL (shell treats env. variable as simple literal) The complete environment can be printed with set, setenv (TCSH) and set (BASH). To determine the path to the shell program, type: which bash which tcsh Change the shell with chsh /bin/bash (provide path to new shell as a parameter, meaning to be explained soon)

The Shell Output of the echo, which and chsh commands

After you connect, type shazam whoami hostname date cal free Commands have three parts; command, options and parameters. Example: cal j 3 1999. cal is the command, -j is an option (or switch), 3 and 1999 are parameters. Options have long and short forms. Example: date u data --universal What is the nature of the prompt? What was the system s response to the command?

System Information Output of the whoami, hostname, date, cal and free

Try the history command Try <Ctrl><r> (only works in BASH shell) Choose from the command history by using the up and down arrows What do the left and right arrow do on the command line? Try the <Del> and <Backspace> keys

Type hostname -help man hostname info hostname (gives the same or most information, but must be paged) And Yes, you can always Google it

The pipe feeds the OUTPUT of one command into the INPUT of another command. Our first example will use the pipe symbol to filter the output of a command. Try: w w grep root ps -e -o ruser,comm grep 'tut The ps command is using both options (dash) and parameters Try both man grep and info grep. See the difference?

The structure resembles an upside down tree Directories are collections of files and other directories. Every directory has a parent except for the root directory. Many directories have children directories. Unlike Windows, with multiple drives and multiple file systems, a *Nix system only has ONE file system.

The Linux File System A Typical Linux File System

Try tree L 3 d / less tree L 3 / less file /bin/alsac then press <tab> cd ~; pwd (This is your home directory where application settings are kept and where you have write privileges) ls mkdir mypics;mkdir mypics/work;mkdir mypics/friends;mkdir mypics/friends/bu; mkdir mypics/friends/mit tree mypics

Examining the File System Output from the tree, file, pwd and ls commands Demonstration of using the mkdir command

There are two types of pathnames Absolute (Abs) the full path to a directory or file; begins with the root symbol / Relative (Rel) a partial path that is relative to the current working directory Examples Abs cd /usr/local/lib echo $HOME (one of may environment variables maintained by the shell) Abs cd `echo $HOME` pwd Rel cd.. Rel cd.. Abs cd /lib (location OS shared libraries) ls d */ (a listing of only the directories in /lib)

Navigating the File System Moving around the file system using the cd command

More useful commands cd (also takes you to your home directory like cd ~) mkdir test echo Hello everyone > test/myfile.txt echo Goodbye all >> test/myfile.txt less test/myfile.txt mkdir test/subdir1/subdir2 (FAILS) mkdir -p test/subdir1/subdir2 (Succeeds) mv test/myfile.txt test/subdir1/subdir2 rmdir test (FAILS) rm Rv test (Succeeds)

Modifying the Linux File System Demonstration of the mkdir, less, mv, rmdir and rm commands

Useful options for the ls command: ls -a List all file including hidden file beginning with a period. ls -ld */ List details about a directory and not its contents ls -F Put an indicator character at the end of each name ls l Simple long listing ls lh Give human readable file sizes ls ls Sort files by file size ls lt Sort files by modification time

Emacs Vim Nedit Gedit Emacs and Vim are powerful editors used by most programmers. Nedit and Gedit and easy to learn editors useful for new users on a Linux system.