Introduction to Unix – CS 21 Lecture 14. Lecture Overview Lab Questions Backup schemes Using tar to archive Printing in Unix lpr lpq Lprm Quiz 2.

Slides:



Advertisements
Similar presentations
Linux Orientation Computer Systems Lab Computer Sciences Department Room 2350.
Advertisements

Backing Up a Hard Disk CGS2564. Why Backup Programs? Faster Optimized to copy files Can specify only files that have changed Safer Can verify backed up.
Introduction to Unix – CS 21 Lecture 10. Lecture Overview Midterm questions Jobs and processes description The foreground and background Controlling jobs.
Working with Files How to create, view, copy, rename and print files.
Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Jan. 27 th, 2009 Essential Unix Commands.
2000 Copyrights, Danielle S. Lahmani UNIX Tools G , Fall 2000 Danielle S. Lahmani Lecture 12.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
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.
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
UNIX Tools and the UNIX File System CMSC 121 Introduction to UNIX The material on submitexec was taken from Dan Hood’s CMSC 121 Lecture Notes.
Introduction to Unix – CS 21 Lecture 13. Lecture Overview Finding files and programs which whereis find xargs Putting it all together for some complex.
Guide To UNIX Using Linux Third Edition
Guide to Linux Installation and Administration, 2e1 Chapter 12 Printing in Linux.
Hands-On Microsoft Windows Server 2003 Administration Chapter 6 Managing Printers, Publishing, Auditing, and Desk Resources.
CS 497C – Introduction to UNIX Lecture 13: - The File System Chin-Chih Chang
CSCI 330 T HE UNIX S YSTEM File operations. OPERATIONS ON REGULAR FILES 2 CSCI The UNIX System Create Edit Display Contents Display Contents Print.
How to Open Microsoft Word Click Start Click All Programs Click Microsoft Office Click Microsoft Word 2013.
Introduction to Unix – CS 21 Lecture 5. Lecture Overview Lab Review Useful commands that will illustrate today’s lecture Streams of input and output File.
WinZip Basics Chris Comito Marybeth MacLean Jameelah Roberts Matt Smith.
Lecture 8 Configuring a Printer-using Magic Filter Introduction to IP Addressing.
CN1260 Client Operating System Kemtis Kunanuraksapong MSIS with Distinction MCT, MCITP, MCTS, MCDST, MCP, A+
Chapter 13: Sharing Printers on Windows Server 2008 R2 Networks BAI617.
Unix/Linux basics 0011 Operating systems lab Gergely Windisch room 4.12
MCB Lecture #3 Sept 2/14 Intro to UNIX terminal.
Sharing Resources Lesson 6. Objectives Manage NTFS and share permissions Determine effective permissions Configure Windows printing.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
Offline File Storage. Module 12 Offline File Storage ♦ Introduction Backup is usually done by first collecting all the data in a single archive file,
2 Manual & Filestore. Introduction Using the manual The UNIX filestore File permissions.
Working with Files Chapter 5. Display a Calendar Display a calendar for a specific month – cal Display a calendar for a specific year – cal 2000.
Lesson 11-Locating, Printing, and Archiving User Files.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
Unix Basics Chapter 4.
An Introduction to Unix Shell Scripting
Basic unix commands that everyone should know (Even if you have a mac) Slightly more advanced:
Linux Operations and Administration
Introduction to Unix – CS 21 Lecture 9. Lecture Overview Shell description Shell choices History Aliases Topic review.
| nectar.org.au NECTAR TRAINING Module 9 Backing up & Packing up.
Introduction to Unix – CS 21 Lecture 2. Lecture Overview Starting out in Unix Getting help when needed Looking around a little Environment and Environment.
Lecture 8 – Cookies & Sessions SFDV3011 – Advanced Web Development 1.
1 Lecture 5 Additional useful commands COP 3353 Introduction to UNIX.
Introduction to Unix – CS 21 Lecture 6. Lecture Overview Homework questions More on wildcards Regular expressions Using grep Quiz #1.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
Introduction to Unix – CS 21 Lecture 4. Lecture Overview * cp, mv, and rm Looking into files The file command head and tail cat and more What we’ve seen.
Introduction to Unix – CS 21 Lecture 12. Lecture Overview A few more bash programming tricks The here document Trapping signals in bash cut and tr sed.
Htar Hpss Tape Archiver Client API-based interface written by Mike Gleicher Originally commissioned for LLNL in 2000 Now available as part of the HPSS.
Introduction to Unix – CS 21
Cosc 4750 Backups Why Backup? In case of failure In case of loss of files –User and system files Because you will regret it, if you don’t. –DUMB = Disasters.
Introduction to Programming Using C An Introduction to Operating Systems.
Executable scripts. So far We have made scripts echo hello #for example And called it hello.sh Run it as sh hello.sh This only works from current directory?
Linux Commands C151 Multi-User Operating Systems.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
| nectar.org.au NECTAR TRAINING Module 9 Backing up & Packing up.
– Introduction to the Shell 1/21/2016 Introduction to the Shell – Session Introduction to the Shell – Session 3 · Job control · Start,
Software in the Data Protector Architecture
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Feb 3 rd, 2009 Essential Unix Commands …the second half.
Agenda The Linux File System (chapter 4 in text) Setting Access Permissions Directory vs File Permissions chmod Utility Symbolic Method Absolute Method.
Review Please turn in your homework and practicals Packages, installation, rpm command Apache – Quick and easy way to set up a web server to play around.
1 Introduction to Shared Folders Shared folders provide network users access to files. Users connect to the shared folder over the network. Users must.
CSC 4630 Perl 3 adapted from R. E. Beck. Problem But we worked on it first: Input: Read from a text file named in a command line argument Output: List.
This slide deck is for LPI Academy instructors to use for lectures for LPI Academy courses. ©Copyright Network Development Group Module 7 Archiving.
Chapter 4: server services. The Complete Guide to Linux System Administration2 Objectives Configure network interfaces using command- line and graphical.
ULI101 Week 05. Week Overview ● File system links ● Hard and symbolic links ● Process management ● Storage quota information (quota) ● Printing.
Shells, Help, and Paths.
Lecture 5 Additional useful commands COP 3353 Introduction to UNIX 1.
Chapter Four UNIX File Processing.
Module 7 Archiving and Compression
Lecture 5 Additional useful commands COP 3353 Introduction to UNIX 1.
CMPSC 60: Week 5 Discussion
Presentation transcript:

