CS4350 Unix Programming. Outline

Size: px
Start display at page:

Download "CS4350 Unix Programming. Outline"

Transcription

1 Outline Unix Management Files and file systems Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission (owner, group, rwx) File and directory management (link) Disk, process and memory System and user files vi and emacs commands Spring 2019 Husain Gholoom Lecturer in Computer Science Page 1

2 Unix Management Three every day managements: Manage files Manage users Manage processes Other managements: Manage hardware Spring 2019 Husain Gholoom Lecturer in Computer Science Page 2

3 Files and File Systems In UNIX, all files are organized in a single directory tree, regardless of where they are stored physically. There are two main types of files: Plain files (containing data). Directories ( folders ), containing both plain files (optionally) and other directories. Unix directories contain: One parent. N children (sub-directories). Files and links. Each file in a directory is identified by its name and has a number of attributes: Name Type Owner Group (each file belongs to one group, even if the owner belongs to multiple groups) Access rights Access dates Spring 2019 Husain Gholoom Lecturer in Computer Science Page 3

4 Files in the directory trees are described by pathname. Pathnames consist of file names, separated by slashes (/) Spring 2019 Husain Gholoom Lecturer in Computer Science Page 4

5 Directory Structure Spring 2019 Husain Gholoom Lecturer in Computer Science Page 5

6 Structure of a UNIX command $ command [ [ - ] option (s) ] [ option argument (s) ] [ command argument (s) ] Examples: $ whoami Help on UNIX The UNIX Programmer s Manual ( man pages ) Traditionally available on every UNIX system, quite terse Usage: man [section] <command> Sections (may differ by UNIX favor): 1. User commands 2. System calls 3. C library routines 4. Device drivers and network interfaces 5. File formats 6. Games and demos 7. Misc. (ASCII, macro packages, tables, etc) 8. Commands for system administration 9. Locally installed manual pages. (i.e. X11) man -k <term> gives you a list of pages relevant to <term> To leave the man program (or rather the pager it uses), hit q Spring 2019 Husain Gholoom Lecturer in Computer Science Page 6

7 man [options][-s section] command-list Example : $ man printf NAME printf -- formatted output SYNOPSIS printf format [arguments...] DESCRIPTION The printf utility formats and prints its arguments, after the first, under control of the format. The format is a character string which contains three types of objects: plain characters, which are simply copied to standard output, character escape sequences which are converted and copied to the standard output, and format specifications, each of which causes printing of the next successive argument. The arguments after the first are treated as strings if the corresponding format is either c, b or s; otherwise it is evaluated as a C constant, with the following extensions: A leading plus or minus sign is allowed. If the leading character is a single or double quote, the value is the ASCII code of the next character. The format string is reused as often as necessary to satisfy the arguments. Any extra format specifications are evaluated with zero or the null string. If the leading character is a single or double quote, the value is the ASCII code of the next character. Spring 2019 Husain Gholoom Lecturer in Computer Science Page 7

8 Character escape sequences are in backslash notation as defined in the ANSI X (``ANSI C89''), with extensions. The characters and their meanings are as follows: \a Write a <bell> character. \b Write a <backspace> character. \c Ignore remaining characters in this string. \f Write a <form-feed> character. \n Write a <new-line> character. \r Write a <carriage return> character. \t Write a <tab> character. \v Write a <vertical tab> character. \' Write a <single quote> character. More Help on UNIX Commands whatis, which, whereis, info Google $ whatis login setenv login(1) -sign on setenv (1) -change or add an environment variable $ which mkdir /usr/bin/mkdir $ whereis mkdir mkdir: /usr/bin/mkdir $ info File: dir Node: Top This is the top of the INFO tree This (the Directory node) gives a menu of major topics. Typing "q" exits, "?" lists all Info commands, "d" returns here, "h" gives a primer for first-timers, "memacs<return>" visits the Emacs topic, etc.. Spring 2019 Husain Gholoom Lecturer in Computer Science Page 8

9 Logging On and Logging Off Text mode Local: UNIX terminal Remote: SSH Connecting via UNIX Terminal login: your_username <Enter> password: your_password <Enter> [yourname ~]$type_command_here Where's UNIX Linux Red Hat, SUSE, Debian, etc Windows Cygwin ( Solaris, AIX, HP UX Sun, IBM, HP Mac OS X FreeBSD Spring 2019 Husain Gholoom Lecturer in Computer Science Page 9

10 Secure Shell on a Windows PC You can download the Secure Shell client (or putty) from the CS departmental download server Select os then windows then remote access, then SSHSecureShellClient exe (then install it). To run: double click on Secure Shell Client icon Click Quick Connect and enter a host machine: hercules.cs.txstate.edu Enter username and password. Spring 2019 Husain Gholoom Lecturer in Computer Science Page 10

11 Navigating Unix So you log in Where am I in the tree? pwd Present Working Directory How do I go up and down the tree? cd Change Directory cd.. Up one directory cd ~ Your home directory cd ~<user> Home directory of <user> cd <path> Go to <path> Paths /home/user3/dir1 Spring 2019 Husain Gholoom Lecturer in Computer Science Page 11

