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

Size: px
Start display at page:

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

Transcription

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

2 1 Introduction There are no workshops for this chapter. The instructor will provide demonstrations and examples. SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 1

3 2 Commands and Utilities 1. Execute the following commands; they require no arguments or options: Date Whoami Who W pwd Clear Show date and time Show your userid Show who is logged onto the system. Show who is logged onto the system. Print the working directory's name. Clear the screen. 2. Execute the following commands; they require arguments and/or options: ls a ls al cat.cshrc Mkdir dir1 cd dir1 cd Rmdir dir1 cp.login new.login wc new.login wc -l new.login rm new.login List all files in current directory. Long list of current directory. Display contents of.cshrc file. Make a directory called dir1 Change directory to dir1. Change to parent directory. Remove directory dir1 Copy the.login file to new.login. Count the lines, words and characters in the new.login file. Count just the lines. Remove the new.login file. 3. Use multiple commands on one line; this is done by including the semi-colon between commands. cp.login testfile ; cat testfile - copy a file and then show its contents ls -l testfile ; rm testfile ; ls -l testfile - list (long) a file, remove it, and then try to list it again SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 2

4 4. This exercise will provide familiarity with several UNIX special characters. Use the "*" wildcard character to list all of the files in the present working directory: ls * Use the "?" wildcard character, to list all files with 3 character names: ls??? Use square brackets and wildcard characters in order to list files several different ways: ls [a-c]* ls [abcde]* ls [a-z]* ls [z]* ls??[c]* ls?[e]* Use the right angle bracket ">" and the semi-colon ";", to concatenate three files into a single new file and then display it: cat alpha beta gamma > newfile ; cat newfile SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 3

5 3 Files and Directories Create a Home Directory Structure Use the following commands: Mkdir Rmdir Rm Ls Pwd Cp Cd Make a directory. Remove a directory. Remove a file. List files and directories. Print working directory. Copy files and directories. Change directory. Example: mkdir temp rmdir temp ls, ls -al cd cd / cd /usr/local/bin cd temp cp /etc/profile. 1. Regardless as to the current location in the filesystem hierarchy, go to the "home" directory. 2. In the home directory, create the following subdirectories: documents spreadsheets employees 3. Within the "documents" subdirectory, create the following subdirectories: letters memos 4. Within the "spreadsheets" directory, create the following subdirectories: plans budget proposals 5. Move into the "budget" directory. What is the current "path"? 6. Move back to the "home" directory. Copy the file named "/usr/fred/.exrc" to the home directory. This file will be needed for later exercises with the "vi" editor. 7. In the home directory, create a long list of all the files. Which of these "files" are actually directories? How easy is it to tell which files are directories? SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 4

6 4 UNIX Commands Perform the following file management exercises. 1. What are the current permissions for the home directory? What permissions do users in your group have in your home directory? What permissions do users not in your group have in your directory? 2. "cat" out your.profile; this is done by using the cat command to display the.profile file on the computer screen. 3. Make a backup copy of your.profile file. Name the backup copy.profile.bak. 4. In the Korn shell, there are two startup files: "/etc/profile" ".profile", which is located in the home directory. Use the wc command, in order to determine how many lines are contained in each of the following files. File Name /etc/profile.profile Number of lines 5. Assume that you have been promoted to Sales Manager of a small business in Louisville, Kentucky. Make a directory in your home directory called vendors: /home/stu#/vendors Make other directories in your home directory called clients, proposals, and misc. 6. Move in to the clients directory. Create a directory called ky; this stands for Kentucky. Create another directory and call it Indiana. 7. Move in to the ky directory. What is the current working directory/full path? 8. The previous Sales Manager was named "Fred". Copy all of the files from /home/fred/clients/ky to the ky directory. Confirm that all of the files have been copied properly. 9. Move into another student's directory and try to create a file there with the "touch" command. What happens? Why? SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 5

