Unix Introduction. Part 2

Size: px
Start display at page:

Download "Unix Introduction. Part 2"

Transcription

1 Unix Introduction Part 2

2 More Unix Commands wc touch

3 cp - copy review Let's copy a directory tree with recursion. Remember that in order to use the -r option when copying directory hierarchies. Make sure your current directory is Unix_class: $ cp -r dir2 dir3

4 wc - count This command will let you count the number of characters, words, and lines in a file. To display the number of lines in a file: $ wc -l filename

5 wc - count This command will let you count the number of characters, words, and lines in a file. To display the number of words in a file: $ wc -w filename

6 wc - count This command will let you count the number of characters, words, and lines in a file. To display the number of characters in a file: $ wc -m filename

7 wc Practice How many lines are in the shrodinger poem? (in dir1) $ wc -l shrodinger 57 shrodinger How many words are in final.paper? (in dir2) $ wc -w final.paper 118 final.paper

8 touch Use touch to create an empty file. $ touch newfilename Using the touch command on an existing file will update the last modify time.

9 touch Practice Create a new file in dir3 called my.stuff $ cd../dir3 $ touch my.stuff

10 date Typing date will give you the current day, date, time, and year and timezone. $ date Using the -u option will give you Greenwich Mean Time (universal time).

11 who This command will display information about who is currently logged onto the system. $ who

12 find The Swiss Army Knife of Unix Utilities In the very simplest form we can use this command to find the location of a file. This command has four parts to it.

13 find Start with the command_name find $ find

14 find $ find [directory] Specify the directory in which to start your search (such as /home/userid). The find command will start there and go down recursively. If you want to start your search in the current directory, simply type a period (.) here. More on this later. Don t start with the root directory (/)-You would not be able to search through some Unix directories.

15 find $ find [directory] -name -name specifies that you are looking for a filename. The find command can search for files by criteria other than the file name, such as modify time, size, or the file access permissions and many more attributes. I devote much more time to this command in S603 Unix Intermediate.

16 find $ find [directory] -name [filename] Now you type the name of the file you are looking for.

17 find Practice $ find. -name grp.txt (or ) $ find ~/Unix_class -name grp.txt Make Unix_class your current directory You are looking for your file called grp.txt, starting in the current directory (Unix_class) and searching in all of its subdirectories. What subdirectory is grp.txt in? dir1

18 find Practice What directory is catalyst in? $ find. -name catalyst./dir2/cats/catalyst (and)./dir3/cats/catalyst What directory is address.list in? $ find. -name address.list./dir1/address.list (remember the. means the current working directory so it is assumed that your current working directory is Unix_class)

19 find You can also use wildcards with find, (you can t remember if the name is records, recordings, or just recs). $ find /home/jsmith -name rec* (It is best to surround the wildcard phrase with single or double quotes.)

20 find practice Find all the files that begin with sh in Unix_class. $ find. -name "sh*"./dir1/shrodinger./wildcards/shell.script.113./wildcards/shell.script.276

21 find If the program has already found the file you wanted, but is still searching for more, then press Ctrl+C to stop the search.

22 Review Even More Commands wc count the characters, words, or lines in a file touch create an empty file, modify the file's time date tells you the current day, date, time, timezone, and year who see who is logged onto the system find find the location of a file

23 Even More Commands Remember to check the man pages for each of the new commands you've learned so far.

24 Command Options

25 Options/Flags ls cp mv rm

26 Review Unix Commands generally have three parts: command_name [options] [operands]

27 Command Options So far we have discussed commands and operands. Now we'll see some options that are available for our commands. All commands come with default behavior and command options will allow us to modify this default behavior.

28 Examples $ ls temp $ cp test1 test2 $ mv pict /home/jsmith/family_pics

29 Examples $ ls -l temp $ cp -r test1 test2 $ mv -i pict /home/jsmith/family_pics

30 ls -a -l -p -t

31 ls -a all ls -a will list all files Just typing ls will not list entries whose names begin with a period (.) hidden files

32 ls -a Example: $ ls dir2 address_list final.paper picts cats history.txt

33 ls -a Example: $ ls -a dir2..ds_store cats history.txt.. address_list final.paper picts The. stands for the directory itself, and the.. stands for the parent directory. These files are created with the mkdir command.

34 ls -l long format ls -l will list files in long format This will give information about each file, such as who has permission to read it, when it was made, how large it is, etc. (we will cover more of this later in class).

35 ls -l Example: $ ls -l dir2 -rw-r--r-- 1 name name 455 Jun 30 22:33 address_list drwxrwxr-x 5 name name 512 Jun 30 22:33 cats -rw-r--r-- 1 name name 716 Jun 30 22:33 final.paper -rw-r--r-- 1 name name 7091 Jun 30 22:33 history.txt drwxrwxr-x 2 name name 512 Jun 30 22:33 picts

