CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Advanced File Processing.

Slides:



Advertisements
Similar presentations
การใช้ระบบปฏิบัติการ UNIX พื้นฐาน บทที่ 4 File Manipulation วิบูลย์ วราสิทธิชัย นักวิชาการคอมพิวเตอร์ ศูนย์คอมพิวเตอร์ ม. สงขลานครินทร์ เวอร์ชั่น 1 วันที่
Advertisements

Ain't It A Shame 1-4 Aint it a shame to work on Sunday, Aint it a shame, (a working shame,) Aint it a shame to work on Sunday, Aint it a shame, (a working.
1.1 File System Implementation A possible file system layout.
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Jan. 27 th, 2009 Essential Unix Commands.
Unix Tutorial CSU480. Outline  Getting Started  System Resources  Shells  Special Unix Features  Text Processing  Other Useful Commands.
Archive Utilities Learning Objectives: 1. To introduce different archive utilities for file compression with their usage 2. To compare & summarized different.
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
Saturday May 02 PST 4 PM. Saturday May 02 PST 10:00 PM.
Lecture 01CS311 – Operating Systems 1 1 CS311 – Lecture 01 Outline Course introduction Setting up your system Logging onto the servers at OSU with ssh.
Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.
CS 497C – Introduction to UNIX Lecture 13: - The File System Chin-Chih Chang
Linux+ Guide to Linux Certification, Third Edition Chapter 11 Compression, System Backup, and Software Installation.
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.
UNIX. find command ● The find command is used to locate files on a Unix or Linux system. find will search any set of directories you specify for files.
Shell Scripting Basics Arun Sethuraman. What’s a shell? Command line interpreter for Unix Bourne (sh), Bourne-again (bash), C shell (csh, tcsh), etc Handful.
Linux Commands LINUX COMMANDS.
Further Command line… Nic Bertrand CEH IT Support, GRID & Bioinformatics.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Review for Exam 1 Exam 1 on June 24 CSC 3320.
Chapter 11 Compression, System Backup, and Software Installation.
BILKENT UNIVERSITY DEPARTMENT OF COMPUTER TECHNOLOGY AND INFORMATION SYSTEMS CTIS156 INFORMATION TECHNOLOGIES II CHAPTER 10: ADVANCED FILE PROCESSING.
Linux+ Guide to Linux Certification
Brief introduction to UNIX A. Emerson CINECA, High Performance Systems.
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”
Offline File Storage. Module 12 Offline File Storage ♦ Introduction Backup is usually done by first collecting all the data in a single archive file,
(c) Faisal Akkawi & Munki Lee 2001Basic UNIX Commands1 Faisal Akkawi Department of Computer Science Illinois Institute of Technology.
CIS 90 - Lesson 14 Lesson Module Status Slides – Properties - Flash cards – No-stress quiz – Web calendar summary – Web book pages – Commands – Lab – done.
Lesson 11-Locating, Printing, and Archiving User Files.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT I/O Redirection.
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
Linux Un*x Overview Peter Norton’s Guide to Unix Running Linux (O’Reilly)
Linux Operations and Administration
CIT 500: IT Fundamentals Text Processing 1. Topics 1.Displaying files: cat, less, od, head, tail 2.Creating and appending 3.Concatenating files 4.Comparing.
Linux+ Guide to Linux Certification Chapter Thirteen Compression, System Back-Up, and Software Installation.
The UNIX File System. Introduction What is File? What is File? Container for storing information in the form of sequence of characters. Container for.
Managing Software Patches 10/15/ Introducing Solaris OE Patches A patch contains collection of files and directories Patch replaces existing files.
CIS 90 - Lesson 15 Lesson Module Status Slides – Properties - Flash cards – No-stress quiz – Web calendar summary – Web book pages – Commands – Lab – done.
Find Find basics. find ~ -name myfile –print find directory criteria This will search the home directory (~) looking for files.
1 Lecture 5 Additional useful commands COP 3353 Introduction to UNIX.
Summer 2015 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to UNIX / Linux - 6 Dr. Jerry Shiao, Silicon Valley University.
Workbook 5 - Part 2 The Linux Filesystem RH030 Linux Computing Essentials.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 Unit 10 Linux.
L&T Infotech1 UNIX – Getting Started - Aneesh Ramani.
UNIX An Introduction. Brief History UNIX UNIX Created at Bell Labs, 1969 Created at Bell Labs, 1969 BSD during mid 70s BSD during mid 70s AT&T began offering.
CIT 140: Introduction to ITSlide #1 CIT 140: Introduction to IT Shell Programming.
CSC414 “Introduction to UNIX/ Linux” Lecture 5. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Basic of UNIX For fresh members of SPARCS
Linux Commands C151 Multi-User Operating Systems.
1 itec 400 Backups George Vaughan Franklin University.
Archive Utilities Learning Objectives: 1. To introduce different archive utilities for file compression with their usage 2. To compare & summarized different.
– Introduction to the Shell 1/21/2016 Introduction to the Shell – Session Introduction to the Shell – Session 3 · Job control · Start,
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Feb 3 rd, 2009 Essential Unix Commands …the second half.
Problem Solving With C++ Recitation – Unix Commands January 2016.
Linux A practical introduction. 1)Background and Getting Started Linux is an operating system with multiple providers Red Hat/CentOS (our version) Ubuntu.
CSCI 330 UNIX and Network Programming Unit II Basic UNIX Usage: File System.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT File Processing.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Advanced File Processing Part 2.
Chapter 19 File System Backup. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Objectives To describe how files and directories can be archived.
This slide deck is for LPI Academy instructors to use for lectures for LPI Academy courses. ©Copyright Network Development Group Module 7 Archiving.
Introduction to Unix – CS 21
Read the relevant material in Sobell!
Advanced File Processing
Advanced GNU/Linux Command Line By: - Mohammed El-Sayed.
The Linux Command Line Chapter 18
Lecture 5 Additional useful commands COP 3353 Introduction to UNIX 1.
Module 7 Archiving and Compression
Prepared by, Mr. Satish Pise
Linux Commands LINUX COMMANDS.
Lecture 5 Additional useful commands COP 3353 Introduction to UNIX 1.
Presentation transcript:

CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Advanced File Processing

CIT 140: Introduction to ITSlide #2 Topics 1.Compressing files: 1.compress, 2.gzip, 3.bzip2 2.Archiving Files: tar 3.Sorting files: sort

CIT 140: Introduction to ITSlide #3 Data Compression Problem: How can we store X bytes using only Y < X bytes? Solution: Find redundancies in the data. 1.Run-length encoding Encode reptitions as the repeated value and a count. Ex: thethethe -> the3 2.Dictionary encoding Build dictionary of words. Encode each with a number. Common words: the, an, is, this

CIT 140: Introduction to ITSlide #4 Data Compression "Ask not what your country can do for you -- ask what you can do for your country." Dictionary: 1 ask 2 not 3 what 4 your 5 country 6 can 7 do 8 for 9 you Encoded version: “ – ”

CIT 140: Introduction to ITSlide #5 Compressing Files: compress compress [-c] [-d] [-l] [-v] file1 [file2, …] -cSend output to stdout. -dDecompress instead of compressing. -vProvide verbose output.

CIT 140: Introduction to ITSlide #6 Compressing Files Old School The compress command compress [options][file-list]

CIT 140: Introduction to ITSlide #7 The uncompress command Uncompressing Files Old School

CIT 140: Introduction to ITSlide #8 Compressing Files: gzip gzip [-#] [-c] [-d] [-l] [-v] file1 [file2, …] -#Specify compression level. Default=6. -cSend output to stdout. -dDecompress instead of compressing. -lList compression stats. -vProvide verbose output.

CIT 140: Introduction to ITSlide #9 Compressing Files: gzip > man bash >bash.man > man tcsh >tcsh.man > ls –l *man -rw-r--r-- 1 waldenj Oct 4 19:48 bash.man -rw-r--r-- 1 waldenj Oct 4 19:48 tcsh.man > gzip *.man > ls –l *gz -rw-r--r-- 1 waldenj Oct 4 19:45 bash.man.gz -rw-r--r-- 1 waldenj Oct 4 19:45 tcsh.man.gz > gzip –l *gz compressed uncompressed ratio uncompressed_name % bash.man % tcsh.man % (totals) >

