Introduction to the UNIX command line

Similar documents
Lab Working with Linux Command Line

Unix Introduction to UNIX

Linux Shell Script. J. K. Mandal

Mills HPC Tutorial Series. Linux Basics I

CENG 334 Computer Networks. Laboratory I Linux Tutorial

Linux & Shell Programming 2014

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 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.

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

Introduction: What is Unix?

Chapter-3. Introduction to Unix: Fundamental Commands

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

CS 3410 Intro to Unix, shell commands, etc... (slides from Hussam Abu-Libdeh and David Slater)

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

Physics REU Unix Tutorial

Version Control with Git

Getting Started With UNIX Lab Exercises

Introduction to Linux Workshop 1

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

Introduction to the Linux Command Line

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

CS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 1

AN INTRODUCTION TO UNIX

Linux Command Line Primer. By: Scott Marshall

UNIX ASSIGNMENT 1 TYBCA (Sem:V)

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

User Guide Version 2.0

CSCI 2132 Software Development. Lecture 5: File Permissions

Unix background. COMP9021, Session 2, Using the Terminal application, open an x-term window. You type your commands in an x-term window.

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]

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

Introduction to Linux Part 1. Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017

Computer Systems and Architecture

Working with Basic Linux. Daniel Balagué

CSE 15L Winter Midterm :) Review

Outline. Structure of a UNIX command

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

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

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 of Linux

Getting your department account

Basic UNIX Commands BASIC UNIX COMMANDS. 1. cat command. This command is used to create a file in unix. Syntax: $ cat filename

CSCI 2132 Software Development. Lecture 4: Files and Directories

Git & Github Fundamental by Rajesh Kumar.

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

Introduction to Linux. Fundamentals of Computer Science

Getting Started with UNIX

Linux/Cygwin Practice Computer Architecture

Introduction to Supercomputing

Set 1 MCQ Which command is used to sort the lines of data in a file in reverse order A) sort B) sh C) st D) sort -r

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

Computer Systems and Architecture

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

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

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

Course 144 Supplementary Materials. UNIX Fundamentals

IBM AIX Basic Operations V5.

Unix Tutorial. Beginner. CS Help Desk: Marc Jarvis (in spirit), Monica Ung, Corey Antoniuk 2015

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

CS/CIS 249 SP18 - Intro to Information Security

Introduction to Unix: Fundamental Commands

UNIX Essentials Featuring Solaris 10 Op System

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

CISC 220 fall 2011, set 1: Linux basics

Introduction to Linux

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

Lecture 01 - Working with Linux Servers and Git

CHAPTER 1 UNIX FOR NONPROGRAMMERS

The Unix Shell & Shell Scripts

Unix Basics. Systems Programming Concepts

Lab 1 1 Due Wed., 2 Sept. 2015

Basic Linux Command Line Interface Guide

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

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

CS CS Tutorial 2 2 Winter 2018

Basic Linux Command Line Interface Guide

Introduction to UNIX/Linux

Introduction to Linux

Using the Unix system. UNIX Introduction

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

Intro to Linux & Command Line

CS 261 Recitation 1 Compiling C on UNIX

Unix Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : December, More documents are freely available at PythonDSP

Lab 2A> ADDING USERS in Linux

Computer Architecture Lab 1 (Starting with Linux)

LAB 0: LINUX COMMAND LINE AND SVN

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

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

Chapter 4. Unix Tutorial. Unix Shell

CHAPTER - 1

Helpful Tips for Labs. CS140, Spring 2015

Introduction to Cygwin Operating Environment

Exercise 1: Basic Tools

CENG393 Computer Networks Labwork 1

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

Perl and R Scripting for Biologists

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

Transcription:

Introduction to the UNIX command line Steven Abreu Introduction to Computer Science (ICS) Tutorial Jacobs University s.abreu@jacobs-university.de September 19, 2017

Overview What is UNIX? UNIX Shell Commands Basic Commands Navigating Interacting with files Editing files using vi Permissions Environment Wildcards Git Further Information

UNIX UNIX is a family of operating systems. They are all: multitasking multiuser The operating system / kernel manages the computer s resources.

The UNIX Shell Users communicate with the kernel through the shell. You enter your commands for the shell in the command line interpreter. The command line interpreter translates your commands into a language that the kernel understands.

Basic Commands man xyz - displays a manual page for the command entered login - log in to your UNIX machine whoami - displays the current user name cal - displays a calendar passwd - change your password clear - clears your command line To exit a man page, press q.

Navigating in your file system pwd - displays the current working directory cd [x] - changes the current working directory ls - list files in your directory ls -l - list files with more information ls -a - list all files (also hidden ones) Press tab to complete your command.../ takes you into your parent directory../ takes you to your current directory. / specifies a sub-directory. ~ is your home directory.

Interacting with files touch file name - creates or touches a file (new timestamp) mkdir directory name - create a new directory rm [-i] file name - remove file cp f1 f2 - copies f1 to path of f2 mv f1 f2 - moves f1 to path of f2 (also renaming). Works for directories too. chmod - change permissions (later!) grep pattern file - returns all lines containing pattern in file cat file name - display content of a file (as text) vi file name - edit a file

Vi s modes Vi has two modes: 1. command mode: cursor movement, text deletion, pasting. Any insert or change command puts editor into insertion mode. 2. insertion mode: inserting and changing. [ESC] returns editor to command mode.

Editing files using vi 1. open the file using the vi command 2. enter insert mode by pressing i 3. use cheatsheet to look up all the commands 4. enter command mode by pressing [ESC] 5. exit and save your changes with :x

Permissions in UNIX Every file has permissions in UNIX. They are split up into three categories: 1. Owner permissions 2. Group permissions 3. Other (world) permissions We can check files permissions with ls -l

Changing file s permissions We can change a file s permissions using chmod. Categories: 1. u: changes owner s permissions 2. g: changes group s permissions 3. o: changes world s permissions Options: 1. +: add permissions 2. -: remove permissions 3. =: set permissions Permissions: 1. r: read 2. w: write 3. x: execute

Example - Changing file s permissions chmod o-wx - remove write and execute permissions from the world. chmod o=rwx - set world s permissions to read, write and execute. chmod g+x - add execute permission for the owner group.

The concept of environment An environment is defined by the environment variables. There are certain system variables saved in your UNIX environment. You can output variables using the echo command. Example: Type echo $TERM into your terminal window. This returns the type of terminal you are using.

Setting variables You can set variables like this: TEST = "ICS - UNIX Tutorial" You can then access your variables with $TEST You can print your variables like this: echo $TEST

Wildcards The UNIX command line knows two wildcards: 1. * represents any sequence of characters - also empty sequences 2.? represents any one character

Introduction to Git Git is a version control system. Widely used in software development. A git repository is a directory. Git stores all versions of your data as snapshots.

The three states in Git There are three main sections in a Git project: 1. Working Directory: when you modify your your data, you modify your working directory. 2. Staging Area: when you stage your data, you add snapshots of it to your staging area. 3. Repository: when you do a commit, Git takes all files from the staging area and stores them as one snapshot into your git repository.

Git from the command line To use Git in your terminal, you first need to install Git. Git commands: git init - initialize your current directory as a new git repository git add. - add all modified files to the staging area git commit -m your commit message - commit your changes to the repository git remote add... - add a remote repository git push... - push your changes (all your commits) to the remote git branch... - create a new branch in your repository git checkout... - check out one specific commit or branch in your repository

Further Information UNIX and Shell Commands: here Git: here and the official website