36 ls -p ls -p puts a slash (/) after each filename if the type of file is a directory. Remember that in Unix, everything is a file. Some are regular files and some are directory files. There are several other types of files in Unix (i.e. devices, links, etc.) but all you need to know is how to differentiate between regular files and directories.

37 ls -p Example: $ ls -p dir2 address_list final.paper picts/ cats/ history.txt

38 ls -t time ls -t will list the files and directories, sorted by time modified (most recently modified first).

39 Combining Options Options can easily be combined. If you want to list all files in long format: $ ls -al This would also give you information about the current directory and the parent directory, because the. and.. are listed with the -a.

40 ls Practice How many files and directories are in dir2, including hidden files? $ ls -a..ds_store cats history.txt.. address_list final.paper picts (8 files and directories)

41 List dir2 in long format. Two entries begin with a d - why do you think this is? $ ls -l (they are directories) ls Practice

42 cp -i -r

43 cp -i interactive When you are copying a file or directory, when using cp -i, the system will ask you before you overwrite a copied file over an existing file.

44 cp -r recursive cp -r specifies that when you copy a directory, you also copy all the subdirectories and files within that directory.

45 -i m v

46 mv -i interactive When you are moving a file or directory, when using mv -i, the system will ask you before you overwrite a moved file over an existing file.

47 r m -i -r

48 rm -i interactive When you are removing a file or directory, when using rm -i (or rmdir -i), the system will ask you before you delete any file. The -i option in cp, mv and rm are safety features for you.

49 rm -r Using rm -r will remove a directory and all of the files and directories under it! Like fire, it can be very useful or catastrophic so be careful when using this command option.

50 rm Practice Delete the directory dir3 - deleting all the nested files and subdirectories at the same time. $ pwd (verify you are in Unix_class) $ rm -r dir3 $ ls

51 More Flags & Options Check man for a list of available options for each command. These options will differ slightly with different versions of Unix.

52 grep Global Regular Expression and Print

53 grep Looks inside files and searches for a series of characters (a phrase, a group of numbers, etc.). This is also referred to as contextual searching.

54 grep? What if?...you want to look in all the files in the current directory (but not in its subdirectories) for a string of characters (also referred to as a pattern list )

55 grep? What if? You want to search for the phrase tiny fish in one of your files in the current directory.

56 grep in-class practice Make dir1 your current working directory. $ cd Unix_class/dir1

57 Type the following: grep 'tiny fish' * command grep in-class practice phrase you are space space looking for asterisk search string * - means grep will look in all the files in the current directory

58 grep The program will then list the name of the file and the entire line in which the search string was found.

59 grep If you know what file to look in, you can substitute the filename for the asterisk (*).

60 grep Practice Example: You want to find Sally s information in address.list Type: $ grep 'Sally Smith' address.list Sally Smith 128 Hickory Lane

61 grep You will always need single quotes (not any other kind of quote mark) around your search string if it has any spaces: 'class notes' or 'new ideas' If your search string is only one word, you can still use the single quotes, but you don t need them: 'notes' or 'ideas' notes or ideas

62 grep Practice While you are in the dir1 subdirectory, search for: Ash $ grep Ash * How many results did you find? What files were they in? Remember - Unix is case sensitive

63 grep Practice While you are in the dir1 subdirectory, search for: Ash $ grep Ash * address.list:hon Chin Ash Blvd. address.list:ashley McNara 608 Redbud Ave grp.txt:grep will also find parts of words, like bashful.

64 grep options While we are learning about grep it might be useful to know some useful options: $ man grep -i Ignores upper/lower case distinction during comparisons. -l Prints only the names of files with matching lines, separated by NEWLINE characters. Does not repeat the names of files when the pattern is found more than once. -v Prints all lines except those that contain the pattern.

65 grep - Regular Expressions Using regular expressions with grep gives you more flexibility. These special metacharacters mean something specific to the program:. * [ ] ^ $ Regular expressions are sets of symbols and syntactic elements used to match patterns of text.

66 grep - Regular Expressions Using regular expressions with grep gives you more flexibility. These special metacharacters mean something specific to the program:. * [ ] ^ $ When you use regular expressions, enclose your search string in quotes.

67 grep - Regular Expressions.(period) Matches any single character Example: $ grep 't.ck' filename This finds all examples of tack, tick, tock, or tuck in the file, but not thick

68 grep - Regular Expressions *(asterisk) Matches multiples of the preceding character Example: $ grep 'ex3*7' filename This would find ex37, ex337, ex333337, but not ex347

