Fall Lecture 5. Operating Systems: Configuration & Use CIS345. The Linux Utilities. Mostafa Z. Ali.
|
|
- Scot Shields
- 5 years ago
- Views:
Transcription
1 Fall 2009 Lecture 5 Operating Systems: Configuration & Use CIS345 The Linux Utilities Mostafa Z. Ali mzali@just.edu.jo 1 1
2 The Linux Utilities Linux did not have a GUI. It ran on character based terminals only, using a CLI Command line utilities are often faster, more powerful Sometimes there is no GUI counterpart to a textual utility
3 Special Characters Avoid using special characters as regular ones until you understand how the shell interprets them E.g.: Avoid using these special characters in a file name because they make the file harder to reference on the command line: & ; *? ` [ ] ( ) $ < > { } # / \! ~ RETURN, SPACE, and TAB have special meanings to the shell, but are not considered special characters RETURN ends a command line and initiates execution of a command SPACE and TAB characters separate elements on the command line and are collectively known as whitespace or blanks
4 If you want to use a character that has a special meaning to the shell as a regular character, you can quote (or escape) it. A slash (/) is always a separator in a path name, EVEN when you quote it! To quote a character, precede it with a backslash (\) ** would be entered as \*\* \would be entered as \\
5 Another way to quote special characters is to enclose them between single quotation marks E.g.: ** would be entered as ** E.g.: This is a special character:> are all interpreted as regular characters The only way to quote the erase character (CONTROL H), the line kill character (CONTROL U), and other control characters (CONTROL M) is by preceding each with (CONTROL V). Single quotation marks and backslashes do not work! E.g.:
6 The following command sends the output of echo through a pipe to od (octal display) to display CONTROL U as octal 25 (025):
7 Basic Utilities Tip: Use a terminal, terminal emulator within a GUI, or a virtual console to experiment with all utilities A directory is a resource that can hold files Tip: When you log in on the system, you are working in your home directory. All the files you create are in your home directory unless you specify otherwise!
8 Ls: Lists the Names of Files Use the vim editor to create a file named practice
9 Cat: Displays a Text File The cat (catenate, which means to join together) utility displays the contents of a text file The ls utility displays the name of a file, whereas cat displays the contents of a file
10 rm: Deletes a File The rm (remove) utility deletes a file Tip: a safer way of removing files is to use the interactive form by following rm with the i option and then the name of the file to be deleted, to make sure you only delete the files that you intend to You can create an alias for rm i and put it in your startup file so that rm always runs in interactive mode
11 Less ls more: Display a Text File One Screen at a Time When you want to view a file that is longer than one screen, you can use either the less utility or the more utility Each of these utilities pauses after displaying a screen of text. You need to press SPACE bar to display the next screen These utilities are called pagers, because they display one page at a time At the end of the file, less displays an END message and waits for you to press q to return to the shell. Whereas more returns you directly to the shell You can press h while using any of these utilities to display the help screen while paging through a file E.g.: use the command less /etc/adduser.conf and see what happens
12 hostname: Displays the System Name The hostname utility displays the name of the system you are working on E.g.:
13 Working with Files Tip: after you enter one or more letters of a filename (following a command) on a command line, press TAB and the Bourne Again Shell will complete as much of the filename as it can
14 Cp: Copies a File The cp utility makes a copy of a file You can use cp to make a backup copy of a file or a copy to experiment with Syntax: cp source file destination file The destination file is then name that cp assigns to the resulting (new) copy of the file
15 The period in memo.copy is part of the filename just another character Sometimes it is useful to incorporate the date in the name of a copy of a file E.g.: Cp can destroy a file if the destination file exists before you give a cp command. Use i (interactive) option after the cp command
16 mv: Changes the Name of a File The mv (move) utility can rename a file without making a copy of it Syntax: mv existing filename new filename Mv can destroy a filename accidentally so use the i option to avoid it
17 Lpr: Prints a File The lpr (line printer) utility places one or more files in a print queue for printing On systems that have access to more than one printer, you can use lpstat p to display a list of available printers The p option instructs lpr to place a file in the queue for a specific printer This command does not specify a printer, so it goes to the default printer
18 Sends the file report to the printer mailroom You can see which jobs are in the print queue by giving an lpstat o command or using the lpq utility You can use the job number with the lprm utility to remove the job from print queue and stop it from printing
19 You can send more than one file to the printer with a single command:
20 grep: Searching for a String The grep utility searches through one or more files to see whether any contain a specified string of characters
21 The w option causes grep to match only whole words You do not need to enclose the string you are searching for in single quotes, but doing so allows you to put SPACEs and special characters in the search string
22 head: Displays the Beginning of a File The head utility displays the first ten lines of a file The utility helps you remember what a particular file contains E.g.: Assuming you have a file named months that lists 12 months of the year in calendar order, one to a line:
23 The utility can display any number of lines. Include a hyphen followed by the number of lines you want head to display:
24 tail: Displays the End of a File The tail utility is similar to head but by default displays the last ten lines of a file You can monitor lines as they are added to the end of the growing file named logfile with the following command: Press the interrupt key (CONTROL C) to stop tail and display the shell prompt
25 sort: Displays a File in Order The sort utility displays the contents of a file in order by lines but does not change the original file The u option generates a sorted list in which each line is unique (no duplicates) The n option puts a list of numbers in numerical order
26 Uniq: Removes Duplicate Lines from a File The uniq (unique) utility displays a file, skipping adjacent duplicate lines, but does not change the original file If a file is sorted before it is processed by uniq, this utility ensures that no two lines in the file are the same
27 diff: Compares Two Files The diff (difference) utility compares two files and displays a list of the differences between them It is useful when you want to compare two versions of a letter, report, or source code for a program When using the u (unified output format) option first displays two lines indicating which of the files you are comparing will be denoted by a plus sign (+) and which by a minus sign ( )
28 The diff u command breaks long, multiline text into hunks, where each hunk is preceded by a line starting and ending with 2 at signs (@@) The hunk identifies the starting line number and the number of lines from each file for this hunk What the hunk covers from both files
29 File: Identifies the Contents of a File The file utility is used to learn about the contents of any file on a Linux system without having to open the file and examining it yourself
30 (Pipe): Communicates Between Processes Process: the execution of a command by Linux One of the hallmarks of both UNIX and Linux is the communication between processes The pipe ( ) appearing as a solid or broken vertical line on your keyboard, provides the simplest form of this kind of communication The pipe takes the output of one utility and sends it as an input to another utility Most of what a process displays on the screen is sent to standard output
31 $ sort months head 4 Apr Aug Dec Feb $ ls wc w 14 Displaying the # of files in a directory. The wc (word count) utility with the w option displays the # of words in its standard input or in a file you specify on the command line $ tail months lpr
32 Echo: Displays Text The echo utility copies the characters you type on the command line after echo to the screen When an unquoted asterisk (*) is used on the command line, the shell expands the asterisk into a list of filenames in the directory
33 You can use echo to create a simple file by redirecting its output to a file: $ echo My new file. > myfile $ cat myfile My new file
34 date: Displays the Time and Date You can choose the format and select the contents of the output of date:
35 Script: Records a Shell Session The script utility records all or part of a login session, including your input and system s responses It does capture the session with vim, but vim uses control characters to position the cursor the output will be difficult to read cat a file to make the session quickly pass before your eyes
36 By default script captures the session in a file named typescript. To specify a different filename: $ Script filename Use the a option to append to a file, otherwise script overwrites an existing file
37 todos: Converts Linux and Macintosh Files to Windows Format The todos (to DOS) utility converts a Linux text file so it can be read on Windows or Macintosh system This utility is part of the tofrodos software package. To install it: Sudo aptitude install tofrodos E.g.: $ Todos memo.txt
38 Use the b (backup) option to cause todos to make a copy of the file with a.bak filename extension before modifying it To convert Windows or Macintosh files so they can be read on a Linux system, use the fromdos utility as in: $ fromdos memo.txt
39 You can use tr (translate) to change a Windows or Macintosh text file into a Linux text file $ cat memo tr d \r > memo.txt The d (delete) option causes tr to remove RETURNs (represented by \r) as it makes a copy of the file The (>) symbol in the previous example redirects the standard output of tr to the file named memo.txt
40 Compressing and Archiving Files bzip2: Compresses a File The bzip2 utility compresses a file by analyzing it and recoding it more efficiently The bzip2 utility works particularly well on files that contain a lot of repeated information such as text and some image data The l (long) option causes ls to display more information The v (verbose) option causes bzip2 to report how much it was able to reduce the size of the file The file in the previous example becomes 50 bytes long. The bzip2 utility also renamed the file, appending.bz2 to its name
41 The bzip2 utility (and its counterpart, bunzip2) remove the original file when they compress or decompress a file, so you need to use the k (keep) option to keep the original file
42 bunzip2 and bzcat: Decompresses a File Bunzip2 utility restores a file that has been compressed with bzip2 The bzcat utility displays a file that has been compressed with bzip2 The equivalent of cat for.bz2 files, bzcat decompresses the compressed data and displays the decompressed data
43 Like cat, bzcat does not change the source file The bzip2recover utility recovers from media errors (for corrupted files)
44 Gzip: Compresses a File gzip (GNU zip) utility is older and less efficient than bzip2 Its flags and operation are very similar to those of bzip2 A file compressed by gzip is marked by a.gz filename extension Use gzip, gunzip, and zcat just as you would use bzip2, bunzip2, and bzcat, respectively The compress utility can also compress files, not as well as gzip. It marks a file that it has compresses by adding.z to its name Tip: do not confuse gzip and gunzip with zip and unzip utilities (system running Windows)
45 tar: Packs and Unpacks Archives tar: short for tape archive and it was used to create and read archives and backup tapes It is used to create a single file (called tar, archive, or tarball) from multiple files or directory hierarchies and to extract files from a tar file tar uses the c (create), v (verbose), and f (write to or read from a file) options to create the archive all.tar
46 The tar utility adds overhead as in the previous example which is more appreciable on smaller files The t option displays a table of contents for the archive The x option can be used instead of the t in that example to extract files from a tar archive You can use bzip2, compress, or gzip to compress tar files, making them easier to store and handle Apply tar then bzip2 filename extension of.tar.bz2 or.tbz Apply tar then gzip filename extension of.tar.gz or.tz Apply tar then compress.tar.z extension
47 To unpack a tarred and gzipped file: The asterisk (*) in the filename matches any character in any filenames which saves typing
48 The d (directory ) option causes ls to display only file and directory names, not the contents of the directory as it normally does
49 You can combine the gunzip and tar commands on one command line with a pipe ( ): The c option causes gunzip to send its output through the pipe instead of creating a file The final hyphen ( ) causes tar to read from standard input A simpler solution is to use z option to tar which causes tar to call gunzip (or gzip when you are creating an archive) directly and simplifies the preceding command to:
50 slocate: Searches for a File The slocate is part of the slocate software package. To install it: sudo aptitude install slocate
51 Obtaining User and System Information who: Lists Users on the System The who utility displays a list of users who are logged in on the local system The 2 nd column shows the device that each user s terminal, workstation, or terminal emulator is connected to The 3 rd column shows the date and time the user the user logged in The 4 th column is optional and shows in parenthesis the name of the system that a remote user logged in from
52 The information that who displays is useful when you want to communicate with a user on the local system When the user is logged in, you can write to establish communication immediately If the output of who runs off the screen redirect the output through a pipe to less, or you can use the pipe to redirect the output through grep to look for a specific name If you need to find out which terminal you are using, or what time you logged in, you can use the command who am i as in:
53 finger: Lists Users on the System In addition to usernames, finger supplies each user s full name along with information about the device the user s terminal is connected to, how recently you typed something using the keyboard, when the user logged in, and what contact information is available $ finger Login Name Tty Idle Login Time Office Mostafa Mostafa Ali *tty2 Jul 25 16:42 Mostafa Mostafa Ali Pts/4 3 Jul 25 17:27 (Razor) Sonia Sonia the flower *tty4 29 Jul 25 17:18 Alex Alex Isaac *tty1 1:07 Jul 25 16:39 The * means that the user has blocked messages sent to the terminal
54 $ finger alex Login: alex Name: Alex Isaac Directory: /home/alex Shell: /bin/bash On since Wed Jul 25 16:39 (PDT) on tty1 (messages off) 5 minutes 52 seconds idle On since Wed Jun 6 12:47 (PDT) on tty1 from Razor Last login Wed Jun 6 12:47 (PDT) on 1 from Razor New mail received Wed Jul 25 11: (PDT) Unread since Wed Jul 25 11: (PDT) Plan: I will be at a conference in Hawaii all next week. If you need to see me, contact CIS Dep., x1693. Most of the information in this example was collected by finger from system files. The finger utility searched for a file named.plan in Alex s home directory and displayed its contents In a similar manner, finger displays the contents of the.project and.pgpkey files in your home directory
55 The finger utility, which is not case sensitive, can search for information on Mostafa using his first or last name: $ finger Mostafa Login: Excalibur Name: Mostafa Ali. $ finger Ali Login: Excalibur Name: Mostafa Ali
56 W: Lists Users on the System The w utility displays a list of the users who are logged in The JCPU and PCPU columns identify how much computer processor time each user has used during this login session and on the task that is running. The last column shows the command each user is running
57 The first line that the w utility displays includes the time of day, the period of time the computer has been running (days, hours, minutes), the # of users logged in, and the load average (how busy the system is) The three load average #s represent the # of jobs waiting to run, averaged over the past 1, 5, and 15 minutes Use the uptime utility to display just this line
58
59 Communicating with other Users Write: Sends a Message The write utility sends a message to another user who is logged in which establishes two way communication Syntax: The terminal is an optional device name that is useful if the user is logged in more than once
60 Sometimes it helps to type o (over) when you are ready for the other person to type and type oo (over and out) when you are ready to end the conversation: Pressing CONTROL D stops the communication and returns to the shell
61 mesg: Denies or Accepts Messages Messages to the screen are blocked by default To allow other users to send you messages: $ mesg y If max had given this command before Zach tried to send him a message, Zach would have seen: $ write max Write: max has messages disabled
62 Using vim to Create and Edit a File In addition to working with these slides, you may want to try vim s instructional program (vimtutor). Give its name as a command to run it Vimtutor and vim help files are not installed by default. To install: sudo aptitude install vim runtime Start vim as: $ vim practice Which opens a screen like this
63 The tildes (~) at the left means that the file is empty. They disappear as you add lines of text to the file If you start vim with a terminal that is not in the terminfo database, vim displays an error message and the terminal type defaults to ansi, which works on many terminals To reset the terminal type, press ESCAPE and then give the following command to exit vim and display the shell prompt: :q! Which quits without saving your work
64 Command and Input Modes vim s modes of operation: Command mode (Normal mode) and Input mode Last line mode In input mode vim accepts anything you enter as text and displays it on the screen. Press ESCAPE to return vim to the Command mode Vim displays INSERT at the lower left corner of the screen while it is in Insert mode To display line numbers next to the text you are editing: :set number RETURN
65 The colon (:) puts vim into another mode, last line mode To turn off line numbers: :set nonumber RETURN Remember that vim is case sensitive
66 Entering Text When you start vim, you must put it in Input mode before start typing by pressing the i (insert before cursor) key or the a (append after cursor) key The keys that backup and correct a shell command line serve the same functions when vim is in input mode The erase, line kill, and word kill keys (CONTROL H, CONTROL U, and CONTROL W, respectively)
67 While vim is in Command mode, you use the RTURN key, the SPACE bar, and the ARROW keys to move the cursor If your terminal does not have ARROW keys or if the emulator does not support them, you can use h, j, k, l keys to move the cursor left, down, up, and right, respectively To delete a single character you can move the cursor until it is over the character you want to delete and then giving the command x To delete a word, move the cursor on the first letter of the word and then giving the command dw (delete word) To delete a line of text, move the cursor until it is anywhere on the line and then the command dd A shorthand for the two commands dw followed by the i command is cw (change word), which puts vim into Input mode
68 Undoing Mistakes If you delete a character, line, or word by mistake or give any command you want to reverse, give the command u (Undo) immediately after the command you want to undo With the compatible parameter set however, vim can undo only the most recent change
69 Entering Additional Text To insert new text within existing text, you can: move the cursor so it is on the character that follows the new text you plan to enter. Then give the i (Insert) command to put vim in Input mode, enter the new text, and press ESCAPE to return vim to Command mode Or you can position the cursor on the character that precedes the new text and use the a (Append) command To enter one or more lines, position the cursor on the line above where you want the new text to go. Give the command o (Open) vim opens a blank line, puts the cursor on it, and goes into Input mode The O command works in the same way o works, except that it opens a blank line above the line the cursor is on
70 Ending the Editing Session When vim is in Command mode, use ZZ (uppercase Zs) command to write then newly entered text to the disk and end the editing session
Utilities. September 8, 2015
Utilities September 8, 2015 Useful ideas Listing files and display text and binary files Copy, move, and remove files Search, sort, print, compare files Using pipes Compression and archiving Your fellow
More informationLecture # 2 Introduction to UNIX (Part 2)
CS390 UNIX Programming Spring 2009 Page 1 Lecture # 2 Introduction to UNIX (Part 2) UNIX is case sensitive (lowercase, lowercase, lowercase) Logging in (Terminal Method) Two basic techniques: 1. Network
More informationIMPORTANT: Logging Off LOGGING IN
These are a few basic Unix commands compiled from Unix web sites, and printed materials. The main purpose is to help a beginner to go around with fewer difficulties. Therefore, I will be adding to this
More informationContents. xxvii. Preface
Preface xxvii Chapter 1: Welcome to Linux 1 The GNU Linux Connection 2 The History of GNU Linux 2 The Code Is Free 4 Have Fun! 5 The Heritage of Linux: UNIX 5 What Is So Good About Linux? 6 Why Linux Is
More informationHandling Ordinary Files
Handling Ordinary Files Unit 2 Sahaj Computer Solutions visit : projectsatsahaj.com 1 cat: Displaying and Creating Files cat is one of the most frequently used commands on Unix-like operating systems.
More informationContents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...
Contents Note: pay attention to where you are........................................... 1 Note: Plaintext version................................................... 1 Hello World of the Bash shell 2 Accessing
More informationIntroduction to Linux
Introduction to Linux University of Bristol - Advance Computing Research Centre 1 / 47 Operating Systems Program running all the time Interfaces between other programs and hardware Provides abstractions
More informationUnix/Linux Primer. Taras V. Pogorelov and Mike Hallock School of Chemical Sciences, University of Illinois
Unix/Linux Primer Taras V. Pogorelov and Mike Hallock School of Chemical Sciences, University of Illinois August 25, 2017 This primer is designed to introduce basic UNIX/Linux concepts and commands. No
More informationIntroduction. File System. Note. Achtung!
3 Unix Shell 1: Introduction Lab Objective: Explore the basics of the Unix Shell. Understand how to navigate and manipulate file directories. Introduce the Vim text editor for easy writing and editing
More informationChapter-3. Introduction to Unix: Fundamental Commands
Chapter-3 Introduction to Unix: Fundamental Commands What You Will Learn The fundamental commands of the Unix operating system. Everything told for Unix here is applicable to the Linux operating system
More informationRH033 Red Hat Linux Essentials
RH033 Red Hat Linux Essentials Version 3.5 QUESTION NO: 1 You work as a Network Administrator for McNeil Inc. The company has a Linux-based network. A printer is configured on the network. You want to
More informationUnix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University
Unix/Linux Basics 1 Some basics to remember Everything is case sensitive Eg., you can have two different files of the same name but different case in the same folder Console-driven (same as terminal )
More informationIntroduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.
Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p. 2 Conventions Used in This Book p. 2 Introduction to UNIX p. 5 An Overview
More informationTable of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs
Summer 2010 Department of Computer Science and Engineering York University Toronto June 29, 2010 1 / 36 Table of contents 1 2 3 4 2 / 36 Our goal Our goal is to see how we can use Unix as a tool for developing
More information2) clear :- It clears the terminal screen. Syntax :- clear
1) cal :- Displays a calendar Syntax:- cal [options] [ month ] [year] cal displays a simple calendar. If arguments are not specified, the current month is displayed. In addition to cal, the ncal command
More informationA Brief Introduction to the Linux Shell for Data Science
A Brief Introduction to the Linux Shell for Data Science Aris Anagnostopoulos 1 Introduction Here we will see a brief introduction of the Linux command line or shell as it is called. Linux is a Unix-like
More informationGetting Started. Logging In and Out. Adapted from Practical Unix and Programming Hunter College
Getting Started Logging In and Out Adapted from Practical Unix and Programming Hunter College Copyright 2006 Stewart Weiss Getting started: logging in and out Every user in UNIX has a username (also called
More informationCSC UNIX System, Spring 2015
CSC 352 - UNIX System, Spring 2015 Study guide for the CSC352 midterm exam (20% of grade). Dr. Dale E. Parson, http://faculty.kutztown.edu/parson We will have a midterm on March 19 on material we have
More informationITST Searching, Extracting & Archiving Data
ITST 1136 - Searching, Extracting & Archiving Data Name: Step 1 Sign into a Pi UN = pi PW = raspberry Step 2 - Grep - One of the most useful and versatile commands in a Linux terminal environment is the
More informationEssential Unix (and Linux) for the Oracle DBA. Revision no.: PPT/2K403/02
Essential Unix (and Linux) for the Oracle DBA Revision no.: PPT/2K403/02 Architecture of UNIX Systems 2 UNIX System Structure 3 Operating system interacts directly with Hardware Provides common services
More informationUnix Introduction to UNIX
Unix Introduction to UNIX Get Started Introduction The UNIX operating system Set of programs that act as a link between the computer and the user. Developed in 1969 by a group of AT&T employees Various
More informationIntroduction to Linux Organizing Files
Introduction to Linux Organizing Files Computational Science and Engineering North Carolina A&T State University Instructor: Dr. K. M. Flurchick Email: kmflurch@ncat.edu Arranging, Organizing, Packing
More informationCS Unix Tools & Scripting
Cornell University, Spring 2014 1 January 29, 2014 1 Slides evolved from previous versions by Hussam Abu-Libdeh and David Slater Vim: Tip of the day! Search and Replace Search for search term: /search
More informationTopic 2: More Shell Skills. Sub-Topic 1: Quoting. Sub-Topic 2: Shell Variables. Difference Between Single & Double Quotes
Topic 2: More Shell Skills Sub-Topic 1: Quoting Sub-topics: 1 quoting 2 shell variables 3 sub-shells 4 simple shell scripts (no ifs or loops yet) 5 bash initialization files 6 I/O redirection & pipes 7
More informationIntroduction to remote command line Linux. Research Computing Team University of Birmingham
Introduction to remote command line Linux Research Computing Team University of Birmingham Linux/UNIX/BSD/OSX/what? v All different v UNIX is the oldest, mostly now commercial only in large environments
More informationFREEENGINEER.ORG. 1 of 6 11/5/15 8:31 PM. Learn UNIX in 10 minutes. Version 1.3. Preface
FREEENGINEER.ORG Learn UNIX in 10 minutes. Version 1.3 Preface This is something that I had given out to students (CAD user training) in years past. The purpose was to have on one page the basics commands
More informationUNIX Quick Reference
UNIX Quick Reference Charles Duan FAS Computer Services August 26, 2002 1 Command Reference Many of these commands have many more options than the ones displayed here. Most also take the option h or help,
More information7. Archiving and compressing 7.1 Introduction
7. Archiving and compressing 7.1 Introduction In this chapter, we discuss how to manage archive files at the command line. File archiving is used when one or more files need to be transmitted or stored
More informationBasic Linux Command Line Interface Guide
This basic Linux Command-Line Interface (CLI) Guide provides a general explanation of commonly used Bash shell commands for the Barracuda NG Firewall. You can access the command-line interface by connecting
More informationIntroduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines
Introduction to UNIX Logging in Basic system architecture Getting help Intro to shell (tcsh) Basic UNIX File Maintenance Intro to emacs I/O Redirection Shell scripts Logging in most systems have graphical
More informationRead the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal.
Warnings 1 First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion. Read the relevant material in Sobell! If
More information5/8/2012. Exploring Utilities Chapter 5
Exploring Utilities Chapter 5 Examining the contents of files. Working with the cut and paste feature. Formatting output with the column utility. Searching for lines containing a target string with grep.
More informationBIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description:
BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: This course provides Bioinformatics students with the
More informationComputer Systems and Architecture
Computer Systems and Architecture Introduction to UNIX Stephen Pauwels University of Antwerp October 2, 2015 Outline What is Unix? Getting started Streams Exercises UNIX Operating system Servers, desktops,
More informationGetting Started with UNIX
Getting Started with UNIX What is UNIX? Boston University Information Services & Technology Course Number: 4000 Course Instructor: Kenny Burns Operating System Interface between a user and the computer
More informationShell Programming Overview
Overview Shell programming is a way of taking several command line instructions that you would use in a Unix command prompt and incorporating them into one program. There are many versions of Unix. Some
More informationIntroduction to Linux Environment. Yun-Wen Chen
Introduction to Linux Environment Yun-Wen Chen 1 The Text (Command) Mode in Linux Environment 2 The Main Operating Systems We May Meet 1. Windows 2. Mac 3. Linux (Unix) 3 Windows Command Mode and DOS Type
More informationStd: XI CHAPTER-3 LINUX
Commands: General format: Command Option Argument Command: ls - Lists the contents of a file. Option: Begins with minus sign (-) ls a Lists including the hidden files. Argument refers to the name of a
More informationIntroduction to Unix: Fundamental Commands
Introduction to Unix: Fundamental Commands Ricky Patterson UVA Library Based on slides from Turgut Yilmaz Istanbul Teknik University 1 What We Will Learn The fundamental commands of the Unix operating
More informationUsing LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)
Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12) Objective: Learn some basic aspects of the UNIX operating system and how to use it. What is UNIX? UNIX is the operating system used by most computers
More informationMills HPC Tutorial Series. Linux Basics I
Mills HPC Tutorial Series Linux Basics I Objectives Command Line Window Anatomy Command Structure Command Examples Help Files and Directories Permissions Wildcards and Home (~) Redirection and Pipe Create
More informationCSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80
CSE 303 Lecture 2 Introduction to bash shell read Linux Pocket Guide pp. 37-46, 58-59, 60, 65-70, 71-72, 77-80 slides created by Marty Stepp http://www.cs.washington.edu/303/ 1 Unix file system structure
More informationConnecting to ICS Server, Shell, Vim CS238P Operating Systems fall 18
Connecting to ICS Server, Shell, Vim CS238P Operating Systems fall 18 By Aftab Hussain (Adapted from Claudio A. Parra s Slides for Fall 18 CS-143A) October 5 2018 University of California, Irvine Andromeda
More information5/20/2007. Touring Essential Programs
Touring Essential Programs Employing fundamental utilities. Managing input and output. Using special characters in the command-line. Managing user environment. Surveying elements of a functioning system.
More informationUNIX Quick Reference
UNIX Quick Reference This card represents a brief summary of some of the more frequently used UNIX commands that all users should be at least somewhat familiar with. Some commands listed have much more
More informationCISC 220 fall 2011, set 1: Linux basics
CISC 220: System-Level Programming instructor: Margaret Lamb e-mail: malamb@cs.queensu.ca office: Goodwin 554 office phone: 533-6059 (internal extension 36059) office hours: Tues/Wed/Thurs 2-3 (this week
More informationGetting Started. Running Utilities. Shells. Special Characters. Special Characters. Chapter 2 Unix Utilities for non-programmers
Chapter 2 Unix Utilities for non-programmers Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman Converted to presentation
More informationIntroduction to Linux (Part I) BUPT/QMUL 2018/03/14
Introduction to Linux (Part I) BUPT/QMUL 2018/03/14 Contents 1. Background on Linux 2. Starting / Finishing 3. Typing Linux Commands 4. Commands to Use Right Away 5. Linux help continued 2 Contents 6.
More informationWeek Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages
ULI101 Week 02 Week Overview Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages Text editing Common file utilities: cat,more,less,touch,file,find
More informationIntroduction to the shell Part II
Introduction to the shell Part II Graham Markall http://www.doc.ic.ac.uk/~grm08 grm08@doc.ic.ac.uk Civil Engineering Tech Talks 16 th November, 1pm Last week Covered applications and Windows compatibility
More informationChapter 4. Unix Tutorial. Unix Shell
Chapter 4 Unix Tutorial Users and applications interact with hardware through an operating system (OS). Unix is a very basic operating system in that it has just the essentials. Many operating systems,
More informationBasics. I think that the later is better.
Basics Before we take up shell scripting, let s review some of the basic features and syntax of the shell, specifically the major shells in the sh lineage. Command Editing If you like vi, put your shell
More informationTHE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering
THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering ENG224 Information Technology Part I: Computers and the Internet Laboratory 2 Linux Shell Commands and vi Editor
More informationTopic 2: More Shell Skills
Topic 2: More Shell Skills Sub-topics: 1 quoting 2 shell variables 3 sub-shells 4 simple shell scripts (no ifs or loops yet) 5 bash initialization files 6 I/O redirection & pipes 7 aliases 8 text file
More informationBasic Linux Command Line Interface Guide
This basic Linux Command-Line Interface (CLI) Guide provides a general explanation of commonly used Bash shell commands for the Barracuda NG Firewall. You can access the command-line interface by connecting
More informationUnix File System. Learning command-line navigation of the file system is essential for efficient system usage
ULI101 Week 02 Week Overview Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages Text editing Common file utilities: cat,more,less,touch,file,find
More informationUnix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011
Unix/Linux Operating System Introduction to Computational Statistics STAT 598G, Fall 2011 Sergey Kirshner Department of Statistics, Purdue University September 7, 2011 Sergey Kirshner (Purdue University)
More informationIntroduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen
Introduction to Unix The Windows User perspective Wes Frisby Kyle Horne Todd Johansen What is Unix? Portable, multi-tasking, and multi-user operating system Software development environment Hardware independent
More informationLab 3a Using the vi editor
Lab 3a Using the vi editor Objectives: Become familiar with the vi Editor Review the three vi Modes Review keystrokes to move between vi modes Create a new file with vi Editor Invoke vi with show mode
More informationCloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK
Cloud Computing and Unix: An Introduction Dr. Sophie Shaw University of Aberdeen, UK s.shaw@abdn.ac.uk Aberdeen London Exeter What We re Going To Do Why Unix? Cloud Computing Connecting to AWS Introduction
More informationCommon UNIX Utilities Alphabetical List
Common UNIX Utilities Alphabetical List addbib - create or extend a bibliographic database apropos - locate commands by keyword lookup ar - create library archives, and add or extract files at - execute
More informationLecture 5. Additional useful commands. COP 3353 Introduction to UNIX
Lecture 5 Additional useful commands COP 3353 Introduction to UNIX diff diff compares two text files ( can also be used on directories) and prints the lines for which the files differ. The format is as
More informationCloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK
Cloud Computing and Unix: An Introduction Dr. Sophie Shaw University of Aberdeen, UK s.shaw@abdn.ac.uk Aberdeen London Exeter What We re Going To Do Why Unix? Cloud Computing Connecting to AWS Introduction
More informationSome useful UNIX Commands written down by Razor for newbies to get a start in UNIX
Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX 15th Jan. 2000 / 3:55 am Part 1: Working with files and rights ------------------------------------- cp
More informationReview of Fundamentals
Review of Fundamentals 1 The shell vi General shell review 2 http://teaching.idallen.com/cst8207/14f/notes/120_shell_basics.html The shell is a program that is executed for us automatically when we log
More informationCOMS 6100 Class Notes 3
COMS 6100 Class Notes 3 Daniel Solus September 1, 2016 1 General Remarks The class was split into two main sections. We finished our introduction to Linux commands by reviewing Linux commands I and II
More informationComputer Architecture Lab 1 (Starting with Linux)
Computer Architecture Lab 1 (Starting with Linux) Linux is a computer operating system. An operating system consists of the software that manages your computer and lets you run applications on it. The
More informationBasic Shell Commands
Basic Shell Commands Jeremy Sanders October 2011 1. acroread - Read or print a PDF file. 2. cat - Send a file to the screen in one go. Useful for piping to other programs cat file1 # list file1 to screen
More informationIntroduction To Linux. Rob Thomas - ACRC
Introduction To Linux Rob Thomas - ACRC What Is Linux A free Operating System based on UNIX (TM) An operating system originating at Bell Labs. circa 1969 in the USA More of this later... Why Linux? Free
More informationOpen up a terminal, make sure you are in your home directory, and run the command.
More Linux Commands 0.1 wc The Linux command for acquiring size statistics on a file is wc. This command can provide information from line count, to bytes in a file. Open up a terminal, make sure you are
More informationUNIX and Linux Essentials Student Guide
UNIX and Linux Essentials Student Guide D76989GC10 Edition 1.0 June 2012 D77816 Authors Uma Sannasi Pardeep Sharma Technical Contributor and Reviewer Harald van Breederode Editors Anwesha Ray Raj Kumar
More informationCSE 390a Lecture 6. bash scripting continued; remote X windows; unix tidbits
CSE 390a Lecture 6 bash scripting continued; remote X windows; unix tidbits slides created by Marty Stepp, modified by Jessica Miller and Ruth Anderson http://www.cs.washington.edu/390a/ 1 Lecture summary
More informationModule 8 Pipes, Redirection and REGEX
Module 8 Pipes, Redirection and REGEX Exam Objective 3.2 Searching and Extracting Data from Files Objective Summary Piping and redirection Partial POSIX Command Line and Redirection Command Line Pipes
More informationPractical Unix exercise MBV INFX410
Practical Unix exercise MBV INFX410 We will in this exercise work with a practical task that, it turns out, can easily be solved by using basic Unix. Let us pretend that an engineer in your group has spent
More informationExamples: Directory pathname: File pathname: /home/username/ics124/assignments/ /home/username/ops224/assignments/assn1.txt
ULI101 Week 03 Week Overview Absolute and relative pathnames File name expansion Shell basics Command execution in detail Recalling and editing previous commands Quoting Pathnames A pathname is a list
More informationUNIX Basics. UNIX Basics CIS 218 Oakton Community College
UNIX Basics UNIX Basics CIS 218 Oakton Community College History UNIX was invented in 1969 at AT&T Bell Labs Ken Thompson and Dennis Ritchie are credited as the original architects and developers of C.
More informationIntro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab
Basic Terminal Intro to Linux ssh short for s ecure sh ell usage: ssh [host]@[computer].[otheripstuff] for lab computers: ssh [CSID]@[comp].cs.utexas.edu can get a list of active computers from the UTCS
More informationFiles
http://www.cs.fsu.edu/~langley/cop3353-2013-1/reveal.js-2013-02-11/02.html?print-pdf 02/11/2013 10:55 AM Files A normal "flat" file is a collection of information. It's usually stored somewhere reasonably
More informationIntroduction to Linux. Roman Cheplyaka
Introduction to Linux Roman Cheplyaka Generic commands, files, directories What am I running? ngsuser@ubuntu:~$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=16.04 DISTRIB_CODENAME=xenial DISTRIB_DESCRIPTION="Ubuntu
More informationComputer Systems and Architecture
Computer Systems and Architecture Stephen Pauwels Computer Systems Academic Year 2018-2019 Overview of the Semester UNIX Introductie Regular Expressions Scripting Data Representation Integers, Fixed point,
More informationOxford University Computing Services. Getting Started with Unix
Oxford University Computing Services Getting Started with Unix Unix c3.1/2 Typographical Conventions Listed below are the typographical conventions used in this guide. Names of keys on the keyboard are
More informationVirtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you. https://www.virtualbox.org/
Virtual Machine Anyone have problems installing it? VM: Virtual Box - allows you to run a different operating system within the current operating system of your machine. https://www.virtualbox.org/ Linux
More informationSub-Topic 1: Quoting. Topic 2: More Shell Skills. Sub-Topic 2: Shell Variables. Referring to Shell Variables: More
Topic 2: More Shell Skills Plan: about 3 lectures on this topic Sub-topics: 1 quoting 2 shell variables 3 sub-shells 4 simple shell scripts (no ifs or loops yet) 5 bash initialization files 6 I/O redirection
More informationOutline. Structure of a UNIX command
Outline Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission (owner, group, rwx) File and directory
More informationThis lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]
Data and Computer Security (CMPD414) Lab II Topics: secure login, moving into HOME-directory, navigation on Unix, basic commands for vi, Message Digest This lab exercise is to be submitted at the end of
More informationSet 1 MCQ Which command is used to sort the lines of data in a file in reverse order A) sort B) sh C) st D) sort -r
1. Which symbol will be used with grep command to match the pattern pat at the beginning of a line? A) ^pat B) $pat C) pat$ D) pat^ 2. Which command is used to sort the lines of data in a file in reverse
More informationSession: Shell Programming Topic: Additional Commands
Lecture Session: Shell Programming Topic: Additional Commands Daniel Chang diff [-b][-i][-w] filename1 filename2 diff [-b][-i][-w] filename1 directory1 diff [-b][-i][-w][-r] directory1 directory2 Description:
More informationPractical Session 0 Introduction to Linux
School of Computer Science and Software Engineering Clayton Campus, Monash University CSE2303 and CSE2304 Semester I, 2001 Practical Session 0 Introduction to Linux Novell accounts. Every Monash student
More informationLinux Bootcamp Fall 2015
Linux Bootcamp Fall 2015 UWB CSS Based on: http://swcarpentry.github.io/shell-novice "Software Carpentry" and the Software Carpentry logo are registered trademarks of NumFOCUS. What this bootcamp is: A
More informationIntroduction to Linux Part 1. Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017
Introduction to Linux Part 1 Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017 ssh Login or Interactive Node kingspeak.chpc.utah.edu Batch queue system kp001 kp002. kpxxx FastX
More informationReview of Fundamentals. Todd Kelley CST8207 Todd Kelley 1
Review of Fundamentals Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 GPL the shell SSH (secure shell) the Course Linux Server RTFM vi general shell review 2 These notes are available on
More informationScripting Languages Course 1. Diana Trandabăț
Scripting Languages Course 1 Diana Trandabăț Master in Computational Linguistics - 1 st year 2017-2018 Today s lecture Introduction to scripting languages What is a script? What is a scripting language
More informationUnix L555. Dept. of Linguistics, Indiana University Fall Unix. Unix. Directories. Files. Useful Commands. Permissions. tar.
L555 Dept. of Linguistics, Indiana University Fall 2010 1 / 21 What is? is an operating system, like DOS or Windows developed in 1969 by Bell Labs works well for single computers as well as for servers
More informationGetting Started With UNIX Lab Exercises
Getting Started With UNIX Lab Exercises This is the lab exercise handout for the Getting Started with UNIX tutorial. The exercises provide hands-on experience with the topics discussed in the tutorial.
More informationPart I. Introduction to Linux
Part I Introduction to Linux 7 Chapter 1 Linux operating system Goal-of-the-Day Familiarisation with basic Linux commands and creation of data plots. 1.1 What is Linux? All astronomical data processing
More informationLinux & Shell Programming 2014
Practical No : 1 Enrollment No: Group : A Practical Problem Write a date command to display date in following format: (Consider current date as 4 th January 2014) 1. dd/mm/yy hh:mm:ss 2. Today's date is:
More informationUnix Tools / Command Line
Unix Tools / Command Line An Intro 1 Basic Commands / Utilities I expect you already know most of these: ls list directories common options: -l, -F, -a mkdir, rmdir make or remove a directory mv move/rename
More informationIntroduction to UNIX command-line
Introduction to UNIX command-line Boyce Thompson Institute March 17, 2015 Lukas Mueller & Noe Fernandez Class Content Terminal file system navigation Wildcards, shortcuts and special characters File permissions
More informationCSE 390a Lecture 6. bash scripting continued; remote X windows; unix tidbits
1 CSE 390a Lecture 6 bash scripting continued; remote X windows; unix tidbits slides created by Marty Stepp, modified by Jessica Miller and Ruth Anderson http://www.cs.washington.edu/390a/ Lecture summary
More informationUnix tutorial. Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based.
Unix tutorial Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based. Terminal windows You will use terminal windows to enter and execute
More information