12 Absolute Paths cd /home/user3/dir1 Relative Paths cd../home/user3 Spring 2019 Husain Gholoom Lecturer in Computer Science Page 12

13 Navigating Unix What files are here? ls Lists the names of files in your default directory, in alphabetical order. ls a ls l List ALL files. Including those files that begin with a period (i.e., hidden files). List files AND details. In addition to the file name, the long listing shows protection information, file owner, number of characters in file, and the date and time of the last change to the file. Generally, - enables switches You can combine switches ls la List ALL files AND details Spring 2019 Husain Gholoom Lecturer in Computer Science Page 13

14 Permissions drwxr--r-- directory -rwxr--r-- file -rwxr--r-- link ( hard ) drwxr--r-- rwx - read - write - execute 1st three - Owner (usually creator) 2nd three - Group (your friends) 3rd three Everyone Examples Files -rw Only owner can read and write -rwxrwxrwx Everyone can read, write and execute -rw-r--r-- Everyone can read, only owner can write Spring 2019 Husain Gholoom Lecturer in Computer Science Page 14

15 Examples Directories drwx Only owner can view, cd into, and delete drwxrwx--- Owner and group can view, write, etc. drwxr-xr-x Everyone can cd into but only owner can modify chmod Change Mode Change mode for who? ugoa user, group, others, or all Grant or deny access? + grant access - deny access Change which mode? rwx same as before Spring 2019 Husain Gholoom Lecturer in Computer Science Page 15

16 Examples : Add read access to "myfile" for group chmod g+r myfile Add write access to "myfile" for group chmod g+w myfile Deny read access for others chmod o-r myfile Add read and write access for user chmod u+rw myfile Give full group read/write access to directory "mydir" chmod g+rwx mydir Permissions Common mistake Directory without x enabled Program without x enabled File without r enabled File without w enabled Security Directory and files with rw enabled for others Spring 2019 Husain Gholoom Lecturer in Computer Science Page 16

17 File Create/Destroy The simple approach to create a file touch creates a file of size 0. For example : touch newfile.txt Creates a file known as "newfile.txt", if the file does not already exist. If the file already exists the accessed and modification time is updated for the file newfile.txt To delete one or multiple files rm <file> deletes the file. You will be asked to confirm that you really want to delete the file. Type y or n as appropriate and press Return. rm file1.* delete all files that starts with with file1 such as file1.txt, file1.html etc To avoid to answer yes for every file: rm f <file> Spring 2019 Husain Gholoom Lecturer in Computer Science Page 17

18 File Viewing Quick cat <file> Short for concatenate, it just displays the file to the screen. more <file> Like cat, this shows the entire contents of a file, but prompts you for more? between each page. Hit the space bar to go to the next page, or use the up and down arrows. Hit q to quit. less <file> This is another pager like more, i.e. it shows one page at a time. Slow emacs vim File Copy and Move Copy source to destination cp <source> <destination> Move source to destination mv <source> <destination> rename a file To recursively copy or move cp/mv R <source> <destination> Spring 2019 Husain Gholoom Lecturer in Computer Science Page 18

19 File Editing vim emacs gedit Kwrite small, hard to learn huge, hard to learn GUI, good Directory Maintenance Creating, Deleting and Managing Directories mkdir, cd, pwd, rm, rmdir, mv, cp $ mkdir mydir $ cd mydir $ pwd Print Working Directory the pwd command displays the name of the current working directory. $ cp r mydir mydir2 $ mv r mydir mydir2 $ rm rf mydir $ rmdir mydir Spring 2019 Husain Gholoom Lecturer in Computer Science Page 19

20 Link a Shortcut to a File Hard link : Creates a link to a file. ln <source> <linkname> Symbolic link ln s <source> <linkname> What will happen if the source is deleted? User and Group Change owner and group chown o chown [ R] owner[:group] file. For Example chown Jeff file1 allows jeff to be the owner of the file file1 chgrp o chgrp [ R] group file For Example chgrp -R staff proposals change the group ownership of the directory named proposals, and of all the files and subdirectories under it, to staff Spring 2019 Husain Gholoom Lecturer in Computer Science Page 20

21 Process and Signal Show process information ps : Show the Active Process ps A : Show all Processes Kill a process kill <pid> kill s <pid> : signal number like -9 Disk and Memory Disk space information Disk space usage of the system df [-k] Disk space usage of a file or a directory du [-k] <filename> Memory and process information top Spring 2019 Husain Gholoom Lecturer in Computer Science Page 21

22 Important system directories /etc : Network file /bin : Commands and Utilities /dev : Device and their uses /lib : System libraries, Kernel Modules /sbin : Contains fundamental utilities, such as init, usually needed to start, maintain and recover the system. /usr/share : This directory contains 'shareable', architecture-independent files (docs, icons, fonts etc) /usr/man : It once held the man pages. It has been moved to /usr/share/man. /usr/bin : This directory stores all binary programs distributed with the operating system not residing in /bin, /sbin /usr/sbin : Non-essential system binaries /usr/include : Stores the development headers used throughout the system Important system configuration files passwd : change system password. Spring 2019 Husain Gholoom Lecturer in Computer Science Page 22