7 10. Move to different directories on the Unix file system and try using the file command to ascertain which different types of files are on the system. What types of files are in the /bin or /dev directories? 11. Copy the /etc/passwd file to your home directory. Confirm that it is there. From the home directory delete the passwd file that was created in the misc sub-directory. 12. Use the df command with the -k option to ascertain how full the "/" and "/stand" filesystems are. What is the capacity and available space. 13. Use the find command to search for files named lpsched file in the /usr directory system. 14. Use the find command to locate all of the files on the system that have been modified within the last two days. SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 6

8 5 vi Text Editor Perform this cursor movement exercise: 1. Create a new file using vi. 2. Enter a few short paragraphs. 3. Use the cursor positioning keys, scroll up, down, left and right. 4. Use the Scrolling and paging commands to scroll up and down a page. Scroll up and down; one line at a time. 5. Search for the letter a. Find the next occurrence of the letter a. 6. Search backwards for the letter a. Find the previous occurrence of the letter a. 7. Move the cursor to the 20 th line in the file. Move to the first line. Move to the last line. Use the G command. 8. Display the state of the file. 9. Move the cursor to the top line on the screen. 10. Move the cursor to the middle line on the screen. 11. Move the cursor to the last line on the screen. 12. Move the cursor forward 1 word. 13. Move the cursor backward 1 word. 14. Move the cursor to the end of the current word. 15. Save the file. Terminate vi. SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 7

9 Perform this string handling exercise: 1. Find any word and insert an s at the end of the word. 2. Insert a blank line before an existing line. 3. Delete a single character. 4. Replace a single character. 5. Replace a single character with several characters. 6. Delete a word. 7. Delete the previous word. 8. Change the text of a single word. 9. Delete a line. 10. Replace a single line. 11. Delete all line from the cursor to the end of the file. 12. Undo the previous command. SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 8

10 6 Execution Environment Processes and Job Control Exercise 1. Display the current processes with the "ps -f" command. What processes are running? 2. What is the PID of the "ksh" process? 3. What happen if the PID of the "ksh" process is killed? 4. Use the "ps" command to determine what processes are being used by user "stu1". 5. Use the following command for purpose of determining how many processes are being run by student accounts: ps -ef grep stu wc l 6. Use the "-u" option with "ps" to determine what processes are being run by Student #1. 7. Try to kill the PID of Student #1's "ksh" process. What happens? SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 9

11 Multi-Processing Type the following commands: Type Description Cd Move to your home directory. vi.profile Edit your.profile file. ^Z Suspend your vi job. vi /etc/profile Edit the /etc/profile file ^Z Suspend that vi job. Jobs l List the jobs in your job table. Find /usr -name lpsched - print Search for a file named lpsched. ^Z Stop the find command. Jobs l List the jobs in your job table again. systat Run a shell program named systat. ^Z Suspend that process also. fg %1 Go back to your first vi process - your.profile file. :q Quit vi Jobs l List the jobs in your job table again. fg %2 Bring your second vi editing session back to the foreground. :q Quit this vi session also. Jobs l List the jobs again. fg Bring the most recent job to the foreground. q Quit the systat program. fg Bring the "find" process back to life in the foreground. ^i Interrupt the find searching process. SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 10

12 7 Shell Programming Write a shell script which renames all.txt files as.text files. Write a shell script called pidof which takes a name as parameter and returns the PID(s) of processes with that name. Shell scripts can also include functions. Functions are declared as: function funcname() { statements } and invoked as funcname param1 param2... The parameters passed to the function are accessible inside the function through the variables $1, $2, etc. Add a usage() function to the pidof script which prints usage instructions. Call usage() if the wrong number of parameters is passed to the script. SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 11

13 8 Bourne Shell Programming 1. Write a script called greetme that: Greets the user. Prints the date and time. Prints the name of your machine. 2. Write a script called rename that will take two arguments: the name of the original file and the new name for the file. If two arguments have not been entered, print an error message and exit. Otherwise, rename the file and print a message stating what has been done. 3. Modify the previous program to check for the existence of the original file before attempting to rename. If it exists, rename it. Otherwise print an appropriate error message. 4. Write a script called userinfo that:: Asks the user's full name: first middle and last. Greets the user by name and ask for the year when born. Calculate their age and output it to the screen with an appropriate message. 5. Write a script called checking that will: Take as a command line argument the user's name. Test whether the argument was provided and exited with an appropriate message. If the argument was not provided with an appropriate message; check whether the user is in /etc/passwd. If the argument was not provided with an appropriate message, print a message stating that the user was found or there was "no such user on our system." SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 12

