Review for Exam 1 Exam 1 on June 24 CSC 3320.

Slides:



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

ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Jan. 27 th, 2009 Essential Unix Commands.
Lesson 22 – Introduction to Linux Systems Administration.
Guide To UNIX Using Linux Third Edition
T UTORIAL OF U NIX C OMMAND & SHELL SCRIPT S 5027 Professor: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015.
Lecture 02CS311 – Operating Systems 1 1 CS311 – Lecture 02 Outline UNIX/Linux features – Redirection – pipes – Terminating a command – Running program.
Linux Commands LINUX COMMANDS.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
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.
Using the Unix Shell There is No ‘Undelete’. The Unix Shell “A Unix shell is a command-line interpreter or shell that provides a traditional user interface.
Brief introduction to UNIX A. Emerson CINECA, High Performance Systems.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
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.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
Dedan Githae, BecA-ILRI Hub Introduction to Linux / UNIX OS MARI eBioKit Workshop; Nov , 2014.
File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
L&T Infotech1 UNIX – Getting Started - Aneesh Ramani.
Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail.
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.
Getting the most out of the workshop Ask questions!!! Don’t sit next to someone you already know Work with someone with a different skillset and different.
E X C E E D I N G E X P E C T A T I O N S Basic LINUX Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Directory structure:
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Λειτουργικά Συστήματα – 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.
Files and Directories in UNIX The first file in UNIX file system is “root” or “/”
Linux Stuff Last Update Copyright 2014 Kenneth M. Chipps Ph.D. 1.
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.
Chapter Linux Basics. Acknowledgements This presentation was prepared by – Banyat Settapanich – Bahran Madaen This presentation will be updated later.
CSCI 330 UNIX and Network Programming Unit II Basic UNIX Usage: File System.
Basic Unix Commands. Listing files and directories ● ls:command is used to list the files and ● directories in present working directory ● ls command.
Lecture 1: Introduction, Basic UNIX Advanced Programming Techniques.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
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.
Learning Unix/Linux Based on slides from: Eric Bishop.
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.
Tutorial of Unix Command & shell scriptS 5027
Getting started with CentOS Linux
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.
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Part 1: Basic Commands/Utilities
Some Linux Commands.
C151 Multi-User Operating Systems
CS314 – Section 5 Recitation 1
Linux Basic Commands Visit to more Learning Resources.
Tutorial of Unix Command & shell scriptS 5027
Introduction to UNIX.
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
The Unix File System.
Chapter Four UNIX File Processing.
Getting started with CentOS Linux
Tutorial Unix Command & Makefile CIS 5027
Module 6 Working with Files and Directories
Linux Commands LINUX COMMANDS.
Review.
Presentation transcript:

Review for Exam 1 Exam 1 on June 24 CSC 3320

cat (like concatenate), head, tail ls, cd mv, cp, rm mkdir, rmdir pwd cat (like concatenate), head, tail ls, cd mv, cp, rm mkdir, rmdir file (determine file type), wc (word count) chmod Regular Expression grep, egrep, awk, sed at, crontab find, sort, tr, tar, ln, gzip, su, sudo CSC 3320

1) Create a sub-directory called “temp” in your home directory $ mkdir temp 2) Create a sub-directory called “subtemp” in “temp” $ mkdir ./temp/subtemp 3) Create file ex1.txt in “temp” and ex2.txt in “subtemp” $ cd temp $ cat > ex1.txt pwd ls ^D $ cd subtemp $ cat > ex2.txt Hello ex2! 4) Check file type and file's user access mode for file ex1.txt and ex2.txt $ cd ~ $ ls -l ./temp/ex1.txt CSC 3320