23 Other Commands 1. Ends the processes with the ID you gave: kill PID 2. Shows the current date and time: date 3. Show a calendar of the current month: cal 4. Show a calendar of specific month / year: cal Counts lines, words, and characters in its inputs: wc test2.sh 6. Displays the first 10 lines of its input: head test2.sh 7. Displays the last 10 lines of its input: tail test2.h 8. Display the current jobs running in the backgroup: jobs Spring 2019 Husain Gholoom Lecturer in Computer Science Page 23

24 VI Editor Commands Starting vi To start using vi, at the Unix prompt type vi followed by a file name. If you wish to edit an existing file, type in its name; if you are creating a new file, type in the name you wish to give to the new file. $ vi filename Then hit Return. You will see a screen similar to the one below which shows blank lines with tildes and the name and status of the file. ~ ~ "myfile" [New file] vi's Modes and Moods vi has two modes: the command mode and the insert mode. It is essential that you know which mode you are in at any given point in time. When you are in command mode, letters of the keyboard will be interpreted as commands. When you are in insert mode the same letters of the keyboard will type or edit text. vi always starts out in command mode. When you wish to move between the two modes, keep these things in mind. You can type i to enter the insert mode. If you wish to leave insert mode and return to the command mode, hit the ESC key. If you're not sure where you are, hit ESC a couple of times and that should put you back in command mode. Entering Text To begin entering text in an empty file, you must first change from the command mode to the insert mode. To do this, type the letter i. When you start typing, anything you type will be entered into the file. Type a few short lines and hit Return at the end of each of line Spring 2019 Husain Gholoom Lecturer in Computer Science Page 24

25 Spring 2019 Husain Gholoom Lecturer in Computer Science Page 25

26 Moving One Character at a Time Try using your direction keys to move up, down, left and right in your file. Sometimes, you may find that the direction keys don't work. If that is the case, to move the cursor one character at the time, you may use the h, j, k, and l keys. These keys move you in the following directions: h left one space l right one space j down one space k up one space If you move the cursor as far as you can in any direction, you may see a screen flash or hear a beep. Moving among Words and Lines While these four keys (or your direction keys) can move you just about anywhere you want to go in your file, there are some shortcut keys that you can use to move a little more quickly through a document. To move more quickly among words, you might use the following: w moves the cursor forward one word b moves the cursor backward one word (if in the middle of a word, b will move you to the beginning of the current word). e moves to the end of a word. ( move to beginning of current block ) move to the end of current block Screen Movement To move the cursor to a line within your current screen use the following keys: H moves the cursor to the top line of the screen. M moves the cursor to the middle line of the screen. L moves the cursor to the last line of the screen. To scroll through the file and see other screens use: ctrl-f scrolls down one screen ctrl-b scrolls up one screen ctrl-u scrolls up a half a screen ctrl-d scrolls down a half a screen Two other useful commands for moving quickly from one end to the other of a document are G to move to the end of the file and 1G to move to the beginning of the file. If you precede G with a number, you can move to a specific line in the document (e.g. 15G would move you to line 15). Spring 2019 Husain Gholoom Lecturer in Computer Science Page 26

27 Deleting (or Cutting) Characters, Words, and Lines To delete a character, first place your cursor on that character. Then, you may use any of the following commands: x X dw dd D deletes the character under the cursor. deletes the character to the left of your cursor. deletes from the character selected to the end of the word. deletes all the current line. deletes from the current character to the end of the line. Entering the Insert Mode: i I a A o/o ESC Begin inserting text at current cursor location Begin inserting text at the beginning of the current line Begin appending text, one character to the right of current cursor location Begin appending text at the end of the current line Begin entering text one line below\above current line Exit insertion mode and return to command mode Exiting and Entering VI ZZ save file and exit VI :wq same as above :e! return to last saved version of current file :q quit without save, (Note :q! is required if changes have been made) :w write without exit (:w! to force write) Fancy Stuff: :1,10w file :340,$w >> file :sh ^d :![command] write lines 1 through 10 to file new file write lines 340 through the end of the file and append to file newfile escape temporarily to a shell return from shell to VI execute UNIX command without leaving VI Spring 2019 Husain Gholoom Lecturer in Computer Science Page 27

28 Spring 2019 Husain Gholoom Lecturer in Computer Science Page 28

29 Emacs Emacs is non-modal, normal keys always insert the corresponding letter Commands are typed by using [CRTL] or [ALT] in combination with normal keys. For example [C-a] or [M-a] to denote [a] pressed with[crtl] or [ALT] (M for meta). [C-h t] is [C-h] followed by plain [t]. Spring 2019 Husain Gholoom Lecturer in Computer Science Page 29

Outline. Structure of a UNIX command

Outline. Structure of a UNIX command Outline Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission (owner, group, rwx) File and directory

More information

CS Fundamentals of Programming II Fall Very Basic UNIX

CS Fundamentals of Programming II Fall Very Basic UNIX CS 215 - Fundamentals of Programming II Fall 2012 - Very Basic UNIX This handout very briefly describes how to use Unix and how to use the Linux server and client machines in the CS (Project) Lab (KC-265)

More information

Unix Introduction to UNIX