69 grep - Regular Expressions ^(caret) Matches only instances of the search string at the beginning of a line Example: $ grep '^Once upon' filename This would find all lines beginning with the phrase Once upon

70 grep - Regular Expressions $(dollar sign) Matches only instances of the search string at the end of a line Example: $ grep 'ever after$' filename This would find all lines ending with the phrase ever after

71 grep - Regular Expressions [](brackets) Matches any member of the set; use the brackets to enclose a set of options Example: $ grep '[12,24,48] apples' filename This would find 12 apples, 24 apples, or 48 apples in the file

72 grep - Practice How many lines begin with No in the shrodinger file (in dir1)? $ grep '^No' shrodinger 4 lines How many phone numbers in address.list end with an 8 (in dir1)? $ grep '8$' address.list 5 numbers

73 grep - Practice In dir1, type: $ grep 'r...ing' * What are the matches in each line? Breeding fairy ring rhyming resting

74 grep - Regular Expressions But what if you wanted to search for a phrase which contains a regular expression? Example: you are looking for $250 in the directory. If you typed: $ grep $250 * Because $ is a regular expression, you would not get the results you were looking for.

75 grep - Regular Expressions To do this you need to use a backslash (\) This negates the special properties of the following character. This is often referred to as an 'escape' character. It is used to 'escape' the special meaning of a symbol. Example: To look for $250, you would type: $ grep '\$250' *

76 grep - Practice What costs $3.50 in dir1? $ grep '\$3.50' * A bag of gerbil food (the $3750 appears because the. can stand for any character) Who has a phone number where the last four digits begin with a 9 and end with a 9? $ grep '9..9' address.list Jordon Davis

77 grep - Practice In the Shakespeare directory, type: $ grep 'ade.$' * What results do you find? Why is the period necessary? They live unwoo'd and unrespected fade, Of their sweet deaths are sweetest odours made: Without the period, the comma or colon would tell the system that 'ade' does not come at the end of the line (the $). So be careful of punctuation.

78 Wildcards and Regular Expressions? *

79 Wildcards There are two metacharacters which can act as a substitution for unknown letters or numbers in a filename or directory name. These characters are not the same as they are in regular expressions using grep.

80 Wildcard Uses You can use wildcards with commands other than ls. Wildcards apply to all commands including grep and are used in place of or in combination with operands. Regular Expressions only apply to grep and a few other Unix commands.

81 Regular Expressions Wildcards are different from the regular expressions used in grep (although they may look similar at times).

82 Regular Expressions The regular expressions used in grep should always be enclosed in the single quotes: $ grep 'model vx9*0' * Here the asterisk is a regular expression Here the asterisk is a wildcard

83 Regular Expressions When you further your study with Unix you will appreciate what you have learned about regular expressions using grep. Other Unix utilities such as sed, awk, and perl, python, php, and text editors such as vi and emacs will also use similar types of regular expressions.

84 Regular Expressions With regular expressions one can easily search through a text file (or a hundred text files) searching for words that have a certain suffix (but only if the word begins with a capital letter and occurs at the beginning of the line), replacing the suffix with another suffix, and then change all the lower case characters to upper case. With the right tools, a series of regular expressions would do just that. However, this is well beyond the scope of this class.

85 Unix and the Internet

86 Unix and the Internet The internet and the world wide web were built with Unix servers. A server is just a computer that stores files and serves them whenever requested.

87 Unix and the Internet A web server is a computer that stores many html files and various programs and then waits for other computers to request certain files usually via the browser. When a request is received it finds the file and serves it to the requesting computer.

88 Unix and the Internet An IP number (internet protocol) is the numeric address for a computer on the internet. This address identifies your computer much like your street address identifies your home. Similarly, your login name (userid) is also translated to a unique number that identifies you to the system.

89 Unix and the Internet A name can simply be the name of the server (computer/host), i.e. ella. This is referred to as a relative hostname. This is just a name we give the computer when Unix is installed. It may be all we need for a local network but there could be a lot of computers named ella out there. We need a way to further identify this computer in order to make it more unique.

90 Unix and the Internet To create a more unique computer (host) name we use a fully qualified hostname. This is similar to identifying your home address further by adding your city, state, and zipcode. The fully qualified hostname of the student Unix web server at SLIS is ella.ils.indiana.edu. The domain, ils.indiana.edu further identifies our server from the ella server on the ucs network (ucs.indiana.edu).

91 Unix and the Internet When you visit a site, you are visiting a computer. You may type in a name such as: This is called a Domain Name. This name gets translated into a number, the I.P. number. In this case:

92 Unix and the Internet Most people can remember names better than a string of numbers so a system was setup to make life easier for Internet users. This system is called DNS (Domain Name System). DNS does the work of translating the name, i.e. to a number the system can use to correctly identify which server you want to connect to.

