Introduction to the Linux Command Line January Presentation Topics

Similar documents
Introduction to Linux

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

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

Perl and R Scripting for Biologists

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

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

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

Introduction: What is Unix?

Chap2: Operating-System Structures

Basic UNIX commands. HORT Lab 2 Instructor: Kranthi Varala

System Administration

Introduction to UNIX Shell Exercises

Unix. Examples: OS X and Ubuntu

The Unix Shell & Shell Scripts

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

Lab 2: Linux/Unix shell

Introduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie

Computer Systems and Architecture

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

Introduction to Linux

Unix Basics. Systems Programming Concepts

CRUK cluster practical sessions (SLURM) Part I processes & scripts

Linux Command Line Interface. December 27, 2017

Introduction to Linux Organizing Files

CS CS Tutorial 2 2 Winter 2018

Traditional Access Permissions

Lec 1 add-on: Linux Intro

CS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 2

Command-line interpreters

Introduction To. Barry Grant

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

Unix Processes. What is a Process?

Lab Working with Linux Command Line

Working with Basic Linux. Daniel Balagué

CISC 220 fall 2011, set 1: Linux basics

Computer Systems and Architecture

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

Linux Command Line Primer. By: Scott Marshall

Linux Tutorial #6. -rw-r csce_user csce_user 20 Jan 4 09:15 list1.txt -rw-r csce_user csce_user 26 Jan 4 09:16 list2.

5/20/2007. Touring Essential Programs

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

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

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.

LOG ON TO LINUX AND LOG OFF

CSC209H Lecture 1. Dan Zingaro. January 7, 2015

CS370 Operating Systems

Mills HPC Tutorial Series. Linux Basics I

Introduction to Linux

Part 1: Basic Commands/U3li3es

Unix Tutorial Haverford Astronomy 2014/2015

Exercise 1: Basic Tools

UNIX Quick Reference

Introduction to the Linux Command Line

unix intro Documentation

Exploring UNIX: Session 5 (optional)

Linux Bootcamp Fall 2015

M2PGER FORTRAN programming. General introduction. Virginie DURAND and Jean VIRIEUX 10/13/2013 M2PGER - ALGORITHME SCIENTIFIQUE

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

Linux Shell Script. J. K. Mandal

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

Introduction to UNIX. Introduction EECS l UNIX is an operating system (OS). l Our goals:

The UNIX Shells. Computer Center, CS, NCTU. How shell works. Unix shells. Fetch command Analyze Execute

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

Welcome to Linux. Lecture 1.1

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

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

Unix tutorial. Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based.

DATA 301 Introduction to Data Analytics Command Line. Dr. Ramon Lawrence University of British Columbia Okanagan

Why learn the Command Line? The command line is the text interface to the computer. DATA 301 Introduction to Data Analytics Command Line

Introduction to the shell Part II

A Brief Introduction to Unix

Useful Unix Commands Cheat Sheet

Introduction to the Linux for HPC. Basic Linux for Beginner HPC Users

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

CENG 334 Computer Networks. Laboratory I Linux Tutorial

CSCI 2132 Software Development. Lecture 5: File Permissions

Introduction to Linux

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

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

Self-test Linux/UNIX fundamentals

Introduction to UNIX Command Line

Unix as a Platform Exercises. Course Code: OS-01-UNXPLAT

Unix Basics. Benjamin S. Skrainka University College London. July 17, 2010

Unix Introduction to UNIX

Introduction to Linux

Lecture 3. Unix. Question? b. The world s best restaurant. c. Being in the top three happiest countries in the world.

Bioinformatics. Computational Methods I: Genomic Resources and Unix. George Bell WIBR Biocomputing Group

Removing files and directories, finding files and directories, controlling programs

commands exercises Linux System Administration and IP Services AfNOG 2015 Linux Commands # Notes

Getting started with Hugs on Linux

Recap From Last Time:

Recap From Last Time: Setup Checklist BGGN 213. Todays Menu. Introduction to UNIX.

BGGN 213 Working with UNIX Barry Grant

CS 261 Recitation 1 Compiling C on UNIX

CSC UNIX System, Spring 2015

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

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

Shells. A shell is a command line interpreter that is the interface between the user and the OS. The shell:

CS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 1

Linux Kung Fu. Ross Ventresca UBNetDef, Fall 2017

Transcription:

1/22/13 Introduction to the Linux Command Line January 2013 Presented by Oralee Nudson ARSC User Consultant & Student Supervisor onudson@alaska.edu Presentation Topics Information Assurance and Security Awareness Feedback and Exercises Linux Overview Navigating the File System Connecting to Remote Systems Working with Files Working with Active Processes Customize the User Environment 1