Unix Introduction to UNIX Unix Introduction to UNIX Get Started Introduction The UNIX operating system Set of programs that act as a link between the computer and the user. Developed in 1969 by a group of AT&T employees Various

More information

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX This handout very briefly describes how to use Unix and how to use the Linux server and client machines in the EECS labs that dual boot

More information

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

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines Introduction to UNIX Logging in Basic system architecture Getting help Intro to shell (tcsh) Basic UNIX File Maintenance Intro to emacs I/O Redirection Shell scripts Logging in most systems have graphical

More information

Mills HPC Tutorial Series. Linux Basics I

Mills HPC Tutorial Series. Linux Basics I Mills HPC Tutorial Series Linux Basics I Objectives Command Line Window Anatomy Command Structure Command Examples Help Files and Directories Permissions Wildcards and Home (~) Redirection and Pipe Create

More information

Introduction: What is Unix?

Introduction: What is Unix? Introduction Introduction: What is Unix? An operating system Developed at AT&T Bell Labs in the 1960 s Command Line Interpreter GUIs (Window systems) are now available Introduction: Unix vs. Linux Unix

More information

Introduction to the Linux Command Line

Introduction to the Linux Command Line Introduction to the Linux Command Line May, 2015 How to Connect (securely) ssh sftp scp Basic Unix or Linux Commands Files & directories Environment variables Not necessarily in this order.? Getting Connected

More information

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

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech Unix File System Class Meeting 2 * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech Unix File System The file system is your interface to: physical

More information

Getting Started. Running Utilities. Shells. Special Characters. Special Characters. Chapter 2 Unix Utilities for non-programmers

Getting Started. Running Utilities. Shells. Special Characters. Special Characters. Chapter 2 Unix Utilities for non-programmers Chapter 2 Unix Utilities for non-programmers Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman Converted to presentation

More information

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

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages ULI101 Week 02 Week Overview Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages Text editing Common file utilities: cat,more,less,touch,file,find

More information

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

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage ULI101 Week 02 Week Overview Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages Text editing Common file utilities: cat,more,less,touch,file,find

More information

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Unix Filesystem. January 26 th, 2004 Class Meeting 2 Unix Filesystem January 26 th, 2004 Class Meeting 2 * Notes adapted by Christian Allgood from previous work by other members of the CS faculty at Virginia Tech Unix Filesystem! The filesystem is your interface

More information

CS Unix Tools. Lecture 2 Fall Hussam Abu-Libdeh based on slides by David Slater. September 10, 2010

CS Unix Tools. Lecture 2 Fall Hussam Abu-Libdeh based on slides by David Slater. September 10, 2010 Lecture 2 Fall 2010 Hussam Abu-Libdeh based on slides by David Slater September 10, 2010 Last Time We had a brief discussion On The Origin of Species *nix systems Today We roll our sleeves and get our

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Phil Mercurio The Scripps Research Institute mercurio@scripps.edu 1 Session Overview What is Linux Shells & Windows The Linux File System Assorted Commands 2 What Is Linux? Linux

More information

CISC 220 fall 2011, set 1: Linux basics