Introduction to Unix – CS 21 Lecture 14

Lecture Overview Lab Questions Backup schemes Using tar to archive Printing in Unix lpr lpq Lprm Quiz 2

Bash Shell Scripting Clarifications #/bin/bash Must be the absolute first line in your script, otherwise it is meaningless Put before your name, and before anything else # will start a comment, so put in front of your name Always run your scripts to verify what they are doing before you turn them in

Take Home Assignment Clarifications This is longer than all other programs so far, so if you haven’t started yet, start ASAP Due at the beginning of lab on Thursday (6:00 pm) Hints: Awk can be treated like just another bash program, so you can make calls and awk programs inside your bash shell script Indent for readibility (Comment for understandability)

Once A File Is Gone, It’s Gone The only way to prevent data loss is to keep a recent copy somewhere safe Of course, the entire hard drive could fail, so to be safer you need it in multiple locations Other hard drives Backup tapes

Our System - RAID Redundant array of independent disks Every hour a process checks and stores away any difference in your directories and files Places these files in the.snapshot direcotry Located on one or more other drives

Tape Archive - tar Designed to store files onto a tape device Now used for for storing and collecting files anywhere Creates and maintains archives Commonly seen as XXXX.tar files Usage: tar [FLAGS] [FILES]

Common Flags -c Create an archive -f Specify file -x Extract an archive -t List an archive

Creating A tar Archive tar –cf backup.tar FILES tar –c FILES > backup.tar As always, if you use file redirection be careful Easy to overwrite

Example

Listing A tar Archive tar –tf backup.tar tar –t < backup.tar Will simply print out a list of all files located in that tar archive without changing them

Example

Extracting A tar Archive tar –x < backup.tar tar –xf backup.tar Will create all of the files in their respective directories Will overwrite any files that are there already, so be carefule

Example

Automatically Compressing A tar Archive -Z Runs zip automatically on all files -z Runs gzip automatically on all files Example: tar –czf compressed.tar.gz *.txt

The Most Common Usage Tarfile.tar.gz Referred to as a “tarball” Almost all Unix programs and packages are available in this form To extract them: tar –xzvf tarball.tar.gz

Example

Basic Printing In Unix The printers expect to be given a.ps file Postscript Other formats may or may not work or may come out ugly Pdf (Adobe Acrobat format) Ascii (Straight text)

lpr Directly feed a printer a ps file to print Usage: lpr [FLAGS] toPrint.ps Most common flag: -Pname Specifies the name of the printer to send it to Default is located in /etc/cups/lpoptions

lpq Prints out a list of all jobs waiting to be printed from a specific printer Each job has an associated job ID Usage: lpq [FLAGS] Most common usages: lpq lpq -Pname

Poor Example

lprm Used to remove jobs from the queue Usage: lprm [FLAGS] jobID Example: lprm –Pname 23

Always Remove Your Print Jobs That Don’t Print! Sometimes, the printers don’t work and people send jobs to the printers without knowing it These jobs hang around until the printers start working again, and then everything gets printed Your work could print out when you’re not there and someone else could take it

a2ps Convert ASCII files into the.ps format Usage: a2ps [FLAGS] asciiFile Examples: a2ps –o printMe.ps asciiFile a2ps –Pname asciiFile

pdf2ps Converts Pdf format files into.ps files Usage: pdf2ps input.pdf output.ps

Viewing ps, pdf, And Other Files gs Ghostscript A basic ps and pdf viewer gv Ghostview A more user friendly ps and pdf viewer xpdf A pdf viewer

Next Time Perl Programming Basics Syntax When would you use perl?

Quiz 2 Good Luck