93 Unix and the Internet Domain names are organized in a hierarchical way, similar to the file system in Unix. This hierarchy includes your company or server name, and a country code (for example,.uk or.ca) or a top-level domain (for example,.com or.edu). A Web site on the server is created with one IP address, one host name and one domain name that together establish the identity of that Web site on the Internet.

94 Unix and the Internet When you attempt to access a server via http (normal web browser access) you may have encountered an error from time to time relating to DNS. It may give you an error saying that you had a DNS lookup failure. All this means is that the DNS server (most often running on Unix servers) cannot match the domain name you provided to an IP number.

95 Unix and the Internet If you were so inclined, you could look the IP number up yourself using the command, nslookup, or the dig command. nslookup manually converts a domain name to the matching IP number. $ nslookup [fullyqualifiedhostname]

96 Internet Practice $ nslookup Server: Address: #53 canonical name = ils.indiana.edu. Name: ils.indiana.edu Address:

97 Names Canonical names refer to the real hostname of a computer or network server. A CNAME record in the DNS database allow a server to be known by more than one hostname.

98 Protection with Firewalls Most companies use firewalls as a means to protect their internal (private) network resources. A firewall is usually a set of related programs running on servers that sit at the gateway to a private network. Their function is to protect a private network from the outside world by limiting access to the network. A firewall also includes or works with a proxy server that makes network requests on behalf of computer users. Basically, a firewall, working closely with a router program, filters

99 Protection with Firewalls Firewalls Firewalls are frequently used to prevent unauthorized Internet users from accessing private networks connected to the Internet, especially intranets. All messages entering or leaving the intranet pass through the firewall, which examines each message and blocks those that do not meet the specified security criteria.

100 Text Editing 100

101 What is a text editor? A text editor is not a word processor like Microsoft Word. It will not do boldface, headers, footers, italics, changing fonts, or other things associated with a word processor.

102 What is a text editor? A text editor does let you create a file of text, edit that text, and save the file.

103 What is a text editor? The two most common text editors that were mostly there from the beginning in the Unix world are: vi emacs

104 Vi/Vim I will cover vi/vim in depth in the Unix Intermediate class. For some there can be a steep learning curve and it would be helpful to have a working understanding of regex to make full use of this editor. Some people fell in love with and are wired for emacs but I am not one of them.

105 Ready for more?

Unix Introduction. Getting started with the Unix Operating System

Unix Introduction. Getting started with the Unix Operating System Unix Introduction Getting started with the Unix Operating System What is an Operating System? A computer Operating System, or OS What is a computer operating system? Where? What does an OS provide? Insulation

More information

The Directory Structure

The Directory Structure The Directory Structure All the files are grouped together in the directory structure. The file-system is arranged in a hierarchical structure, like an inverted tree. The top of the hierarchy is traditionally

More information

Unix Introduction. Part 3

Unix Introduction. Part 3 Unix Introduction Part 3 More Unix Commands cat more head tail Working with files Now that you can navigate directories and move files around, you need to be able to work with the files and directories

More information

Scripting Languages Course 1. Diana Trandabăț

Scripting 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 information

COMS 6100 Class Notes 3

COMS 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 information

Physics REU Unix Tutorial

Physics REU Unix Tutorial Physics REU Unix Tutorial What is unix? Unix is an operating system. In simple terms, its the set of programs that makes a computer work. It can be broken down into three parts. (1) kernel: The component

More information

Table Of Contents. 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands

Table Of Contents. 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands Table Of Contents 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands Getting onto the Zoo Type ssh @node.zoo.cs.yale.edu, and enter your netid pass when prompted.

More information

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Unix/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 information

Shell Programming Overview

Shell 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 information

A Brief Introduction to the Linux Shell for Data Science

A 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 information

Appendix B WORKSHOP. SYS-ED/ Computer Education Techniques, Inc.

Appendix B WORKSHOP. SYS-ED/ Computer Education Techniques, Inc. Appendix B WORKSHOP SYS-ED/ Computer Education Techniques, Inc. 1 Introduction There are no workshops for this chapter. The instructor will provide demonstrations and examples. SYS-ED/COMPUTER EDUCATION

More information

Files

Files 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 information

Essential Linux Shell Commands

Essential Linux Shell Commands Essential Linux Shell Commands Special Characters Quoting and Escaping Change Directory Show Current Directory List Directory Contents Working with Files Working with Directories Special Characters There

More information

Linux File System and Basic Commands

Linux File System and Basic Commands Linux File System and Basic Commands 0.1 Files, directories, and pwd The GNU/Linux operating system is much different from your typical Microsoft Windows PC, and probably looks different from Apple OS