CISC 220 fall 2011, set 1: Linux basics CISC 220: System-Level Programming instructor: Margaret Lamb e-mail: malamb@cs.queensu.ca office: Goodwin 554 office phone: 533-6059 (internal extension 36059) office hours: Tues/Wed/Thurs 2-3 (this week

More information

Week 2 Lecture 3. Unix

Week 2 Lecture 3. Unix Lecture 3 Unix Terminal and Shell 2 Terminal Prompt Command Argument Result 3 Shell Intro A system program that allows a user to execute: shell functions (e.g., ls -la) other programs (e.g., eclipse) shell

More information

Introduction to Linux Workshop 1

Introduction to Linux Workshop 1 Introduction to Linux Workshop 1 The George Washington University SEAS Computing Facility Created by Jason Hurlburt, Hadi Mohammadi, Marco Suarez hurlburj@gwu.edu Logging In The lab computers will authenticate

More information

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

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME Introduction to the Unix command line History Many contemporary computer operating systems, like Microsoft Windows and Mac OS X, offer primarily (but not exclusively) graphical user interfaces. The user

More information

Introduction to the UNIX command line

Introduction to the UNIX command line 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

More information

CHAPTER 1 UNIX FOR NONPROGRAMMERS

CHAPTER 1 UNIX FOR NONPROGRAMMERS CHAPTER 1 UNIX FOR NONPROGRAMMERS The man command is used to display the manual entry associated with word entered as argument. The -k option is used displays a list of manual entries that contain entered

More information

Introduction to Linux

Introduction to Linux p. 1/40 Introduction to Linux Xiaoxu Guan High Performance Computing, LSU January 31, 2018 p. 2/40 Outline What is an OS or Linux OS? Basic commands for files/directories Basic commands for text processing

More information

Linux Command Line Primer. By: Scott Marshall

Linux Command Line Primer. By: Scott Marshall Linux Command Line Primer By: Scott Marshall Draft: 10/21/2007 Table of Contents Topic Page(s) Preface 1 General Filesystem Background Information 2 General Filesystem Commands 2 Working with Files and

More information

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering ENG224 Information Technology Part I: Computers and the Internet Laboratory 2 Linux Shell Commands and vi Editor

More information

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

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program Using UNIX. UNIX is mainly a command line interface. This means that you write the commands you want executed. In the beginning that will seem inferior to windows point-and-click, but in the long run the

More information

Linux/Cygwin Practice Computer Architecture

Linux/Cygwin Practice Computer Architecture Linux/Cygwin Practice 2010 Computer Architecture Linux Login Use ssh client applications to connect (Port : 22) SSH Clients zterm ( http://www.brainz.co.kr/products/products4_2.php ) Putty ( http://kldp.net/frs/download.php/3411/hangulputty-0.58.h2.exe

More information

Course 144 Supplementary Materials. UNIX Fundamentals

Course 144 Supplementary Materials. UNIX Fundamentals Course 144 Supplementary Materials UNIX Fundamentals 1 Background to UNIX Command Fundamentals This appendix provides a overview of critical commands and concepts Prerequisite knowledge attendees should

More information

Chapter-3. Introduction to Unix: Fundamental Commands

Chapter-3. Introduction to Unix: Fundamental Commands Chapter-3 Introduction to Unix: Fundamental Commands What You Will Learn The fundamental commands of the Unix operating system. Everything told for Unix here is applicable to the Linux operating system

More information

Computer Systems and Architecture

Computer Systems and Architecture Computer Systems and Architecture Stephen Pauwels Computer Systems Academic Year 2018-2019 Overview of the Semester UNIX Introductie Regular Expressions Scripting Data Representation Integers, Fixed point,

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Mukesh Pund Principal Scientist, NISCAIR, New Delhi, India History In 1969, a team of developers developed a new operating system called Unix which was written using C Linus Torvalds,

More information

Getting started with Hugs on Linux

Getting started with Hugs on Linux Getting started with Hugs on Linux COM1022 Functional Programming Techniques Dr Hans Georg Schaathun University of Surrey Autumn 2009 Week 7 Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn

More information

CSCI 2132 Software Development. Lecture 4: Files and Directories

CSCI 2132 Software Development. Lecture 4: Files and Directories CSCI 2132 Software Development Lecture 4: Files and Directories Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 12-Sep-2018 (4) CSCI 2132 1 Previous Lecture Some hardware concepts

More information

Computer Systems and Architecture

Computer Systems and Architecture Computer Systems and Architecture Introduction to UNIX Stephen Pauwels University of Antwerp October 2, 2015 Outline What is Unix? Getting started Streams Exercises UNIX Operating system Servers, desktops,

More information

A Brief Introduction to Unix

A Brief Introduction to Unix A Brief Introduction to Unix Sean Barag Drexel University March 30, 2011 Sean Barag (Drexel University) CS 265 - A Brief Introduction to Unix March 30, 2011 1 / 17 Outline 1 Directories

More information

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

Unix Tutorial. Beginner. CS Help Desk: Marc Jarvis (in spirit), Monica Ung, Corey Antoniuk 2015 Unix Tutorial Beginner CS Help Desk: Marc Jarvis (in spirit), Monica Ung, Corey Antoniuk 2015 Helpful info SOCS wiki cs.mcgill.ca/docs Help desk - McConnell 209N help@cs.mcgill.ca CSUS help desk - 3rd

More information

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

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University Introduction to Linux Woo-Yeong Jeong (wooyeong@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating system of a computer What is an

More information

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

Unix tutorial. Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based. Unix tutorial Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based. Terminal windows You will use terminal windows to enter and execute

More information

Working with Basic Linux. Daniel Balagué

Working with Basic Linux. Daniel Balagué Working with Basic Linux Daniel Balagué How Linux Works? Everything in Linux is either a file or a process. A process is an executing program identified with a PID number. It runs in short or long duration

More information

Introduction to Linux

Introduction to Linux Introduction to Linux M Tech CS I 2015-16 Arijit Bishnu Debapriyo Majumdar Sourav Sengupta Mandar Mitra Login, Logout, Change password $ ssh, ssh X secure shell $ ssh www.isical.ac.in $ ssh 192.168 $ logout,

More information

Physics REU Unix Tutorial

Physics REU Unix Tutorial Physics REU Unix Tutorial What is unix? Unix is an operating system. In simple terms, its the set of programs that makes a computer work. It can be broken down into three parts. (1) kernel: The component

More information

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

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester Linux Essentials Programming and Data Structures Lab M Tech CS First Year, First Semester Adapted from PDS Lab 2014 and 2015 Login, Logout, Password $ ssh mtc16xx@192.168.---.--- $ ssh X mtc16xx@192.168.---.---

More information

Getting Started with UNIX

Getting Started with UNIX Getting Started with UNIX What is UNIX? Boston University Information Services & Technology Course Number: 4000 Course Instructor: Kenny Burns Operating System Interface between a user and the computer

More information

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

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories Chapter Two Exploring the UNIX File System and File Security Lesson A Understanding Files and Directories 2 Objectives Discuss and explain the UNIX file system Define a UNIX file system partition Use the

More information

INSE Lab 1 Introduction to UNIX Fall 2017

INSE Lab 1 Introduction to UNIX Fall 2017 INSE 6130 - Lab 1 Introduction to UNIX Fall 2017 Updated by: Paria Shirani Overview In this lab session, students will learn the basics of UNIX /Linux commands. They will be able to perform the basic operations:

More information

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

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12) Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12) Objective: Learn some basic aspects of the UNIX operating system and how to use it. What is UNIX? UNIX is the operating system used by most computers

More information

Oxford University Computing Services. Getting Started with Unix

Oxford University Computing Services. Getting Started with Unix Oxford University Computing Services Getting Started with Unix Unix c3.1/2 Typographical Conventions Listed below are the typographical conventions used in this guide. Names of keys on the keyboard are

More information

CS101 Linux Shell Handout

CS101 Linux Shell Handout CS101 Linux Shell Handout Introduction This handout is meant to be used as a quick reference to get a beginner level hands on experience to using Linux based systems. We prepared this handout assuming

More information

Introduction To Linux

Introduction To Linux Introduction To Linux Using The Command Line David To Biomedical Research Centre for Mental Health 2nd December 2010 1 What Is Linux? UNIX-like operating system using the Linux Kernel: http://kernel.org/

More information

Lecture # 2 Introduction to UNIX (Part 2)

Lecture # 2 Introduction to UNIX (Part 2) CS390 UNIX Programming Spring 2009 Page 1 Lecture # 2 Introduction to UNIX (Part 2) UNIX is case sensitive (lowercase, lowercase, lowercase) Logging in (Terminal Method) Two basic techniques: 1. Network

More information

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

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14 Introduction to Linux (Part I) BUPT/QMUL 2018/03/14 Contents 1. Background on Linux 2. Starting / Finishing 3. Typing Linux Commands 4. Commands to Use Right Away 5. Linux help continued 2 Contents 6.

More information

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

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018 GNU/Linux 101 Casey McLaughlin Research Computing Center Spring Workshop Series 2018 rccworkshop IC;3df4mu bash-2.1~# man workshop Linux101 RCC Workshop L101 OBJECTIVES - Operating system concepts - Linux

More information

Overview of the UNIX File System

Overview of the UNIX File System Overview of the UNIX File System Navigating and Viewing Directories Adapted from Practical Unix and Programming Hunter College Copyright 2006 Stewart Weiss The UNIX file system The most distinguishing

More information

Perl and R Scripting for Biologists

Perl and R Scripting for Biologists Perl and R Scripting for Biologists Lukas Mueller PLBR 4092 Course overview Linux basics (today) Linux advanced (Aure, next week) Why Linux? Free open source operating system based on UNIX specifications

More information

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

Connecting to ICS Server, Shell, Vim CS238P Operating Systems fall 18 Connecting to ICS Server, Shell, Vim CS238P Operating Systems fall 18 By Aftab Hussain (Adapted from Claudio A. Parra s Slides for Fall 18 CS-143A) October 5 2018 University of California, Irvine Andromeda

More information

Introduction to Unix: Fundamental Commands

Introduction to Unix: Fundamental Commands Introduction to Unix: Fundamental Commands Ricky Patterson UVA Library Based on slides from Turgut Yilmaz Istanbul Teknik University 1 What We Will Learn The fundamental commands of the Unix operating

More information

Exploring UNIX: Session 3

Exploring UNIX: Session 3 Exploring UNIX: Session 3 UNIX file system permissions UNIX is a multi user operating system. This means several users can be logged in simultaneously. For obvious reasons UNIX makes sure users cannot

More information

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]

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] Data and Computer Security (CMPD414) Lab II Topics: secure login, moving into HOME-directory, navigation on Unix, basic commands for vi, Message Digest This lab exercise is to be submitted at the end of

