Introduction to Linux Basics

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

Introduction to Linux Basics Part I. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala

Using the computational resources at the GACRC

CISC 220 fall 2011, set 1: Linux basics

Introduction to the Linux Command Line

Introduction to GACRC Storage Environment. Georgia Advanced Computing Resource Center University of Georgia Zhuofei Hou, HPC Trainer

Introduction: What is Unix?

Introduction to GACRC Storage Environment. Georgia Advanced Computing Resource Center University of Georgia Zhuofei Hou, HPC Trainer

CS246 Spring14 Programming Paradigm Notes on Linux

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

Introduction to Linux. Fundamentals of Computer Science

Week 2 Lecture 3. Unix

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

Working with Basic Linux. Daniel Balagué

CHAPTER 1 UNIX FOR NONPROGRAMMERS

Operating Systems. Copyleft 2005, Binnur Kurt

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

Introduction to HPC Using zcluster at GACRC

Introduction to Linux

Introduction to Unix: Fundamental Commands

Introduction to Supercomputing

Introduction to Linux

High Performance Computing (HPC) Using zcluster at GACRC

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Chapter-3. Introduction to Unix: Fundamental Commands

Introduction of Linux

Welcome to Linux. Lecture 1.1

Linux & Shell Programming 2014

Perl and R Scripting for Biologists

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

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

Introduction to Unix and Linux. Workshop 1: Directories and Files

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

Mills HPC Tutorial Series. Linux Basics I

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

Introduction to Linux

Introduction to Linux

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

CS Fundamentals of Programming II Fall Very Basic UNIX

Introduction to HPC Using zcluster at GACRC

CSCI 2132 Software Development. Lecture 4: Files and Directories

INSE Lab 1 Introduction to UNIX Fall 2017

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

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

UNIX File Hierarchy: Structure and Commands

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage

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

A Brief Introduction to Unix

Introduction to Linux

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

Week 2. Exp 2 (a) (b): Introduction to LINUX OS, Installation of LINUX OS, Basic DOS commands

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

Practical 4. Linux Commands: Working with Directories

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

Introduction to High Performance Computing (HPC) Resources at GACRC

Introduction to Linux

Session 1: Accessing MUGrid and Command Line Basics

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

Introduction to Linux

Oxford University Computing Services. Getting Started with Unix

GNU/Linux Course Lesson 1. Puria Nafisi

Introduction to HPC Using the New Cluster at GACRC

Introduction to Linux Part I: The Filesystem Luca Heltai

Linux Shell Script. J. K. Mandal

Introduction to UNIX command-line

Outline. Structure of a UNIX command

CMSC 104 Lecture 2 by S Lupoli adapted by C Grasso

CSE 391 Lecture 1. introduction to Linux/Unix environment

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

Essential Linux Shell Commands

Unix Introduction to UNIX

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you.

CENG 334 Computer Networks. Laboratory I Linux Tutorial

EECS2301. Lab 1 Winter 2016

System Administration

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

CENG393 Computer Networks Labwork 1

Common UNIX Commands. Unix. User Interfaces. Unix Commands Winter COMP 1270 Computer Usage II 9-1. Using UNIX. Unix has a command line interface

Introduction to Cygwin Operating Environment

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

CS 300. Data Structures

INTRODUCTION TO LINUX

commandname flags arguments

Getting Started with UNIX

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

Linux Refresher (1) 310/ Fourth Workshop on Distributed Laboratory Instrumentation Systems (30 October - 24 November 2006)

LAB 8 (Aug 4/5) Unix Utilities

LAB 8 (Aug 4/5) Unix Utilities

The Unix Shell & Shell Scripts

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

Linux Command Line Primer. By: Scott Marshall

Computer Systems and Architecture

Python on GACRC Computing Resources

Introduction to Linux Workshop 1

Computer Architecture Lab 1 (Starting with Linux)

Linux Tutorial. Ken-ichi Nomura. 3 rd Magics Materials Software Workshop. Gaithersburg Marriott Washingtonian Center November 11-13, 2018

CSE 391 Lecture 1. introduction to Linux/Unix environment

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

Transcription:

Introduction to Linux Basics Part-I Georgia Advanced Computing Resource Center University of Georgia Zhuofei Hou, HPC Trainer zhuofei@uga.edu

Outline What is GACRC? What is Linux? Linux Command, Shell and Filesystem Concepts Linux Common Commands

What is GACRC? Who Are We? Georgia Advanced Computing Resource Center Collaboration between the Office of Vice President for Research (OVPR) and the Office of the Vice President for Information Technology (OVPIT) Guided by a faculty advisory committee (GACRC-AC) Why Are We Here? To provide computing hardware and network infrastructure in support of highperformance computing (HPC) at UGA Where Are We? http://gacrc.uga.edu (Web) http://wiki.gacrc.uga.edu (Wiki) https://wiki.gacrc.uga.edu/wiki/getting_help (Support) https://blog.gacrc.uga.edu (Blog) http://forums.gacrc.uga.edu (Forums)

What is Linux? What is Operating System (OS)? What is Linux OS? Brief History of Linux OS Why Linux OS?

What is Linux Operating System Operating System (OS) : Program initially loaded at booting time, to manage all the other application programs on a computer Software interface between computer hardware and its human user Needed for ALL computers to be operated Needed to run software and control hardware Popular OSes:

What is Linux Linux OS Linux OS is a full-fledged OS with 4 major parts: I. Kernel: Low-level OS, handling files, disks, RAM, networking, etc. II. Supplied Programs: Web browsing, Audio, Video, DVD burning III. The Shell: A command-line user interface for a user to type and execute commands: Bourne Shell (sh) Korn Shell (ksh) UNIX standard shells C Shell (csh) Bourne-Again Shell (bash) Linux default shell IV. X: A graphical system providing graphical user interface(gui)

What is Linux OS Brief History Originally was a kernel only, nothing else Combined with the various software and compilers from GNU Project to form an OS, called as GNU/Linux OS: Linux Kernel + GNU Components GNU/Linux OS Linux OS So, History of Linux = History of Linux Kernel + History of GNU Next Page

What is Linux OS Brief History of Linux Kernel Developed in 1991 by Linus Torvalds, a second year student, at the University of Helsinki, Finland Developed as a clone of UNIX OS, which is cheaper, can run on PC, and is nonproprietary Linux 0.02 released in 1991 consists of only the kernel and 3 utilities: Bash : a command-line interface (CLI) update : a utility to flush file system buffers gcc : a C++ compiler

What is Linux OS Brief History of GNU Project Started in 1983 by Richard Stallman. Launched in 1984 with a mission to develop a complete UNIX-like OS which is FREE for copying and modification GNU means GNU's Not Unix However, NO functional kernel developed by GNU itself Linux kernel was the BEST fit as the kernel for the GNU Project, SO