More information

A Brief Introduction to Unix

A Brief Introduction to Unix A Brief Introduction to Unix Sean Barag Drexel University March 30, 2011 Sean Barag (Drexel University) CS 265 - A Brief Introduction to Unix March 30, 2011 1 / 17 Outline 1 Directories

More information

Chapter-3. Introduction to Unix: Fundamental Commands

Chapter-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 information

Mills HPC Tutorial Series. Linux Basics I

Mills 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 information

Unix/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 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 information

INSE Lab 1 Introduction to UNIX Fall 2017

INSE Lab 1 Introduction to UNIX Fall 2017 INSE 6130 - Lab 1 Introduction to UNIX Fall 2017 Updated by: Paria Shirani Overview In this lab session, students will learn the basics of UNIX /Linux commands. They will be able to perform the basic operations:

More information

Unix Tools / Command Line

Unix 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 information

Operating Systems and Using Linux. Topics What is an Operating System? Linux Overview Frequently Used Linux Commands

Operating Systems and Using Linux. Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands 1 What is an Operating System? A computer program that: Controls how the CPU, memory

More information

Introduction 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 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 information

5/8/2012. Exploring Utilities Chapter 5

5/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 information

Table 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

Table 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 information

CENG 334 Computer Networks. Laboratory I Linux Tutorial

CENG 334 Computer Networks. Laboratory I Linux Tutorial CENG 334 Computer Networks Laboratory I Linux Tutorial Contents 1. Logging In and Starting Session 2. Using Commands 1. Basic Commands 2. Working With Files and Directories 3. Permission Bits 3. Introduction

More information

5/20/2007. Touring Essential Programs

5/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 information

UNIX Tutorial Two

UNIX Tutorial Two 2.1 Copying Files cp (copy) UNIX Tutorial Two cp file1 file2 is the command which makes a copy of file1 in the current working directory and calls it file2 What we are going to do now, is to take a file

More information

Linux Command Line Primer. By: Scott Marshall

Linux Command Line Primer. By: Scott Marshall Linux Command Line Primer By: Scott Marshall Draft: 10/21/2007 Table of Contents Topic Page(s) Preface 1 General Filesystem Background Information 2 General Filesystem Commands 2 Working with Files and

More information

Chapter 4. Unix Tutorial. Unix Shell

Chapter 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 information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG 1 Notice Reading Assignment Chapter 1: Introduction to Java Programming Homework 1 It is due this coming Sunday

More information

Introduction to the Linux Command Line

Introduction to the Linux Command Line Introduction to the Linux Command Line May, 2015 How to Connect (securely) ssh sftp scp Basic Unix or Linux Commands Files & directories Environment variables Not necessarily in this order.? Getting Connected

More information

DATA 301 Introduction to Data Analytics Command Line. Dr. Ramon Lawrence University of British Columbia Okanagan

DATA 301 Introduction to Data Analytics Command Line. Dr. Ramon Lawrence University of British Columbia Okanagan DATA 301 Introduction to Data Analytics Command Line Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Why learn the Command Line? The command line is the text interface

More information

Why learn the Command Line? The command line is the text interface to the computer. DATA 301 Introduction to Data Analytics Command Line

Why learn the Command Line? The command line is the text interface to the computer. DATA 301 Introduction to Data Analytics Command Line DATA 301 Introduction to Data Analytics Command Line Why learn the Command Line? The command line is the text interface to the computer. DATA 301: Data Analytics (2) Understanding the command line allows

More information

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.

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. 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 information

commandname flags arguments

commandname flags arguments Unix Review, additional Unix commands CS101, Mock Introduction This handout/lecture reviews some basic UNIX commands that you should know how to use. A more detailed description of this and other commands

More information

Introduction. File System. Note. Achtung!

Introduction. 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 information

This 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]

This 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 information

Introduction to Linux

Introduction to Linux Introduction to Linux The command-line interface A command-line interface (CLI) is a type of interface, that is, a way to interact with a computer. Window systems, punched cards or a bunch of dials, buttons

More information

CSCI 2132 Software Development. Lecture 4: Files and Directories

CSCI 2132 Software Development. Lecture 4: Files and Directories CSCI 2132 Software Development Lecture 4: Files and Directories Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 12-Sep-2018 (4) CSCI 2132 1 Previous Lecture Some hardware concepts

More information

CHAPTER 1 UNIX FOR NONPROGRAMMERS

CHAPTER 1 UNIX FOR NONPROGRAMMERS CHAPTER 1 UNIX FOR NONPROGRAMMERS The man command is used to display the manual entry associated with word entered as argument. The -k option is used displays a list of manual entries that contain entered