More information

Basic File Attributes

Basic File Attributes Basic File Attributes The UNIX file system allows the user to access other files not belonging to them and without infringing on security. A file has a number of attributes (properties) that are stored

More information

CS246 Spring14 Programming Paradigm Notes on Linux

CS246 Spring14 Programming Paradigm Notes on Linux 1 Unix History 1965: Researchers from Bell Labs and other organizations begin work on Multics, a state-of-the-art interactive, multi-user operating system. 1969: Bell Labs researchers, losing hope for

More information

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

Linux Training. for New Users of Cluster. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala Linux Training for New Users of Cluster Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala pakala@uga.edu 1 Overview GACRC Linux Operating System Shell, Filesystem, and Common

More information

CST8207: GNU/Linux Operating Systems I Lab Six Linux File System Permissions. Linux File System Permissions (modes) - Part 1

CST8207: GNU/Linux Operating Systems I Lab Six Linux File System Permissions. Linux File System Permissions (modes) - Part 1 Student Name: Lab Section: Linux File System Permissions (modes) - Part 1 Due Date - Upload to Blackboard by 8:30am Monday March 12, 2012 Submit the completed lab to Blackboard following the Rules for

More information

Std: XI CHAPTER-3 LINUX

Std: XI CHAPTER-3 LINUX Commands: General format: Command Option Argument Command: ls - Lists the contents of a file. Option: Begins with minus sign (-) ls a Lists including the hidden files. Argument refers to the name of a