14 Perform the following Korn Shell" exercises: 9 Korn Shell Programming 1. Change the prompt (PS1) to display the current working directory. 2. Change the second prompt to read "continue, master: ". 3. What is the value of the TERM and HOME environment variables? 4. What is the value of your PATH variable? Write this down. Now modify your PATH variable to only include the /usr/local directory. Try the date command again - what happens? Try the ls command. Then try the pwd and the cd commands. 5. Log out and back in, then use the whence command to see if you can find out what happened. 6. Set the noclobber variable (enable it). Create a file named file_list by redirecting the standard output from an ls command. Then, try to overwrite this file by performing the exact same command again. What happens? 7. Create an alias named dir that you can use that stands for the following pipeline command: ls -af more 8. Create an alias named where that stands for pwd. 9. Create an alias named del that stands for "rm -i". 10. What is the value of your HISTSIZE variable? SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 13

15 11. Enter the following commands: cd ls ls -al ps -ef who 12. Use the fc -l command to list your previous commands. 13. Use the r command to repeat your most recent ls command, referring to the ls command by number. 14. Use the r command to repeat your most recent ps command, referring to the ps command by name instead of by number. SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 14

16 10 sed Answer the following questions. 1. What will the command sed ' ' filename do? 2. Where does sed normally place its output? 3. What will the command sed '2,4 s/e/#/ ' filename do? 4. What will the command sed '2,4 s/e/#/g ' filename do? 5. What will the command sed '2,end s/e/#/ ' filename do? 6. What does the metacharacter.o match? 7. What does the metacharacter $ do? 8. What does the pattern '^.o' match? 9. What is the difference between: sed '/^$/d' filename and sed '/^ *$/d' filename do? 10. How does the option -n change a sed instruction? 11. Enter a sed command that will place 10 spaces at the beginning of each line of file What does the command sed '5q' file1 do? 13. What does the command sed '/west/s/5/8' file1 do? 14. What does the sed command sed -e '1,3d' -e 's/hemenway/jones/' datafile do? 15. What does the sed command sed -n '/west/,/east/p' datafile do? SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 15

17 11 awk Programming Answer the following questions. 1. What do the escape characters do in awk statements? 2. What is the purpose of format specifiers in printf statements? 3. What are some differences between print and printf in awk? 4. When multiple actions are entered in a awk command, how is this different from entering a single line command versus a multi-line script? 5. Explain the way the tilde (~) command works in awk? 6. What is the role of a pattern versus an action in awk? 7. What do the following regular expression metacharacters do in awk? 8. Discuss the -F option in awk as it relates to multiple field separators. 9. What does the variable $0 contain in awk? 10. What does the command awk '{print $0}' datafile do? SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 16

18 Use the file provided by the instructor and perform the following: 1. Enter the awk command that will print all the phone numbers. 2. Enter the awk command that will print Dan's phone number. 3. Enter the awk command that will print Susan's name and phone number. 4. Enter the awk command that will print all last names beginning with D. 5. Enter the awk command that will print all first names beginning with C or E. 6. Enter the awk command that will print all first names containing only four characters. 7. Enter the awk command that will print the first names of all those in the 916 area code 8. Enter the awk command that will print Mike's campaign contributions preceded by a dollar sign ($) 9. Enter the awk command that will print last names followed by a comma followed by the first name (easier than with sed). 10. Write a awk script called facts that: Prints full names and phone numbers for the Savages. Prints Chet's contributions. Prints all those who contributed $250 the first month. SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (UNIX-for App Dev ) App B: Page 17

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

UNIX Shell Programming

