CSC – 332 Data Structures Unix and Vi Dr. Curry Guinn.

Slides:



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

Working with Files How to create, view, copy, rename and print files.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
Guide To UNIX Using Linux Third Edition
1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
1 Day 3 Directories Files Moving & Copying. 2 Case Sensitive First thing to learn about UNIX is that everything is case sensitive. Thus the files: –enda.
CSC – 332 Data Structures Day 2: Unix and More! Dr. Curry Guinn.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
A Short Introduction to Unix. Bioinformatics Requires Powerful Computers One definition of bioinformatics is "the use of computers to analyze biological.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
COSC513 Project Linux Features Instructor: Prof. Mort Anvari Student: Yingfeng Luo ID: #
Unix Basics Chapter 4.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction Unix-like system is everywhere Linux Android for smartphones Google Chrome OS for Chromebook Web.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
System Administration Introduction to Unix Session 2 – Fri 02 Nov 2007 Reference:  chapter 1, The Unix Programming Environment, Kernighan & Pike, ISBN.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Some content in this lecture added.
Operating Systems and Using Linux CMSC 104, Lecture 3 John Y. Park 1.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Chapter 1 : The Linux System Part 2 Lecture 2 11/14/
E-module for UNIX Author: Jon Kleppe NTNU Assistant producer: Joachim Tro.
A Genomics View of Unix. General Unix Tips To use the command line start X11 and type commands into the “xterm” window A few things about unix commands:
Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort.
Introduction To UNIX. FAQReferencesSummaryInfo Resources Introduction Learning Objectives Log on User Interface Commands List of Commands Useful Info.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
Introduction to Programming Using C An Introduction to Operating Systems.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
Unix Servers Used in This Class  Two Unix servers set up in CS department will be used for some programming projects  Machine name: eustis.eecs.ucf.edu.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
The Unix File sytem. Introduction Tree structure …
Learning basic Unix command It 325 operating system.
Operating Systems and Using Linux Courtesy of John Y. Park 1.
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Learning Unix/Linux Based on slides from: Eric Bishop.
Operating systems Lecture #3 Modern OS characteristics.
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
Web Programming Essentials:
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Andy Wang Object Oriented Programming in C++ COP 3330
Some Linux Commands.
UNIX Basics Internet Technology.
Unix : Introduction and Commands
Operating Systems and Using Linux
Operating Systems and Using Linux
Web Programming Essentials:
Operating Systems and Using Linux
Andy Wang Object Oriented Programming in C++ COP 3330
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Presentation transcript:

CSC – 332 Data Structures Unix and Vi Dr. Curry Guinn

Quick Info Dr. Curry Guinn –CIS 2045 – – –Office Hours: MTWR: 11:00am-12:00pm and by appointment

The CSC server babbage.cis.uncw.edu A cluster of 6 Dell PowerEdge 1850s with 2 Dual core Intel Xeon 2.8GHz processors and an 800MHz frontside bus. Each machine has 12GBs of memory Each machine has two 72GB U320 hard drives in a Raid 1 configuration. These machines will run Sun Grid Engine N1 with the Sun scheduler, MPI The OS is Centos 4.1 (based on RedHat Enterprise server) which is rolled in with the Rocks Cluster

Why Unix The OS of choice in universities for 25 years The OS of choice for networking Unix can run on virtually any computer (IBM, Sun, HP, Macintosh,etc) Unix is free or nearly free Linux/open source software movement RedHat, FreeBSD, MKLinux, LinuxPPC, etc.

Stable and Efficient Unix is very stable - computers running Unix almost never crash Unix is very efficient it gets maximum number crunching power out of your processor (and multiple processors) it can smoothly manage extremely huge amounts of data Once learned, the user interface allows for functionality that does not exist in GUI-based OS

Unix has some Drawbacks Unix computers are controlled by a command line interface Not terribly user-friendly Somewhat difficult to learn Hackers can exploit Unix/Linux There are security holes There are many different versions of Unix with subtle (or not so subtle) differences

Program Management Every program is independent –The core operating system (known as the kernel) manages each program as a distinct process with its own little chunk of dedicated memory. –If one program runs into trouble, it dies, but does not affect the affect the kernel or the other programs running on the computer.

The Unix Shell You communicate with a Unix computer through a command program known as a shell. The shell interprets the commands that you type on the keyboard. There are actually many different shells available for Unix computers, and on some systems you can choose the shell in which you wish to work. You can use shell commands to write simple programs (scripts) to automate many tasks

Unix Commands Unix commands are short and cryptic like vi or rm. Very fast; you will get used to it. Every command has a host of modifiers which are generally single letters preceded by a hyphen: ls -l or mv -R

Wildcards You can substitute the * as a wildcard symbol for any number of characters in any filename. If you type just * after a command, it stands for all files in the current directory: cat * will write all files to the screen You can mix the * with other characters to form a search pattern: ls a*.txt will list all files that start with “a” and end in “.txt” The “ ? ” wildcard stands for any single character