More information

National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual

National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual Objective This lab is all about running commands in Ubuntu Terminal and compiling C program in Ubuntu Table of

More information

2) clear :- It clears the terminal screen. Syntax :- clear

2) clear :- It clears the terminal screen. Syntax :- clear 1) cal :- Displays a calendar Syntax:- cal [options] [ month ] [year] cal displays a simple calendar. If arguments are not specified, the current month is displayed. In addition to cal, the ncal command

More information

Files

Files http://www.cs.fsu.edu/~langley/cop3353-2013-1/reveal.js-2013-02-11/02.html?print-pdf 02/11/2013 10:55 AM Files A normal "flat" file is a collection of information. It's usually stored somewhere reasonably

More information

Session 1: Accessing MUGrid and Command Line Basics

Session 1: Accessing MUGrid and Command Line Basics Session 1: Accessing MUGrid and Command Line Basics Craig A. Struble, Ph.D. July 14, 2010 1 Introduction The Marquette University Grid (MUGrid) is a collection of dedicated and opportunistic resources

More information

UNLV Computer Science Department CS 135 Lab Manual

UNLV Computer Science Department CS 135 Lab Manual UNLV Computer Science Department CS 135 Lab Manual prepared by Lee Misch revised July 2013 CS 135 Lab Manual Content Page Introduction 3 CS Computer Accounts. 3 TBE B361 Computer Basics. 3 Choosing an

More information

Introduction to Linux. Fundamentals of Computer Science

Introduction to Linux. Fundamentals of Computer Science Introduction to Linux Fundamentals of Computer Science Outline Operating Systems Linux History Linux Architecture Logging in to Linux Command Format Linux Filesystem Directory and File Commands Wildcard

More information

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

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University Unix/Linux Basics 1 Some basics to remember Everything is case sensitive Eg., you can have two different files of the same name but different case in the same folder Console-driven (same as terminal )

More information

Introduction to Linux Environment. Yun-Wen Chen

Introduction to Linux Environment. Yun-Wen Chen Introduction to Linux Environment Yun-Wen Chen 1 The Text (Command) Mode in Linux Environment 2 The Main Operating Systems We May Meet 1. Windows 2. Mac 3. Linux (Unix) 3 Windows Command Mode and DOS Type

More information

Getting started with Hugs on Linux

Getting started with Hugs on Linux Getting started with Hugs on Linux CS190 Functional Programming Techniques Dr Hans Georg Schaathun University of Surrey Autumn 2008 Week 1 Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn

More information

Short Read Sequencing Analysis Workshop

Short Read Sequencing Analysis Workshop Short Read Sequencing Analysis Workshop Day 2 Learning the Linux Compute Environment In-class Slides Matt Hynes-Grace Manager of IT Operations, BioFrontiers Institute Review of Day 2 Videos Video 1 Introduction

More information

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

Linux at the Command Line Don Johnson of BU IS&T 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

More information

commandname flags arguments

commandname flags arguments Unix Review, additional Unix commands CS101, Mock Introduction This handout/lecture reviews some basic UNIX commands that you should know how to use. A more detailed description of this and other commands

More information

Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers

Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers Review of the Linux File System and Linux Commands 1. Introduction Becoming adept at using the Linux OS requires gaining familiarity

More information

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

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80 CSE 303 Lecture 2 Introduction to bash shell read Linux Pocket Guide pp. 37-46, 58-59, 60, 65-70, 71-72, 77-80 slides created by Marty Stepp http://www.cs.washington.edu/303/ 1 Unix file system structure

More information

12/7/10 ATSC 212 UNIX ATSC 212 ATSC 212 UNIX

12/7/10 ATSC 212 UNIX ATSC 212 ATSC 212 UNIX ATSC 212 1 An operating system (OS) is a resource manager. It's task is to schedule resources and make available resources to system processes or programs. There have been hundreds of operating systems

More information

CHE3935. Lecture 1. Introduction to Linux

CHE3935. Lecture 1. Introduction to Linux CHE3935 Lecture 1 Introduction to Linux 1 Logging In PuTTY is a free telnet/ssh client that can be run without installing it within Windows. It will only give you a terminal interface, but used with a

More information

Unix Tutorial Haverford Astronomy 2014/2015

Unix Tutorial Haverford Astronomy 2014/2015 Unix Tutorial Haverford Astronomy 2014/2015 Overview of Haverford astronomy computing resources This tutorial is intended for use on computers running the Linux operating system, including those in the

More information

Crash Course in Unix. For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix. -or- Unix in a Nutshell (an O Reilly book).

Crash Course in Unix. For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix. -or- Unix in a Nutshell (an O Reilly book). Crash Course in Unix For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix -or- Unix in a Nutshell (an O Reilly book). 1 Unix Accounts To access a Unix system you need to have

More information

Overview of the UNIX File System. Navigating and Viewing Directories

Overview of the UNIX File System. Navigating and Viewing Directories Overview of the UNIX File System Navigating and Viewing Directories Copyright 2006 Stewart Weiss The UNIX file system The most distinguishing characteristic of the UNIX file system is the nature of its

More information