UNIX Shell Programming $!... 5:13 $$ and $!... 5:13.profile File... 7:4 /etc/bashrc... 10:13 /etc/profile... 10:12 /etc/profile File... 7:5 ~/.bash_login... 10:15 ~/.bash_logout... 10:18 ~/.bash_profile... 10:14 ~/.bashrc...

More information

Set 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

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

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

Unix as a Platform Exercises. Course Code: OS-01-UNXPLAT Unix as a Platform Exercises Course Code: OS-01-UNXPLAT Working with Unix 1. Use the on-line manual page to determine the option for cat, which causes nonprintable characters to be displayed. Run the command

More information

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

UNIX Essentials Featuring Solaris 10 Op System

UNIX Essentials Featuring Solaris 10 Op System A Active Window... 7:11 Application Development Tools... 7:7 Application Manager... 7:4 Architectures - Supported - UNIX... 1:13 Arithmetic Expansion... 9:10 B Background Processing... 3:14 Background

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

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

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

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

IBM AIX Basic Operations V5.

IBM AIX Basic Operations V5. IBM 000-190 AIX Basic Operations V5 http://killexams.com/exam-detail/000-190 QUESTION: 122 Which of the following options describes the rm -i command? A. It removes and reports the file names it removes.

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

CST Algonquin College 2

CST Algonquin College 2 The Shell Kernel (briefly) Shell What happens when you hit [ENTER]? Output redirection and pipes Noclobber (not a typo) Shell prompts Aliases Filespecs History Displaying file contents CST8207 - Algonquin

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

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

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

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

Unix Introduction to UNIX

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

Bashed One Too Many Times. Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009

Bashed One Too Many Times. Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009 Bashed One Too Many Times Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009 What is a Shell? The shell interprets commands and executes them It provides you with an environment

More information

Introduction to Linux Workshop 1

Introduction to Linux Workshop 1 Introduction to Linux Workshop 1 The George Washington University SEAS Computing Facility Created by Jason Hurlburt, Hadi Mohammadi, Marco Suarez hurlburj@gwu.edu Logging In The lab computers will authenticate

More information

Outline. Structure of a UNIX command

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

Part 1: Basic Commands/U3li3es

Part 1: Basic Commands/U3li3es Final Exam Part 1: Basic Commands/U3li3es May 17 th 3:00~4:00pm S-3-143 Same types of questions as in mid-term 1 2 ls, cat, echo ls -l e.g., regular file or directory, permissions, file size ls -a cat

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

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

Standard. Shells. tcsh. A shell script is a file that contains shell commands that perform a useful function. It is also known as shell program.

Standard. Shells. tcsh. A shell script is a file that contains shell commands that perform a useful function. It is also known as shell program. SHELLS: The shell is the part of the UNIX that is most visible to the user. It receives and interprets the commands entered by the user. In many respects, this makes it the most important component of

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

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

The UNIX Shells. Computer Center, CS, NCTU. How shell works. Unix shells. Fetch command Analyze Execute

The UNIX Shells. Computer Center, CS, NCTU. How shell works. Unix shells. Fetch command Analyze Execute Shells The UNIX Shells How shell works Fetch command Analyze Execute Unix shells Shell Originator System Name Prompt Bourne Shell S. R. Bourne /bin/sh $ Csh Bill Joy /bin/csh % Tcsh Ken Greer /bin/tcsh

More information

ACS Unix (Winter Term, ) Page 92

ACS Unix (Winter Term, ) Page 92 ACS-294-001 Unix (Winter Term, 2016-2017) Page 92 The Idea of a Link When Unix creates a file, it does two things: 1. Set space on a disk to store data in the file. 2. Create a structure called an inode

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

UNIX COMMANDS AND SHELLS. UNIX Programming 2015 Fall by Euiseong Seo

UNIX COMMANDS AND SHELLS. UNIX Programming 2015 Fall by Euiseong Seo UNIX COMMANDS AND SHELLS UNIX Programming 2015 Fall by Euiseong Seo What is a Shell? A system program that allows a user to execute Shell functions (internal commands) Other programs (external commands)

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