CIT 140: Introduction to ITSlide #10 Uncompressing Files: gunzip > gunzip bash.man.gz > ls -l *man *gz -rw-r--r-- 1 waldenj Oct 4 19:45 bash.man -rw-r--r-- 1 waldenj Oct 4 19:45 tcsh.man.gz > gzip -v bash.man bash.man: 73.3% -- replaced with bash.man.gz > gzip -dc bash.man.gz | less User Commands BASH(1) NAME bash - GNU Bourne-Again Shell … > ls -l *man *gz -rw-r--r-- 1 waldenj Oct 4 19:45 bash.man.gz -rw-r--r-- 1 waldenj Oct 4 19:45 tcsh.man.gz

CIT 140: Introduction to ITSlide #11 Modern Compression: bzip2 bzip2 [-#] [-c] [-d] [-l] [-v] file1 [file2, …] -#Specify compression level. Default=9. -cSend output to stdout. -dDecompress instead of compressing. -vProvide verbose output.

CIT 140: Introduction to ITSlide #12 Modern Compression: bzip2 > bzip2 -v bash.man tcsh.man bash.man: 4.821:1, bits/byte, 79.26% saved, in, out. tcsh.man: 4.259:1, bits/byte, 76.52% saved, in, out. > ls -l *bz2 -rw-r--r-- 1 waldenj Oct 4 19:45 bash.man.bz2 -rw-r--r-- 1 waldenj Oct 4 19:48 tcsh.man.bz2 > bzip2 -d bash.man.bz2 > bunzip2 tcsh.man.bz2 > ls -l *.man -rw-r--r-- 1 waldenj Oct 4 19:45 bash.man -rw-r--r-- 1 waldenj Oct 4 19:48 tcsh.man > bzip2 -dc bash.man.bz2 |less User Commands BASH(1) NAME bash - GNU Bourne-Again Shell

CIT 140: Introduction to ITSlide #13 Displaying Compressed Files zcat –Identical to compress -dc gzcat –Identical to gzip -dc bzcat2 –Identical to bzip2 -dc

CIT 140: Introduction to ITSlide #14 Compression Benchmarks > ls -l patch* -rw-r--r-- 1 waldenj Oct 4 19:37 patch rw-r--r-- 1 waldenj Oct 4 19:37 patch Z -rw-r--r-- 1 waldenj Oct 4 19:37 patch bz2 -rw-r--r-- 1 waldenj Oct 4 19:37 patch gz Compression ToolCompression Ratio compress64.6% gzip78.5% bzip282.7%

CIT 140: Introduction to ITSlide #15 Archiving Files: tar tar [-c] [-t] [-x] [-v] [-f file.tar] file1 [file2, …] -cCreate a new tape archive. -fWrite the archive to specified file instead of writing to tape. -tTrace (view) archive contents. -vProvide verbose output. -xeXtract archive contents.

CIT 140: Introduction to ITSlide #16 Archiving Files: tar > tar -cvf manpages.tar *.man bash.man tcsh.man > ls -l manpages.tar -rw-r--r-- 1 waldenj Oct 4 21:01 manpages.tar > tar -tf manpages.tar bash.man tcsh.man > tar -tvf manpages.tar -rw-r--r-- waldenj/students :45 bash.man -rw-r--r-- waldenj/students :48 tcsh.man > mkdir tmp > cd tmp > tar -xvf../manpages.tar bash.man tcsh.man

CIT 140: Introduction to ITSlide #17 Other File Compression Tools PKzip/WinZip zip, unzip ARJ arj, unarj RAR rar, unrar

CIT 140: Introduction to ITSlide #18 Sorting Ordering set of items by some criteria. Systems in which sorting is used include: –Words in a dictionary. –Names of people in a telephone directory. –Numbers.

CIT 140: Introduction to ITSlide #19 Sorting: sort sort [-f] [-i] [-d] [-l] [-v] file1 [file2, …] -dSort in dictionary order (default.) -fIgnore case of letters. -iIgnore non-printable characters. -nSort in numerical order. -rReverse order of sort -uDo not list duplicate lines in output.

CIT 140: Introduction to ITSlide #20 sort Example > cat days.txt Sunday Monday Tuesday Wednesday Thursday Friday Saturday > sort days.txt Friday Monday Saturday Sunday Thursday Tuesday Wednesday

CIT 140: Introduction to ITSlide #21 sort Example > cat days.txt Sunday Monday Tuesday Wednesday Thursday Friday Saturday > sort -r days.txt Wednesday Tuesday Thursday Sunday Saturday Monday Friday

CIT 140: Introduction to ITSlide #22 sort Example > cat numbers.txt > sort numbers.txt > sort -n numbers.txt