What is Linux OS Brief History Today, Linux OS is used by millions and available in the form of various Linux distributions: Linux is the most used OS on servers: As of February 2010, 6 out of 10 most reliable web hosting companies As of November 2014, 485 (97%) out of top 500 supercomputers Linux OS is supported by many big companies, such as IBM, Google, Sun, Novell, Oracle, HP, Dell, etc. (Data are cited from http://en.wikipedia.org/wiki/linux)

What is Linux OS Why Linux? Viruses FREE Very STABLE FREE Linux OS Never gets slow No need to defrag hard disk Highest degree to customize user s working environment Comes with most of the required software pre-installed Update all software with minimum labor

Linux Command, Shell and Filesystem Concepts What is a Command? What is a Shell? What is Filesystem?

Linux Command, Shell and Filesystem What s a Command A Linux command typically consists of a program followed by command options and arguments, typed within a shell: shell prompt $ wc l w file1 OR $ wc lw file1 file2 program argument command options combined command options multiple arguments Output: 15 86 file1 15 86 file1 100 2104 file2 115 2190 total # of lines # of words

Linux Command, Shell and Filesystem What s a Command A Linux command typically consists of a program followed by command options and arguments, typed within a shell: 3 general formats of command options: i. with no value : wc l -w ii. with a value: blastx thread 4 iii. combined: wc -lw 5 Tips: i. Linux command is ALWAYS case sensitive! ii. Press TAB key to autocomplete a command or filename Auto-completion iii. Press and arrow keys to look up previous commands Command history iv. Press CTRL+c to terminate a command v. How to use a command? Use command option --help, e.g., wc --help Use man command, e.g., man wc

Linux Command, Shell and Filesystem What s a Shell A place to type and run commands on a Linux system: Command-line user interface for typing commands Command interpreter to interpret & run commands Programming environment for scripting Linux default: Bourne-Again Shell (bash) To open a shell on: Local Linux/Mac shell window Terminal Local windows shell window Cygwin Remote Linux machine a shell will run immediately when log in

Linux Command, Shell and Filesystem What s Filesystem A internal data structure that OS uses to organize files on disk: Tree-structured & hierarchical Topmost directory: root directory (/) Each directory has one parent(except for /), may contain 0 or more subdirectories Files are collected in directories Files and directories are accessed by path: path 1: /home/mkl/mystuff/stuff path 2: /usr/local/ A path beginning with /: an absolute path

Linux Command, Shell and Filesystem What s Filesystem A internal data structure that OS uses to organize files on disk: Two special directories:. (a single dot) : your current directory.. (two dots in a row) : parent directory E.g. If current directory is /home/mkl path 1: go. = go /home/mkl path 2: go.. = go /home path 3: go../other = go /home/other path 4: go../../usr = go /usr A path not beginning with /: a relative path

Linux Command, Shell and Filesystem What s Filesystem A internal data structure that OS uses to organize files on disk: Filename naming convention: i. Good characters: A ~ Z or a ~ z, 0 ~ 9, _ (Underscore),. (Period), - (Dash) ii. Bad characters: special characters, e.g., $, *,?, /,, #, &, <, > and whitespace iii. Linux filename is ALWAYS case sensitive! iv. Not like Windows, no file extension needed in Linux! v. Max length of a filename is usually 255 characters Examples: i. Good: matrixdata1, matric_data_1, matrix.data.1, _testfile, 20150720, etc. ii. Bad: xy*z, x>y, $myfile, matrix data, datafile&, matrix data, etc.

Linux Common Commands Basic File Operations Directory Operations File Viewing Other Please do NOT do command practice on Login node of GACRC clusters! (For more complete list, please refer to GACRC Wiki: https://wiki.gacrc.uga.edu/wiki/command_list)

Linux Common Commands Basic File Operations ls : List files and subdirectories in a directory cp : Copy a file into another or a directory mv : Rename or move a file into a directory rm : Remove a file

Linux Common Commands Basic File Operations ls : List files and subdirectories in a directory ls -l ls -a ls -h List files with a long information listing List all files, including hidden configuration files, whose names begin with a dot, called as dot files List files with sizes in human readable format ls -lh Combination of -l and -h zcluster$ ls -lha -rw-r--r-- 1 jsmith abclab 336 Jul 16 10:06.bashrc dot file drwxr-xr-x 2 jsmith abclab 4.0K Jul 16 10:05 data subdirectory -rw------- 1 jsmith abclab 402 Jul 16 10:05 hello1.c C source code -rwxr-xr-x 1 jsmith abclab 188K Jul 16 10:05 hello1.x C binary -rw-r--r-- 1 jsmith abclab 252 Jul 16 10:05 README readme file -rw-r--r-- 1 jsmith abclab 131 Jul 16 10:05 sub1.sh shell script

Linux Common Commands Basic File Operations File Type # of Hard Links File Size Permissions Owners Last Modification Time File Name -rwxr-xr-x 1 jsmith abclab 188K Jul 16 10:05 hello1.x User Group Other User Group File Type: for Regular File d for Directory Permissions: r for Read (4) w for Write (2) x for Execute (1) To change permissions: chmod command User: (r+w+x)=7 Group: (r+x)=5 Other: (r+x)=5 hello1.x is a regular file with permissions of 755

Linux Common Commands Basic File Operations cp : Copy a file into another or a directory cp file1 file2 Copy a file into another cp file directory Copy a file into a directory cp i file1 file2 Copy with interactive mode, ask before overwriting zcluster$ cp hello1.c hello2.c zcluster$ cp hello1.c./data zcluster$ cp -i hello1.c hello2.c cp: overwrite `hello2.c'? n zcluster$ hello2.c is a new file copied from hello1.c./data is a subdirectory interactive mode is always safe!

Linux Common Commands Basic File Operations mv : Rename or move a file into a directory mv file1 file2 Rename a file mv file directory Move a file into a directory mv i file1 file2 Move with interactive mode, ask before overwriting zcluster$ mv hello1.c hello2.c zcluster$ mv hello1.c./data zcluster$ mv -i hello1.c hello2.c mv: overwrite `hello2.c'? n zcluster$ hello2.c is the file renamed from hello1.c./data is a subdirectory interactive mode is always safe!

Linux Common Commands Basic File Operations rm : Remove a file rm file rm i file Remove a file Remove with interactive mode, ask before deleting a file zcluster$ rm hello2.c hello2.c is removed from current directory zcluster$ rm -i hello2.c rm: remove regular file `hello2.c'? n zcluster$ interactive mode is always safe!

Linux Common Commands Directory Operations cd : Change your current working directory pwd : Print absolute path of your current working directory mkdir : Create a directory rmdir : Delete an empty directory rm r : Delete a nonempty directory and its contents

Linux Common Commands Directory Operations cd : Change your current working directory cd dirname Change to the dirname directory zcluster$ cd./date zcluster$ cd.. change to a subdirectory./data change to parent directory zcluster$ cd ~/test change to a subdirectory./test in home directory (~) zcluster$ cd /home/abclab/jsmith/test an absolute path is used! pwd : Print absolute path of your current working directory zcluster$ pwd /home/abclab/jsmith/test/data an absolute path is printed!

Linux Common Commands Directory Operations mkdir : Create a directory mkdir dirname Make a directory with the name of dirname zcluster$ mkdir data1 Create a subdirectory in current working directory rmdir : Delete an empty directory rmdir dirname Remove an empty directory zcluster$ rmdir data1 data1 is an empty directory! rm r : Delete a nonempty directory and its contents rmdir ri dirname Remove with interactive mode, ask before removing zcluster$ rm -ri data1 interactive mode is always safe!

Linux Common Commands File Viewing cat : Print files to standard output, concatenating them less : View text files, one screen at a time, scroll down/up more : View text files, one screen at a time, scroll down only

Linux Common Commands File Viewing cat : Print files to standard output, concatenating them cat file cat file1 file2 Print contents of file1 to standard output Print contents of files to standard output, concatenating them zcluster$ cat file1 Hello, this is file1. zcluster$ cat file2 Hello, this is file2. zcluster $ cat file1 file2 Hello, this is file1. Hello, this is file2. print contents of file1 print contents of file2 print contents of file1 and file2 with concatenation

Linux Common Commands File Viewing less : View text files, one screen at a time, scroll down and up less file zcluster$ less file1 View text one page at a time, spacebar to scroll down, key b to scroll up, key q to quit more : View text files, one screen at a time, scroll down only more file View text one page at a time, spacebar to scroll down, zcluster$ more file1

Linux Common Commands Other file : Determine the type of a file dos2unix : Convert DOS/Windows file to Linux format mac2unix : Convert Mac file to Linux format

Linux Common Commands Other file : Report the type of a file file file1 Report the type of the file file1 zcluster$ file data directory./data data: directory zcluster$ file hello1.c programming language source file hello1.c hello1.c: ASCII C program text zcluster$ file hello1.x executable file hello1.x hello1.x: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), not stripped zcluster$ file README ASCII text file README README: ASCII text zcluster$ file sub1.sh shell script sub1.sh sub1.sh: Bourne-Again shell script text executable

Linux Common Commands Other dos2unix : Convert DOS/Windows file to Linux format dos2unix file1 Removes DOS/Windows line endings in file1 zcluster$ dos2unix file1 mac2unix : Convert Mac file to Linux format mac2unix file1 Removes Mac line endings in file1 zcluster$ mac2unix file1

Thank You!