UNIX Basics. Science & Technology Support Group High Performance Computing Ohio Supercomputer Center 1224 Kinnear Road Columbus, OH 43212

UNIX Basics. Science & Technology Support Group High Performance Computing Ohio Supercomputer Center 1224 Kinnear Road Columbus, OH 43212 UNIX Basics Science & Technology Support Group High Performance Computing Ohio Supercomputer Center 1224 Kinnear Road Columbus, OH 43212 1 Table of Contents UNIX Basics--Introduction Useful Concepts Useful

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

Useful Unix Commands Cheat Sheet

Useful Unix Commands Cheat Sheet Useful Unix Commands Cheat Sheet The Chinese University of Hong Kong SIGSC Training (Fall 2016) FILE AND DIRECTORY pwd Return path to current directory. ls List directories and files here. ls dir List

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

Appendix A GLOSSARY. SYS-ED/ Computer Education Techniques, Inc.

Appendix A GLOSSARY. SYS-ED/ Computer Education Techniques, Inc. Appendix A GLOSSARY SYS-ED/ Computer Education Techniques, Inc. $# Number of arguments passed to a script. $@ Holds the arguments; unlike $* it has the capability for separating the arguments. $* Holds

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

The Unix Shell & Shell Scripts

The Unix Shell & Shell Scripts The Unix Shell & Shell Scripts You should do steps 1 to 7 before going to the lab. Use the Linux system you installed in the previous lab. In the lab do step 8, the TA may give you additional exercises

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

This is Lab Worksheet 3 - not an Assignment

This is Lab Worksheet 3 - not an Assignment This is Lab Worksheet 3 - not an Assignment This Lab Worksheet contains some practical examples that will prepare you to complete your Assignments. You do not have to hand in this Lab Worksheet. Make sure

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

Unix System Architecture, File System, and Shell Commands

Unix System Architecture, File System, and Shell Commands Unix System Architecture, File System, and Shell Commands Prof. (Dr.) K.R. Chowdhary, Director COE Email: kr.chowdhary@iitj.ac.in webpage: http://www.krchowdhary.com JIET College of Engineering August

More information

Introduction to UNIX Shell Exercises

Introduction to UNIX Shell Exercises Introduction to UNIX Shell Exercises Determining Your Shell Open a new window or use an existing window for this exercise. Observe your shell prompt - is it a $ or %? What does this tell you? Find out

More information

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Mauro Ceccanti e Alberto Paoluzzi

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Mauro Ceccanti e Alberto Paoluzzi Lezione 8 Bioinformatica Mauro Ceccanti e Alberto Paoluzzi Dip. Informatica e Automazione Università Roma Tre Dip. Medicina Clinica Università La Sapienza Sommario Shell command language Introduction A

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

Lab 2: Linux/Unix shell

Lab 2: Linux/Unix shell Lab 2: Linux/Unix shell Comp Sci 1585 Data Structures Lab: Tools for Computer Scientists Outline 1 2 3 4 5 6 7 What is a shell? What is a shell? login is a program that logs users in to a computer. When

More information

UNIX Quick Reference

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

UNIX Quick Reference

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

CS4350 Unix Programming. Outline

CS4350 Unix Programming. Outline Outline Unix Management Files and file systems Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission

More information

h/w m/c Kernel shell Application s/w user

h/w m/c Kernel shell Application s/w user Structure of Unix h/w m/c Kernel shell Application s/w. user While working with unix, several layers of interaction occur b/w the computer h/w & the user. 1. Kernel : It is the first layer which runs on

More information

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

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

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Esercitazione Introduzione al linguaggio di shell

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Esercitazione Introduzione al linguaggio di shell Lezione 8 Bioinformatica Mauro Ceccanti e Alberto Paoluzzi Esercitazione Introduzione al linguaggio di shell Dip. Informatica e Automazione Università Roma Tre Dip. Medicina Clinica Università La Sapienza

More information

CSCE 212H, Spring 2008, Matthews Lab Assignment 1: Representation of Integers Assigned: January 17 Due: January 22