UNIX Quick Reference

UNIX Quick Reference UNIX Quick Reference Charles Duan FAS Computer Services August 26, 2002 1 Command Reference Many of these commands have many more options than the ones displayed here. Most also take the option h or help,

More information

Introduction to the basics of UNIX

Introduction to the basics of UNIX Introduction to the basics of UNIX Joachim Hein Centre for Mathematical Sciences Lund University Outline 1 Operating system UNIX 2 Interacting with UNIX Manipulating files and directories Editing files:

More information

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

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version... Contents Note: pay attention to where you are........................................... 1 Note: Plaintext version................................................... 1 Hello World of the Bash shell 2 Accessing

More information

Using the Zoo Workstations

Using the Zoo Workstations Using the Zoo Workstations Version 1.86: January 16, 2014 If you ve used Linux before, you can probably skip many of these instructions, but skim just in case. Please direct corrections and suggestions

More information

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 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 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. 2 Conventions Used in This Book p. 2 Introduction to UNIX p. 5 An Overview

More information

Introduction to Linux (Part II) BUPT/QMUL 2018/03/21

Introduction to Linux (Part II) BUPT/QMUL 2018/03/21 Introduction to Linux (Part II) BUPT/QMUL 2018/03/21 Contents 10. vi 11. Other commands 12. Developing tools 2 10. Editor - vi Text editor Insert mode Override mode Use sub-commands Tradition tools and

More information

The Unix Shell & Shell Scripts

The Unix Shell & Shell Scripts The Unix Shell & Shell Scripts You should do steps 1 to 7 before going to the lab. Use the Linux system you installed in the previous lab. In the lab do step 8, the TA may give you additional exercises

More information

FREEENGINEER.ORG. 1 of 6 11/5/15 8:31 PM. Learn UNIX in 10 minutes. Version 1.3. Preface

FREEENGINEER.ORG. 1 of 6 11/5/15 8:31 PM. Learn UNIX in 10 minutes. Version 1.3. Preface FREEENGINEER.ORG Learn UNIX in 10 minutes. Version 1.3 Preface This is something that I had given out to students (CAD user training) in years past. The purpose was to have on one page the basics commands

More information

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

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 Summer 2010 Department of Computer Science and Engineering York University Toronto June 29, 2010 1 / 36 Table of contents 1 2 3 4 2 / 36 Our goal Our goal is to see how we can use Unix as a tool for developing

More information

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

Introduction to Unix and Linux. Workshop 1: Directories and Files Introduction to Unix and Linux Workshop 1: Directories and Files Genomics Core Lab TEXAS A&M UNIVERSITY CORPUS CHRISTI Anvesh Paidipala, Evan Krell, Kelly Pennoyer, Chris Bird Genomics Core Lab Informatics

More information

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (( )) (( )) [ x x ] cdc communications, inc. [ x x ] \ / presents... \ / (` ') (` ') (U) (U) Gibe's UNIX COMMAND Bible ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The latest file from the Cow's

More information

INF322 Operating Systems

INF322 Operating Systems Galatasaray University Computer Engineering Department INF322 Operating Systems TP01: Introduction to Linux Ozan Çağlayan ocaglayan@gsu.edu.tr ozancaglayan.com Fundamental Concepts Definition of Operating

More information

Editors in Unix come in two general flavours:

Editors in Unix come in two general flavours: Review notes #2 1. Unix account 2.Login: with a terminal or using telnet or ssh 3. Change password 4. Must logout! 5. Emails: (a) mutt (b) pine (c).forward file 6.Basic commands: who, ls, cat, more, man

More information

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

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2 CSE Linux VM For Microsoft Windows Based on opensuse Leap 42.2 Dr. K. M. Flurchick February 2, 2017 Contents 1 Introduction 1 2 Requirements 1 3 Procedure 1 4 Usage 3 4.1 Start/Stop.................................................

More information

Exercise Sheet 2. (Classifications of Operating Systems)

Exercise Sheet 2. (Classifications of Operating Systems) Exercise Sheet 2 Exercise 1 (Classifications of Operating Systems) 1. At any given moment, only a single program can be executed. What is the technical term for this operation mode? 2. What are half multi-user

More information

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

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen Introduction to Unix The Windows User perspective Wes Frisby Kyle Horne Todd Johansen What is Unix? Portable, multi-tasking, and multi-user operating system Software development environment Hardware independent

More information

CS/CIS 249 SP18 - Intro to Information Security

CS/CIS 249 SP18 - Intro to Information Security Lab assignment CS/CIS 249 SP18 - Intro to Information Security Lab #2 - UNIX/Linux Access Controls, version 1.2 A typed document is required for this assignment. You must type the questions and your responses

More information

Linux Shell Script. J. K. Mandal

Linux Shell Script. J. K. Mandal Linux Shell Script J. K. Mandal Professor, Department of Computer Science & Engineering, Faculty of Engineering, Technology & Management University of Kalyani Kalyani, Nadia, West Bengal E-mail: jkmandal@klyuniv.ac.in,

More information

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems. Copyleft 2005, Binnur Kurt 3 Operating Systems Copyleft 2005, Binnur Kurt Content The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail.

More information