More information

Unix Tutorial Haverford Astronomy 2014/2015

Unix Tutorial Haverford Astronomy 2014/2015 Unix Tutorial Haverford Astronomy 2014/2015 Overview of Haverford astronomy computing resources This tutorial is intended for use on computers running the Linux operating system, including those in the

More information

Introduction to Unix: Fundamental Commands

Introduction 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 information

Unix 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. 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

Basic Unix Command. It is used to see the manual of the various command. It helps in selecting the correct options

Basic Unix Command. It is used to see the manual of the various command. It helps in selecting the correct options Basic Unix Command The Unix command has the following common pattern command_name options argument(s) Here we are trying to give some of the basic unix command in Unix Information Related man It is used

More information

Introduction to UNIX command-line

Introduction 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 information

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage

Unix 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 information

Week 2 Lecture 3. Unix

Week 2 Lecture 3. Unix Lecture 3 Unix Terminal and Shell 2 Terminal Prompt Command Argument Result 3 Shell Intro A system program that allows a user to execute: shell functions (e.g., ls -la) other programs (e.g., eclipse) shell

More information

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories Chapter Two Exploring the UNIX File System and File Security Lesson A Understanding Files and Directories 2 Objectives Discuss and explain the UNIX file system Define a UNIX file system partition Use the

More information

Lab Working with Linux Command Line

Lab Working with Linux Command Line Introduction In this lab, you will use the Linux command line to manage files and folders and perform some basic administrative tasks. Recommended Equipment A computer with a Linux OS, either installed

More information

AN INTRODUCTION TO UNIX

AN INTRODUCTION TO UNIX AN INTRODUCTION TO UNIX Paul Johnson School of Mathematics September 18, 2011 OUTLINE 1 INTRODUTION Unix Common Tasks 2 THE UNIX FILESYSTEM Moving around Copying, deleting File Permissions 3 SUMMARY OUTLINE

More information

Course 144 Supplementary Materials. UNIX Fundamentals

Course 144 Supplementary Materials. UNIX Fundamentals Course 144 Supplementary Materials UNIX Fundamentals 1 Background to UNIX Command Fundamentals This appendix provides a overview of critical commands and concepts Prerequisite knowledge attendees should

More information

Command Line Interface The basics

Command Line Interface The basics Command Line Interface The basics Marco Berghoff, SCC, KIT Steinbuch Centre for Computing (SCC) Funding: www.bwhpc-c5.de Motivation In the Beginning was the Command Line by Neal Stephenson In contrast

More information

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems. Copyleft 2005, Binnur Kurt 3 Operating Systems Copyleft 2005, Binnur Kurt Content The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail.

More information

Basic Linux (Bash) Commands

Basic Linux (Bash) Commands Basic Linux (Bash) Commands Hint: Run commands in the emacs shell (emacs -nw, then M-x shell) instead of the terminal. It eases searching for and revising commands and navigating and copying-and-pasting

More information

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing Content 3 Operating Systems The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail. How to log into (and out

More information

CSE 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 , 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 information

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages

Week 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 information

Introduction: What is Unix?

Introduction: What is Unix? Introduction Introduction: What is Unix? An operating system Developed at AT&T Bell Labs in the 1960 s Command Line Interpreter GUIs (Window systems) are now available Introduction: Unix vs. Linux Unix

More information

Introduction to Linux

Introduction to Linux Introduction to Linux M Tech CS I 2015-16 Arijit Bishnu Debapriyo Majumdar Sourav Sengupta Mandar Mitra Login, Logout, Change password $ ssh, ssh X secure shell $ ssh www.isical.ac.in $ ssh 192.168 $ logout,

More information

Introduction to the UNIX command line

Introduction to the UNIX command line Introduction to the UNIX command line Steven Abreu Introduction to Computer Science (ICS) Tutorial Jacobs University s.abreu@jacobs-university.de September 19, 2017 Overview What is UNIX? UNIX Shell Commands

More information

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech Unix File System Class Meeting 2 * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech Unix File System The file system is your interface to: physical

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Mukesh Pund Principal Scientist, NISCAIR, New Delhi, India History In 1969, a team of developers developed a new operating system called Unix which was written using C Linus Torvalds,

More information

Crash Course in Unix. For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix. -or- Unix in a Nutshell (an O Reilly book).

Crash Course in Unix. For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix. -or- Unix in a Nutshell (an O Reilly book). Crash Course in Unix For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix -or- Unix in a Nutshell (an O Reilly book). 1 Unix Accounts To access a Unix system you need to have

More information

Examples: Directory pathname: File pathname: /home/username/ics124/assignments/ /home/username/ops224/assignments/assn1.txt

Examples: 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 information

An Introduction to Using the Command Line Interface (CLI) to Work with Files and Directories

An Introduction to Using the Command Line Interface (CLI) to Work with Files and Directories An Introduction to Using the Command Line Interface (CLI) to Work with Files and Directories Mac OS by bertram lyons senior consultant avpreserve AVPreserve Media Archiving & Data Management Consultants

More information

Oxford University Computing Services. Getting Started with Unix

Oxford 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 information

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME Introduction to the Unix command line History Many contemporary computer operating systems, like Microsoft Windows and Mac OS X, offer primarily (but not exclusively) graphical user interfaces. The user

More information

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)