CSCE 212H, Spring 2008, Matthews Lab Assignment 1: Representation of Integers Assigned: January 17 Due: January 22 CSCE 212H, Spring 2008, Matthews Lab Assignment 1: Representation of Integers Assigned: January 17 Due: January 22 Manton Matthews January 29, 2008 1 Overview The purpose of this assignment is to become

More information

5/8/2012. Creating and Changing Directories Chapter 7

5/8/2012. Creating and Changing Directories Chapter 7 Creating and Changing Directories Chapter 7 Types of files File systems concepts Using directories to create order. Managing files in directories. Using pathnames to manage files in directories. Managing

More information

Chapter 1. Getting started with UNIX

Chapter 1. Getting started with UNIX Chapter 1. Getting started with UNIX The core of the UNIX operating system is the kernel. The kernel keeps records of all programs (commonly called processes) running on the system and shares time among

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

Std: XI CHAPTER-3 LINUX

Std: 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 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

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

Getting Started. Running Utilities. Shells. Special Characters. Special Characters. Chapter 2 Unix Utilities for non-programmers

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

Computer Systems and Architecture

Computer 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 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

Introduction to Unix and Linux. Workshop 1: Directories and Files

Introduction to Unix and Linux. Workshop 1: Directories and Files Introduction to Unix and Linux Workshop 1: Directories and Files Genomics Core Lab TEXAS A&M UNIVERSITY CORPUS CHRISTI Anvesh Paidipala, Evan Krell, Kelly Pennoyer, Chris Bird Genomics Core Lab Informatics

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

12.1 UNDERSTANDING UNIX SHELL PROGRAMMING LANGUAGE: AN INTRODUCTION Writing a Simple Script Executing a Script

12.1 UNDERSTANDING UNIX SHELL PROGRAMMING LANGUAGE: AN INTRODUCTION Writing a Simple Script Executing a Script 12 Shell Programming This chapter concentrates on shell programming. It explains the capabilities of the shell as an interpretive high-level language. It describes shell programming constructs and particulars.

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

Computer Systems and Architecture

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

Part I. Introduction to Linux

Part 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 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

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

QUESTION BANK ON UNIX & SHELL PROGRAMMING-502 (CORE PAPER-2)

QUESTION BANK ON UNIX & SHELL PROGRAMMING-502 (CORE PAPER-2) BANK ON & SHELL PROGRAMMING-502 (CORE PAPER-2) TOPIC 1: VI-EDITOR MARKS YEAR 1. Explain set command of vi editor 2 2011oct 2. Explain the modes of vi editor. 7 2013mar/ 2013 oct 3. Explain vi editor 5

More information

CS 25200: Systems Programming. Lecture 11: *nix Commands and Shell Internals

CS 25200: Systems Programming. Lecture 11: *nix Commands and Shell Internals CS 25200: Systems Programming Lecture 11: *nix Commands and Shell Internals Dr. Jef Turkstra 2018 Dr. Jeffrey A. Turkstra 1 Lecture 11 Shell commands Basic shell internals 2018 Dr. Jeffrey A. Turkstra

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

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

The Shell. EOAS Software Carpentry Workshop. September 20th, 2016

The Shell. EOAS Software Carpentry Workshop. September 20th, 2016 The Shell EOAS Software Carpentry Workshop September 20th, 2016 Getting Started You need to download some files to follow this lesson. These files are found on the shell lesson website (see etherpad) 1.

More information

Introduction to Linux Environment. Yun-Wen Chen

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

CS 460 Linux Tutorial

CS 460 Linux Tutorial CS 460 Linux Tutorial http://ryanstutorials.net/linuxtutorial/cheatsheet.php # Change directory to your home directory. # Remember, ~ means your home directory cd ~ # Check to see your current working

More information

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

Introduction to Supercomputing

Introduction to Supercomputing Introduction to Supercomputing TMA4280 Introduction to UNIX environment and tools 0.1 Getting started with the environment and the bash shell interpreter Desktop computers are usually operated from a graphical