Information Assurance and Security Awareness Download the ARSC Information Assurance pdf document or take the Information Systems Security Awareness course. Both are available here: www.arsc.edu/arsc/support/policy/ia Linux Overview Unix-like OS developed by Linus Torvalds in 1991 Open Source Software Runs on more computer hardware platforms than any other OS Run on Supercomputers, embedded systems The shell is a command line interface to the OS Open a terminal window Edit files Check the status of running processes Send signals to processes 2

Navigating the File System Linux is a collection of files and directories (think of folders) The top directory is called the root. Some directories contain actual files, others provide access to hardware devices Commands: pwd cd ls ls al ls $HOME mkdir rm filename rmdir rm rf directoryname Connecting to Remote Systems Login with: ssh X Y username@systemname.arsc.edu Example: ssh X Y nudson@pacman3.arsc.edu Copy files with: scp myfiles.tar.gz username@systemname.arsc.edu:~/phys693/ Example: scp myfiles.tar.gz nudson@pacman4.arsc.edu:~/phys693 Use a GUI: filezilla, fetch, winscp 3

Working with Files Common Text Editors vim or gvim emacs nedit Quickly view the contents of a file with: cat less Exit with q File Input/Output & Redirection Three forms of input/output: stdin from keyboard or a file stdout to screen or a file stderr to screen or a file Redirect I/O with Alligators, > or >> or < Pipes, Tie stdout and stderr together with 2>&1 mpirun $WORKDIR/wrf.exe > wrf.mix.out 2>&1 &! 4

File and Directory Permissions Permissions control access to files and directories Three categories of access: user group (type groups to determine which you belong to) other Three categories of permissions: read write execute Use chmod to modify access permissions chmod u+r mydir (add read permissions for myself) chmod g+rx myfile (add group read & execute permissions) chmod go-rwx myfile (remove group and other permissions) File and Directory Permissions Security Awareness: World write permissions are discouraged. ARSC Security policies on dot file permissions: http://www.arsc.edu/arsc/support/policy/ secpolicy/index.xml#dot! 5

Available Documentation Manual man and information pages are available for most commands. man ls man file man pwd info pwd man k pwd man 1p pwd Working with Active Processes ps allows you to view process statuses Useful variations ps elf and ps aux top to view what s eating up all the CPU resources! Exit with q Send a signal: CTRL+c (kill) CTRL+z (suspend) Search with grep, then sort 6

Common Linux Commands kill to terminate processes Send particular signals, e.g. kill KILL 3039 %./loop.sh & [1] 3039 % ps PID TTY TIME CMD 2779 pts/1 00:00:00 bash 3039 pts/1 00:00:00 loop.sh 3041 pts/1 00:00:00 sleep 3042 pts/1 00:00:00 ps % kill 3039 % ps PID TTY TIME CMD 2779 pts/1 00:00:00 bash 3055 pts/1 00:00:00 ps The & puts the process in the background. The process id for loop.sh is 3039. The sleep process was started by loop.sh and will be killed when loop.sh is killed Kill process 3039. The processes are gone Customizing the User Environment Environment Variables store short strings of information Important variables: $PATH, $HOME, $CENTER / $SCRATCH The shell auto-expands variables Set with bash: export CHUBBY_BUNNIES=funny! bash: export PATH=${PATH}:/u1/uaf/nudson/bin! csh/tcsh: setenv CHUBBY_BUNNIES funny! csh/tcsh: setenv PATH ${PATH}:/u1/uaf/nudson/bin! View with echo $CHUBBY_BUNNIES! 7

Customizing the User Environment Important info about $PATH Its how the shell searches for executables, so you don t have to enter the command s full path Order is important. is intentionally left out for security purposes Use./fun_script to run local scripts, or list out the entire path: /u1/uaf/nudson/fun_script env lists all environment variables currently set User Environment Customize your login by modifying your $HOME. files http://www.arsc.edu/arsc/support/news/hpcnews/ hpcnews361/index.xml#article2 Example for bash users: Add the following to your ~/.profile file: export PS1= Good Morning!% Then source the file with. ~/.profile 8

Special Shell Characters * matches anything? matches a single character & backgrounds a running process View the process status with ps Bring process back to foreground with fg Try with CTRL+Z Questions? consult@arsc.edu (907) 450-8602 Evaluation Form: http://www.arsc.edu/arsc/support/training/ trainingevalform/index.xml 9

Exercises http://people.arsc.edu/~bahls/classes/ exer.tar.gz 10