Using 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 information

Operating Systems, Unix Files and Commands SEEM

Operating Systems, Unix Files and Commands SEEM Operating Systems, Unix Files and Commands SEEM 3460 1 Major Components of Operating Systems (OS) Process management Resource management CPU Memory Device File system Bootstrapping SEEM 3460 2 Programs

More information

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

THE 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 information

ITST Searching, Extracting & Archiving Data

ITST 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 information

Linux Command Line Interface. December 27, 2017

Linux Command Line Interface. December 27, 2017 Linux Command Line Interface December 27, 2017 Foreword It is supposed to be a refresher (?!) If you are familiar with UNIX/Linux/MacOS X CLI, this is going to be boring... I will not talk about editors

More information

Some Linux (Unix) Commands that might help you in ENSC351

Some Linux (Unix) Commands that might help you in ENSC351 Some Linux (Unix) Commands that might help you in ENSC351 First, like Windows, Linux and Unix (for our purposes, they are the basically the same) use a hierarchical directory structure. What would be called

More information

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou EECS 2031 - Software Tools Lab 2 Tutorial: Introduction to UNIX/Linux Tilemachos Pechlivanoglou (tipech@eecs.yorku.ca) Sep 22 & 25, 2017 Material marked with will be in your exams Sep 22 & 25, 2017 Introduction

More information

CST Lab #5. Student Name: Student Number: Lab section:

CST Lab #5. Student Name: Student Number: Lab section: CST8177 - Lab #5 Student Name: Student Number: Lab section: Working with Regular Expressions (aka regex or RE) In-Lab Demo - List all the non-user accounts in /etc/passwd that use /sbin as their home directory.

More information

PDS Lab Section 16 Autumn Tutorial 1. Unix Commands pwd The pwd command displays the full pathname of the current directory.

PDS Lab Section 16 Autumn Tutorial 1. Unix Commands pwd The pwd command displays the full pathname of the current directory. PDS Lab Section 16 Autumn-2018 Tutorial 1 Unix Commands pwd The pwd command displays the full pathname of the current directory. pwd mkdir The mkdir command creates a single directory or multiple directories.

More information

Introduction to Unix - Lab Exercise 0

Introduction to Unix - Lab Exercise 0 Introduction to Unix - Lab Exercise 0 Along with this document you should also receive a printout entitled First Year Survival Guide which is a (very) basic introduction to Unix and your life in the CSE

More information

9.2 Linux Essentials Exam Objectives

9.2 Linux Essentials Exam Objectives 9.2 Linux Essentials Exam Objectives This chapter will cover the topics for the following Linux Essentials exam objectives: Topic 3: The Power of the Command Line (weight: 10) 3.3: Turning Commands into

More information

Introduction of Linux

Introduction of Linux Introduction of Linux 阳 oslab2018_class1@163.com 寅 oslab2018_class2@163.com PART I Brief Introduction Basic Conceptions & Environment Install & Configure a Virtual Machine Basic Commands PART II Shell

More information

Practical Session 0 Introduction to Linux

Practical 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 information

Perl and R Scripting for Biologists

Perl and R Scripting for Biologists Perl and R Scripting for Biologists Lukas Mueller PLBR 4092 Course overview Linux basics (today) Linux advanced (Aure, next week) Why Linux? Free open source operating system based on UNIX specifications

More information

CS Unix Tools. Lecture 2 Fall Hussam Abu-Libdeh based on slides by David Slater. September 10, 2010

CS Unix Tools. Lecture 2 Fall Hussam Abu-Libdeh based on slides by David Slater. September 10, 2010 Lecture 2 Fall 2010 Hussam Abu-Libdeh based on slides by David Slater September 10, 2010 Last Time We had a brief discussion On The Origin of Species *nix systems Today We roll our sleeves and get our

More information

UNIX files searching, and other interrogation techniques

UNIX files searching, and other interrogation techniques UNIX files searching, and other interrogation techniques Ways to examine the contents of files. How to find files when you don't know how their exact location. Ways of searching files for text patterns.