More information

Introduction to Linux. Roman Cheplyaka

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

UNIX Command Cheat Sheets

UNIX Command Cheat Sheets UNIX Command Cheat Sheets date Writes the current date to the screen date Mon Nov 20 18:25:37 EST 2000 sort infile Sorts the contents of the input file in alphabetical order sort names Sorts the contents

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

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used: Linux Tutorial How to read the examples When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used: $ application file.txt

More information

Files and Directories

Files and Directories CSCI 2132: Software Development Files and Directories Norbert Zeh Faculty of Computer Science Dalhousie University Winter 2019 Files and Directories Much of the operation of Unix and programs running on

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Phil Mercurio The Scripps Research Institute mercurio@scripps.edu 1 Session Overview What is Linux Shells & Windows The Linux File System Assorted Commands 2 What Is Linux? Linux

More information

5/8/2012. Specifying Instructions to the Shell Chapter 8

5/8/2012. Specifying Instructions to the Shell Chapter 8 An overview of shell. Execution of commands in a shell. Shell command-line expansion. Customizing the functioning of the shell. Employing advanced user features. Specifying Instructions to the Shell Chapter

More information

Unix Handouts. Shantanu N Kulkarni

Unix Handouts. Shantanu N Kulkarni Unix Handouts Shantanu N Kulkarni Abstract These handouts are meant to be used as a study aid during my class. They are neither complete nor sincerely accurate. The idea is that the participants should

More information

System Programming. Introduction to Unix

System Programming. Introduction to Unix Content : by Dr. B. Boufama School of Computer Science University of Windsor Instructor: Dr. A. Habed adlane@cs.uwindsor.ca http://cs.uwindsor.ca/ adlane/60-256 Content Content 1 Introduction 2 3 Introduction

More information

UNIX Command Cheat Sheets

UNIX Command Cheat Sheets UNIX Command Cheat Sheets date Writes the current date to the date Mon Nov 20 18:25:37 EST 2000 sort infile Sorts the contents of the input file in alphabetical order sort names Sorts the contents of names

More information

UNIX Basics. UNIX Basics CIS 218 Oakton Community College

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

Refresher workshop in programming for polytechnic graduates General Java Program Compilation Guide

Refresher workshop in programming for polytechnic graduates General Java Program Compilation Guide Refresher workshop in programming for polytechnic graduates General Java Program Compilation Guide Overview Welcome to this refresher workshop! This document will serve as a self-guided explanation to

More information

This section reviews UNIX file, directory, and system commands, and is organized as follows:

This section reviews UNIX file, directory, and system commands, and is organized as follows: Basic UNIX Commands Created by : M.S. Schmalz (Thank you Mark!) This section reviews UNIX file, directory, and system commands, and is organized as follows: 3.1. The UNIX Command Line Interface 3.2. Overview

More information

What is the Shell. Whenever you login to a Unix system you are placed in a program called the shell. All of your work is done within the shell.

What is the Shell. Whenever you login to a Unix system you are placed in a program called the shell. All of your work is done within the shell. What is the Shell Whenever you login to a Unix system you are placed in a program called the shell. All of your work is done within the shell. The shell is your interface to the operating system. It acts

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

Getting started with Hugs on Linux

Getting started with Hugs on Linux Getting started with Hugs on Linux COM1022 Functional Programming Techniques Dr Hans Georg Schaathun University of Surrey Autumn 2009 Week 7 Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn

More information

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018 GNU/Linux 101 Casey McLaughlin Research Computing Center Spring Workshop Series 2018 rccworkshop IC;3df4mu bash-2.1~# man workshop Linux101 RCC Workshop L101 OBJECTIVES - Operating system concepts - Linux

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

Software I: Utilities and Internals. What is UNIX?

Software I: Utilities and Internals. What is UNIX? Software I: Utilities and Internals Lecture 1 UNIX for Beginners What is UNIX? UNIX is a time-sharing operating system with userchosen shells (user interfaces) and one kernel (operating system core, which

More information