1 Day 5 Additional Unix Commands. 2 Important vs. Not Often in Unix there are multiple ways to do something. –In this class, we will learn the important.

Slides:



Advertisements
Similar presentations
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Advertisements

การใช้ระบบปฏิบัติการ UNIX พื้นฐาน บทที่ 4 File Manipulation วิบูลย์ วราสิทธิชัย นักวิชาการคอมพิวเตอร์ ศูนย์คอมพิวเตอร์ ม. สงขลานครินทร์ เวอร์ชั่น 1 วันที่
Jump to first page Unix Commands Monica Stoica Jump to first page Introduction to Unix n Unix was born in 1969 at Bell Laboratories, a research subdivision.
Introduction to Unix – CS 21 Lecture 10. Lecture Overview Midterm questions Jobs and processes description The foreground and background Controlling jobs.
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.
The Command Line, Part II, Pine, and Pico CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture.
Linux+ Guide to Linux Certification, Second Edition
Chapter 6 Basic Directory and File Management. Command Line Control Characters Control-s - Stops screen output - rarely used Control-q - Resumes screen.
UNIX Utilities Learning Objectives: 1. To understand the some basic utilities of UNIX File 2. To compare UNIX shell and popular shell 3. To learn Input/Output.
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.
UNIX Overview. 2 UNIX UNIX is a multi-user and multi-tasking operating system. Multi-tasking: Multiple processes can run concurrently. Multi-user: different.
Unix Filters Text processing utilities. Filters Filter commands – Unix commands that serve dual purposes: –standalone –used with other commands and pipes.
UNIX Filters.
1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and.
2 $ command Command Line Options ls –a –l hello hi Command Arguments.
Linux Commands LINUX COMMANDS.
1 Day 16 Sed and Awk. 2 Looking through output We already know what “grep” does. –It looks for something in a file. –Returns any line from the file that.
MCB Lecture #3 Sept 2/14 Intro to UNIX terminal.
1 Day 3 Directories Files Moving & Copying. 2 Case Sensitive First thing to learn about UNIX is that everything is case sensitive. Thus the files: –enda.
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”
Unix Basics Chapter 4.
Unix Talk #2 (sed). 2 You have learned…  Regular expressions, grep, & egrep  grep & egrep are tools used to search for text in a file  AWK -- powerful.
Day 2 Review of ITSK1601 – Intro Unix.. Break up into Cousin groups Each cousin group will work as a team. Each team will need 5 blank sheets of paper.
CS 497C – Introduction to UNIX Lecture 7: General-Purpose Utilities Chin-Chih Chang
Agenda Chapter 1: Linux (Unix) Features Commands (Chapters 2 & 3) Command Structure / Command line editing man, passwd, cal, date, whereis, which Working.
Linux+ Guide to Linux Certification, Third Edition
System Administration Introduction to Unix Session 2 – Fri 02 Nov 2007 Reference:  chapter 1, The Unix Programming Environment, Kernighan & Pike, ISBN.
1 Lecture 5 Additional useful commands COP 3353 Introduction to UNIX.
Week 3 Exploring Linux Filesystems. Objectives  Understand and navigate the Linux directory structure using relative and absolute pathnames  Describe.
Introduction to Bash Programming Ellen Zhang. Previous three classes What have we learnt so far ?
Module 6 – Redirections, Pipes and Power Tools.. STDin 0 STDout 1 STDerr 2 Redirections.
BIF713 Additional Utilities. Linux Utilities  You have learned many Linux commands. Here are some more that you can use:  Data Manipulation (Reg Exps)
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 – 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 Geraint Vaughan. What is UNIX? Command-line operating system (not point- and click) Designed for ‘experts’ Lots of different variants.
Day 6 COP 3502 David A. Gaitros Department of Computer Science Florida State University.
Unix and Samba By: IC Labs (Raj Kidambi). What is Unix?  Unix stands for UNiplexed Information and Computing System. (It was originally spelled "Unics.")
Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort.
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.
CSC414 “Introduction to UNIX/ Linux” Lecture 5. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
1 Day 2 Logging in, Passwords, Man, talk, write. 2 Logging in Unix is a multi user system –Many people can be using it at the same time. –Connections.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop III - Part A Shell Commands Professional Training.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
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.
© Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER FOUR – QUOTING IN DETAIL.
Day 12 Intro to Shell Scripting. Doing it all together Up until now, we have only used built in functions in Unix. What if we want to define our own functions?
Lesson 6-Using Utilities to Accomplish Complex Tasks.
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).
Learning Unix/Linux Based on slides from: Eric Bishop.
Tutorial of Unix Command & shell scriptS 5027
Quality Thought Technologies
Prepared by: Eng. Maryam Adel Abdel-Hady
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Unix Commands PowerPoint
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands:
Unix Scripting Session 4 March 27, 2008.
CSE 374 Programming Concepts & Tools
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Lecture 5 Additional useful commands COP 3353 Introduction to UNIX 1.
Unix Talk #2 (sed).
Introduction Paul Flynn
Tutorial Unix Command & Makefile CIS 5027
Linux Commands LINUX COMMANDS.
Lecture 5 Additional useful commands COP 3353 Introduction to UNIX 1.
Presentation transcript:

1 Day 5 Additional Unix Commands

2 Important vs. Not Often in Unix there are multiple ways to do something. –In this class, we will learn the important commands, and the most standard ones. Editors –vi, emacs, pico, joe etc. –These are all editors, all have different abilities, vi can do everything the others can do, and is the most standard editor. –More vs. less Less can do a few more things than more…but they are not immediately important. You can look at less later.

3 Cat Remember that “more” shows you the contents of a file. –It stops after each screen and waits for you to hit a space cat does the same thing, but does not stop. –So cat shows you the whole file without pausing. This is mostly useful for scripting. We will see its use later.

4 diff Shows you the difference between 2 text files. –diff file1 file2 –This will show us all the differences between file1 and file2. –Example: 12c12 < This Line was in File > This line replaced it in File 2

5 grep grep looks for something in a file. grep enda file1 Would look for any occurrence of the word “enda” in the file: file1

6 grep vs. egrep grep and egrep are very similar programs. –egrep can do a few additional things: –Look for multiple things at once: egrep ‘enda|edna’ file1 Would look for EITHER the word enda or the word edna –Both support the -i option which tells them to ignore case, making them case insensitive.

7 head Looks at the first few 10 lines of the file. –Sometimes handy when it’s a huge file, and you only care about what is at the top You can specify how many lines you want to see: –head -5 file1 Will show you the first 5 lines

8 tail Looks at the last 10 items in a file. Very useful for seeing the most recent things which happened in a file. Often used to look at logfiles. You can change how many lines it shows you: –tail -5 file1 Shows you the last 5 lines in the file

9 sort Sorts a bunch of stuff, and returns it to you sorted: –sort file3 Would return a sorted version of the file. Each line is sorted as a whole.

10 uniq Removes any duplicates that might be found in a file uniq file1 Would show you everything in file 1, but without any duplicate lines.

11 Pipes A pipe takes the output of one command, and sends it to another. e.g. We have seen that cat shows us what is in a file: –cat letters | sort Normally cat would just show you the contents of the file letters on the screen. But here its output is being “piped” into the command sort. The result is that we will see the contents of the file letters sorted now.

12 Piping with more One of the most common questions that comes up in unix, is “how do I stop it, there is more than a screen full” We know that “more” shows us a file, but stops at the end of each line. So we can use pipes and“more” to stop ANYTHING –e.g. ls /home Shows us a list of files in the directory /home There are so many, it will scroll off our screen before we can see it. –ls /home | more Still shows us the same thing, but stops at each screen full.

13 who / w / finger who tells you who is currently logged in. –And when they logged in. w tells you what everyone is currently doing finger tells you: –When someone last logged in –If they have new mail –When they last read mail

14 date / cal Date tells you what time and date the machine thinks it is. cal can show you a calendar for any month. By itself, it shows you this months calendar. Look at: –cal –This is the official calendar for September 1752 They adjusted the calendar then. Hence the weirdness

15 echo echo prints what you just typed. –Mostly useful for scripts Here is one example where its useful today: –echo “hello” | write enda

16 Zipping and Unzipping In Windows you have probably seen files which are zipped already. –blah.zip Zip is a way to compress a file and make it smaller. Then its easier to or send to someone. When they get it, they will need to unzip it. In unix, we will use the commands: –gzip –gunzip Once a file has been zipped, you can no longer look at it in “more” as it is now a binary file.