More information

unix intro Documentation

unix intro Documentation unix intro Documentation Release 1 Scott Wales February 21, 2013 CONTENTS 1 Logging On 2 1.1 Users & Groups............................................. 2 1.2 Getting Help...............................................

More information

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Unix Filesystem. January 26 th, 2004 Class Meeting 2 Unix Filesystem January 26 th, 2004 Class Meeting 2 * Notes adapted by Christian Allgood from previous work by other members of the CS faculty at Virginia Tech Unix Filesystem! The filesystem is your interface

More information

Unix as a Platform Exercises + Solutions. Course Code: OS 01 UNXPLAT

Unix as a Platform Exercises + Solutions. Course Code: OS 01 UNXPLAT Unix as a Platform Exercises + Solutions Course Code: OS 01 UNXPLAT Working with Unix Most if not all of these will require some investigation in the man pages. That's the idea, to get them used to looking

More information

UNLV Computer Science Department CS 135 Lab Manual

UNLV Computer Science Department CS 135 Lab Manual UNLV Computer Science Department CS 135 Lab Manual prepared by Lee Misch revised July 2013 CS 135 Lab Manual Content Page Introduction 3 CS Computer Accounts. 3 TBE B361 Computer Basics. 3 Choosing an

More information

Unix background. COMP9021, Session 2, Using the Terminal application, open an x-term window. You type your commands in an x-term window.

Unix background. COMP9021, Session 2, Using the Terminal application, open an x-term window. You type your commands in an x-term window. Unix background COMP9021, Session 2, 2016 1 Introduction Using the Terminal application, open an x-term window. You type your commands in an x-term window. Many commands take one or more arguments. Many

More information

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program Using UNIX. UNIX is mainly a command line interface. This means that you write the commands you want executed. In the beginning that will seem inferior to windows point-and-click, but in the long run the

More information

Overview of the UNIX File System. Navigating and Viewing Directories

Overview of the UNIX File System. Navigating and Viewing Directories Overview of the UNIX File System Navigating and Viewing Directories Copyright 2006 Stewart Weiss The UNIX file system The most distinguishing characteristic of the UNIX file system is the nature of its

More information

UNIX Tutorial One

UNIX Tutorial One 1.1 Listing files and directories ls (list) When you first login, your current working directory is your home directory. Your home directory has the same name as your user-name, for example, ee91ab, and

More information

Basics. I think that the later is better.

Basics.  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 information

Introduction to UNIX I: Command Line 1 / 21

Introduction to UNIX I: Command Line 1 / 21 Introduction to UNIX I: Command Line 1 / 21 UNIX Command line The UNIX Shell: command line interface Navigating Directories and Files Running applications Reminder about helpful tutorial: http://korflab.ucdavis.edu/unix_and_perl/current.html

More information

Links, basic file manipulation, environmental variables, executing programs out of $PATH

Links, basic file manipulation, environmental variables, executing programs out of $PATH Links, basic file manipulation, environmental variables, executing programs out of $PATH Laboratory of Genomics & Bioinformatics in Parasitology Department of Parasitology, ICB, USP The $PATH PATH (which

More information

FREEENGINEER.ORG. 1 of 6 11/5/15 8:31 PM. Learn UNIX in 10 minutes. Version 1.3. Preface

FREEENGINEER.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 information

Tiny Instruction Manual for the Undergraduate Mathematics Unix Laboratory

Tiny Instruction Manual for the Undergraduate Mathematics Unix Laboratory Tiny Instruction Manual for the Undergraduate Mathematics Unix Laboratory 1 Logging In When you sit down at a terminal and jiggle the mouse to turn off the screen saver, you will be confronted with a window

More information

Unix basics exercise MBV-INFX410

Unix basics exercise MBV-INFX410 Unix basics exercise MBV-INFX410 In order to start this exercise, you need to be logged in on a UNIX computer with a terminal window open on your computer. It is best if you are logged in on freebee.abel.uio.no.

More information

CSC111 Computer Science II

CSC111 Computer Science II CSC111 Computer Science II Lab 1 Getting to know Linux Introduction The purpose of this lab is to introduce you to the command line interface in Linux. Getting started In our labs If you are in one of

More information

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.

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. 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 information

CS214-AdvancedUNIX. Lecture 2 Basic commands and regular expressions. Ymir Vigfusson. CS214 p.1

CS214-AdvancedUNIX. Lecture 2 Basic commands and regular expressions. Ymir Vigfusson. CS214 p.1 CS214-AdvancedUNIX Lecture 2 Basic commands and regular expressions Ymir Vigfusson CS214 p.1 Shellexpansions Let us first consider regular expressions that arise when using the shell (shell expansions).

More information