Control Characters Control commands that work (almost) any time ctrl-C will abort any program ctrl-S suspends (halts) output scrolling up on your terminal screen ctrl-Q resumes the display of output on your screen

Getting Help in Unix There is a rudimentary Help system which consists of a set of "manual” pages for every Unix command. The man pages tell you which options a particular command can take, and how each option modifies the behavior of the command. Type man and the name of a command to read the manual page for that command.

Unix Help on the Web Here is a list of a few online Unix tutorials: Unix for Beginners Unix Guru Universe Getting Started With The Unix Operating System x_operating_system/1

Unix Filenames Unix is case sensitive UNIX filenames contain only letters, numbers, and the _ (underscore),. (dot), and - (dash) characters.

Filename Extensions Most UNIX filenames start with a lower case letter and end with a dot followed by one, two, or three letters: myfile.txt However, this is just a common convention and is not required. It is also possible to have additional dots in the filename. The part of the name following the dot is called the “extension.” The extension is often used to designate the type of file.

Working with Directories Directories are a means of organizing your files on a Unix computer. –They are equivalent to folders in Windows and Macintosh computers Directories contain files, executable programs, and sub-directories

Your Home Directory When you login to the server, you always start in your Home directory. Create sub-directories to store specific projects or groups of information, just as you would place folders in a filing cabinet.

File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir (make directory) cd (change directory) rmdir (remove directory) cp (copy) pwd (present working directory) mv (move) more (view by page) rm (remove) cat (view entire file on screen) All of these commands can be modified with many options. Learn to use Unix ‘man’ pages for more information.

Navigation pwd (present working directory) shows the name and location of the directory where you are currently working: $ pwd /home/faculty/guinnc –This is a “pathname,” the slashes indicate sub-directories –The initial slash is the “root” of the whole filesytem ls (list) gives you a list of the files in the current directory: $ ls CLASSES mbox Misc public_html subdir TORVALDS voicedata –Use the ls -l (long) option to get more information about each file $ ls -l total 32 lrwxrwxrwx 1 guinnc guinnc 20 Jul 19 10:17 CLASSES -> /home/classes/guinnc -rw guinnc guinnc Aug 18 10:54 mbox drwxrwxr-x 2 guinnc guinnc 4096 Aug 20 11:13 Misc drwxr-xr-x 2 guinnc guinnc 4096 Jul 18 10:15 public_html drwxrwxr-x 2 guinnc guinnc 4096 Aug 20 11:26 subdir drwxr-xr-x 6 guinnc guinnc 4096 Jul 18 10:16 TORVALDS drwxrwxr-x 3 guinnc guinnc 4096 Aug 7 14:01 voicedata

Sub-directories cd (change directory) moves you to another directory $ cd Misc $ pwd $ /home/faculty/guinnc/Misc mkdir (make directory) creates a new sub-directory inside of the current directory $ ls CLASSES mbox Misc public_html TORVALDS voicedata $ mkdir subdir $ ls CLASSES mbox Misc public_html subdir TORVALDS voicedata rmdir (remove directory) deletes a sub- directory, but the sub-directory must be empty $ rmdir subdir $ ls CLASSES mbox Misc public_html TORVALDS voicedata

File Commands Unix directory structure revisited –'cd ~' change directory to your home –'cd ~guinnc' change directory to guinnc's home –'cd..' change directory to upper directory –'cd / ' change directory to root –Use tabs to complete the file name (write partial file name and then use tab)

Commands for Files cat dumps the entire contents of a file onto the screen.

more or less Use the command more (or less) to view at the contents of a file one screen at a time: Hit the spacebar to page down through the file –b moves back up a page –At the bottom of the screen, more shows how much of the file has been displayed

Copy & Move cp lets you copy a file from any directory to any other directory, or create a copy of a file with a new name in one directory cp filename.ext newfilename.ext cp filename.ext subdir/newname.ext cp /u/jdoe01/filename.ext./subdir/newfilename.ext mv allows you to move files to other directories, but it is also used to rename files. –Filename and directory syntax for mv is exactly the same as for the cp command. mv filename.ext subdir/newfilename.ext –NOTE: When you use mv to move a file into another directory, the current file is deleted.

Delete Use the command rm (remove) to delete files There is no way to undo this command!!! The rem program in my bin directory. Puts files in your.wastebasket Go ahead and copy my.bash_profile and.vimrc into your home directory

Moving Files between Computers You will often need to move files between computers - desktop to server and back There are several options – –FTP SSH Secure Shell has a nice file transfer utility under the Menu “Windows”

Vi Tutorial 12/332/notes/day2_unix/vi.ppthttp://people.uncw.edu/guinnc/courses/Fall 12/332/notes/day2_unix/vi.ppt

For Next Class, Tuesday For Tuesday –Read Weiss, Chapter 1 –Focus on 1.4 and 1.5 –Quiz, due Tuesday night, 11:59pmQuiz Homework 1 due Thursday, 08/30Homework 1