Systems Programming Concepts

Slides:



Advertisements
Similar presentations
1 Introduction to UNIX Ke Liu
Advertisements

©Colin Jamison 2004 Introduction to Linux Colin Jamison.
Exploring the UNIX File System and File Security
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
1 Basics of Linux On linux machine: Login at your home directory Open a “shell” or “terminal” or “xterm” workspace (4) On windows machine Intall linux.
Unix Basics. Systems Programming: Unix Basics 2 Unix Basics  Unix directories  Important Unix file commands  File and Directory Access Rights through.
UNIX Files and Security Software Tools. Slide 2 File Systems l What is a file system? A means of organizing information on the computer. A file system.
A Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  Currently there.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Learning basic Unix command IT 325 operating system.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
Brief introduction to UNIX A. Emerson CINECA, High Performance Systems.
Overview of Linux CS3530 Spring 2014 Dr. José M. Garrido Department of Computer Science.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
The file structure and related utilities CS240 Computer Science II.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
CHAPTER 1 UNIX FOR NONPROGRAMMERS By U ğ ur Halıcı.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
Unix Basics Chapter 4.
Basic unix commands that everyone should know (Even if you have a mac) Slightly more advanced:
File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)
The UNIX development environment CS 400/600 – Data Structures.
Working with Linux Lab 1 1. Login and logout Account – username & password – Note: Linux is case-sensitive Administrator: username = root Logout: exit,
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Chapter Two Exploring the UNIX File System and File Security.
Unix/Linux cs3353. The Shell The shell is a program that acts as the interface between the user and the kernel. –The shell is fully programmable and will.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.
Introduction to UNIX Geraint Vaughan. What is UNIX? Command-line operating system (not point- and click) Designed for ‘experts’ Lots of different variants.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Getting Started UNIX InKwan Yu Topics Unix Commands Unix System calls C function calls.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Linux Commands C151 Multi-User Operating Systems.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
Basic Unix Commands & GCC Saurav Karmakar Spring 2007.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
Unix Fundamentals CS 127. File navigation cd - change directory cd /var/log cd /etc/apache2 cd ~/Desktop ~ is a shortcut for the home directory.
Basic Unix Commands. Listing files and directories ● ls:command is used to list the files and ● directories in present working directory ● ls command.
ICE UNIX TUTORIAL. File System Commands cd – change directory cd – change directory ls – list contents ls – list contents rm – remove/delete rm – remove/delete.
Learning basic Unix command It 325 operating system.
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux.
Learning Unix/Linux Based on slides from: Eric Bishop.
UNIX Basics Matt Hayward October 18, 2016 LS560 – Information Technology for information professionals.
Overview of Linux Fall 2016 Dr. Donghyun Kim
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Getting started with CentOS Linux
Chapter 11 Command-Line Master Class
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
Andy Wang Object Oriented Programming in C++ COP 3330
Lecture 2 Working with Files and Directories
Some Linux Commands.
The Command Prompt Commands are the way to “do things” in Unix
CS314 – Section 5 Recitation 1
The Linux Operating System
Lab 1 introduction, debrief
Introduction to UNIX.
Introduction to Linux Week 0 - Thursday.
Internet-of-Things (IoT)
Operating Systems and Using Linux
Web Programming Essentials:
The Unix File System.
Getting started with CentOS Linux
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
Lab 2: Terminal Basics.
Presentation transcript:

Systems Programming Concepts Unix Basics Systems Programming Concepts

Systems Programming Unix Basics 4/20/2017 Unix Basics Unix directories Important Unix file commands man, pwd, ls, mkdir, cd, cp, mv File and directory access rights through permission settings Using chmod to change permissions Other important Unix commands emacs, cat, rm, ps, kill Systems Programming Unix Basics

Systems Programming Unix Basics Unix File Structure Hierarchical file system File System starts at root, denoted “/”. Abstraction is to navigate through the Unix directory structure relative to the current “working” directory. Slashes separate directory levels. File names cannot have blanks and lower-case is preferred {case-sensitive}. Extensions are just conventions to the file system, but NOT to compilers! Systems Programming Unix Basics

Systems Programming Unix Basics Unix File Notation . = the current directory .. = the parent directory ~ = my home directory (i.e., the current directory when I login) File name wild cards ? = any one character * = any zero or more characters Systems Programming Unix Basics

Systems Programming Unix Basics Unix Commands Basic format: Command –option parameters ls –l labs* cp old.c new.c Unix commands can be cryptic and many are only two characters long, but an important exception is: man = manual page request man ls Systems Programming Unix Basics

Systems Programming Unix Basics Commands: pwd & ls pwd = print working directory ls = list file names and attributes. -l = long listing -d = list directory itself, not contents -a = all files (including starting with “.”) ls [just file names] ls –la [lots of info!] ls –la labs* [only info on labs files] ls –d [just directory names] Systems Programming Unix Basics

Systems Programming Unix Basics Commands: mkdir & cd mkdir = make a new directory mkdir newdir cd = change directory cd newdir cd ../updir cd [change to home directory] Systems Programming Unix Basics

Systems Programming Unix Basics Commands: mv & cp cp = copy file cp source destination -p = preserve permissions cp –p old.c new.c cp prog1.c prog_dir/ cp *.c prog_dir/ mv = move file mv source destination mv prog1.c distance.c mv prog1.c prog_dir/ For both commands if the destination is an existing directory, the file name stays the same. Systems Programming Unix Basics

File and Directory Permissions Each file or directory has three sets of permissions: User (i.e. owner) Note - Only the user can change permissions. Group (e.g., cs2303 ) Other (the world!) Each permission set has three permissions: Read Write Execute These are visible left to right via: ls –la Systems Programming Unix Basics

File and Directory Permissions Read access = You can read the file contents. You can list the contents of the directory. Write access = You can write into this file. You can modify this directory. Execute access = You can run this file as a command. You can use this directory as part of a path. To access any file, you first need execute permission on all directories from the root to the file. Systems Programming Unix Basics

Systems Programming Unix Basics Command: chmod chmod = Change mode (permissions) chmod mode files mode: specify users: u, g, o and a (for all) specify attribute: r, w, or x connect with action: + = add - = delete = = set Systems Programming Unix Basics

Systems Programming Unix Basics Command: chmod Examples: chmod u+x prog4.cpp chmod o-r prog4.cpp chmod u=rwx prog4.cpp chmod o+r,g+r prog4.cpp You can also use octal numbers: chmod 700 prog2.c chmod 750 sample.c Systems Programming Unix Basics

Commands: emacs, cat, more command filename {generic format} emacs used to edit a file emacs lab1.c cat prints text file to stdout cat lab1.c more prints text file (only fill one screen) more lab1.c hit the space bar to see more or q to quit. Systems Programming Unix Basics

Systems Programming Unix Basics Commands: rm, ps, kill rm = delete a file rm olddat.txt ps = print currently active processes ps kill = stop one of your running processes kill -9 26814 Systems Programming Unix Basics

Systems Programming Unix Basics Example: ps kill $emacs simple.c {inside edit of simple.c} ^z $ps PID TTY TIME CMD 26792 pts/17 00:00:00 tcsh 26814 pts/17 00:00:00 emacs 26815 pts/17 00:00:00 ps $ kill -9 26814 $ [1] Killed emacs simple.c type % to resume Systems Programming Unix Basics

Systems Programming Unix Basics 4/20/2017 Review of Unix Basics Unix directories Important Unix file commands man, pwd, ls, mkdir, cd, cp, mv File and Directory Access Rights through Permission Settings Using chmod to change permissions Other important commands emacs, cat, rm, ps, kill Systems Programming Unix Basics