5) rename ex1.txt as ex1 and move it to home directory $ mv ~/temp/ex1.txt ~/ex1 6) change file pemissions of ex1, add user and group execute permission. $ chmod ug+x ~/ex1 7) copy file ex1 to your home directory $ cp ~/ex1 ~/ 8) copy the whole “temp” to ~/temp1 $ cp -r ~/temp ~/temp1 9) remove all files and sub-directories in “temp” $ rm -r ~/temp/* 10) remove “temp” $ rmdir ~/temp CSC 3320

Example Questions grant all exe files (extended name is exe) in the current directory or its subdirectories permission 777 create a hard link file1link for file1 display the hard link count for file1 and file1link remove file1 display the hard link count for file1link create a soft link file1 for file1link use ls –l display attributes of file1 and file1link CSC 3320

display the content of file1 use ls-l display file1 create a directory tartest in your home directory copy all files and directories in your home directory into tartest archive tartest to tartest.tar archive tartest to tartest1.tar with gzip option CSC 3320

display file size of tartest.tar and tartest1.tar archive the current directory to current.tar create a directory tartest2 in your home directory extract tartest.tar copy tartest1.tar to tartest2 and extract tartest1.tar in tartest2 CSC 3320

Given the file ‘rolllist' format: first-name last-name patherID register_way major credit CSC 3320

Example Questions (sort) sort file sort it in reverse order sort on second field set “,” as separator, sort on second field set “.” As separator , sort on the third field by numeric order CSC 3320

Basic Regular Expression & Extended Regular Expression Meta-characters in Basic Regular Expression ^ $ . * \( \) [ ] \{ \} \ vi, grep, sed accept basic regular expression. Meta-characters in Extended Regular Expression | ^ $ . * + ? ( ) [ ] { } \ egrep, grep –E, sed –E accept extended regular expression CSc 3320

Xabcdefghijklmnopqrstuv30 ^[A-Za-z]*[^,][A-Za-z]*$ AaBbCc,AaBbCc Regular Expression Text Match? [A-Z] AB [0-9] 2 111* 11 [V|B]+ VB ^[A-Z][a-z]*3[0-5] Xabcdefghijklmnopqrstuv30 ^[A-Za-z]*[^,][A-Za-z]*$ AaBbCc,AaBbCc ^[A-Z]..*$ A bcd CSC 3320

Example Qustions (grep/egrep) Given the file 'databook' (you can download it from website http://www.cs.gsu.edu/~xguo9/teaching/csc3320/databook) containing the lines of the following format: Type first-name last-name email-address CSC 3320

Example Qustions (grep/egrep) Do the following queries: Print all lines containing the string CS4520. b. Print all lines where the person's first name starts with J. c. Print all lines that contain .com d. Print all lines containing an upper-case letter, followed by four lower-case letters, a space and one uppercase letter. CSC 3320

Example Qustions (sed) Use the file 'databook', do the following queries: a. Change Dumitru's name to Dima. b. Delete the first 3 line. c. Print all lines where the email address contains @student.gsu.edu d. Replace the line containing "CS2010" with "NULL NULL NULL NULL". e. Append the following new line at the end of the file. CS 3320 Xuan Guo xuan_guo@outlook.com CSC 3320

Example Qustions (awk) a. Print all email address. b. Print Dumitru's name and email address. c. Change the type with the following rule: If line number modulo 3 is 1, the type field should be changed to CS4520. If line number modulo 3 is 2, the type field should be changed to CS2210. Otherwise keep the original type field. CSC 3320

Display the name of the owner of the shell Switch User to root Write a command that archives and compresses the contents of a file, and writes the result to a new file. What is the corresponding command to extract it to produce the original file? Write a command to find files in a directory hierarchy (e.g. your home directory) that have the name pattern '*.txt" and compress them. Display the name of the owner of the shell Switch User to root Schedule jobs in file crontab.cron to be executed on a periodic basis. List the content of a registered crontab file. Unregister crontab.cron file CSC 3320

Schedule jobs in file at.csh to be executed 3 minutes later. List the jobs which is scheduled by at Delete jobs of at.csh Print the line number and the content of file /etc/passwd from Line 10 to Line 50 Display the results of file “float” which covert all upper-case characters in file float into lower-case. CSC 3320