Introduction to Unix – CS 21 Lecture 2. Lecture Overview Starting out in Unix Getting help when needed Looking around a little Environment and Environment.

Slides:



Advertisements
Similar presentations
POS/420 Philip Robbins – March 19, 2013 (Week 2) University of Phoenix Mililani Campus Introduction to Unix.
Advertisements

RH030 Linux Computing Essentials
CS 497C – Introduction to UNIX Lecture 11: - The File System Chin-Chih Chang
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
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.
GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
CSE 303 Lecture 2 Introduction to bash shell
Guide To UNIX Using Linux Third Edition
Very Quick & Basic Unix Steven Newhouse Unix is user-friendly. It's just very selective about who its friends are.
Introduction to Unix – CS 21 Lecture 5. Lecture Overview Lab Review Useful commands that will illustrate today’s lecture Streams of input and output File.
UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter.
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. This presentation covers :  User Interface Administration  Files System and Services Management 2.
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.
Guide To UNIX Using Linux Fourth Edition
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.
The file structure and related utilities CS240 Computer Science II.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
UNIX command line. In this module you will learn: What is the computer shell What is the command line interface (or Terminal) What is the filesystem tree.
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.
Unix Basics Chapter 4.
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
Introduction to Unix – CS 21 Lecture 9. Lecture Overview Shell description Shell choices History Aliases Topic review.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
Chapter Two Exploring the UNIX File System and File Security.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
CPSC 217 T03 Week I Part #1: Unix and HELLO WORLD Hubert (Sathaporn) Hu.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
Introduction to Unix – CS 21 Lecture 4. Lecture Overview * cp, mv, and rm Looking into files The file command head and tail cat and more What we’ve seen.
Chapter Two Exploring the UNIX File System and File Security.
ITR3 lecture 6: intoduction to UNIX Thomas Krichel
Chapter 1 : The Linux System Part 2 Lecture 2 11/14/
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
E X C E E D I N G E X P E C T A T I O N S Basic LINUX Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Directory structure:
Λειτουργικά Συστήματα - Lab1 Γιάννης Πετράκης. The Operating System  Unix is a layered operating system  The innermost layer is the hardware that provides.
Introduction to Programming Using C An Introduction to Operating Systems.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop V Files and the File System Part B – File System.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
1 Day 2 Logging in, Passwords, Man, talk, write. 2 Logging in Unix is a multi user system –Many people can be using it at the same time. –Connections.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
FTP COMMANDS OBJECTIVES. General overview. Introduction to FTP server. Types of FTP users. FTP commands examples. FTP commands in action (example of use).
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
The Unix File sytem. Introduction Tree structure …
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.
Linux Administration – Finding You Way on the Command Line The Linux File Directory or Tree.
BILKENT UNIVERSITY DEPARTMENT OF COMPUTER TECHNOLOGY AND INFORMATION SYSTEMS CTIS156 INFORMATION TECHNOLOGIES II FILES AND FILE SYSTEM STRUCTURE.
Introduction to Unix – CS 21
Department of Computer Engineering
Linux/Unix - Download Ubuntu Linux :
The Command Prompt Commands are the way to “do things” in Unix
CSE 374 Programming Concepts & Tools
Exploring the UNIX File System and File Security
(Chapter 2) John Carelli, Instructor Kutztown University
Module 6 Working with Files and Directories
Chapter 4: The Linux Filesystem
January 26th, 2004 Class Meeting 2
Presentation transcript:

Introduction to Unix – CS 21 Lecture 2

Lecture Overview Starting out in Unix Getting help when needed Looking around a little Environment and Environment Variables The Unix file structure Organization Navigation

Logging In (And Logging Out) Your Unix experience begins with a login prompt Login name and password Always be sure to log out Why? Malicious people shouldn’t have access to your account Locking the screen…is it safe? Well, maybe, maybe not

Good Password Versus Bad Password What makes a bad password? Any word in a dictionary Any word from a sci-fi movie/show 30 sec – 8 minutes to break What makes a good password? Easily interpreted and remembered by user Looks like random gibberish to others passwd normally changes your password

I’m In, Now What? No “tour of Unix” like Windows has You’re pretty much on your own Unix assumes you know what you are doing You are given just enough leverage to either do everything well or really mess everything up

Where To Get Help man The most important command in all of Unix RTM info More complete descriptions of certain packages help Shell specific commands apropos whatis (RTFM)

Man Page Sections And What They Mean 1 – User commands 2 – System Calls 3 – C library routines 4 – Administrative files 5 – Miscellaneous 6 – Games 7 – I/O and special files 8 – System administration commands

More on man Other sections exist (such as the perl reference manual and the tcl reference manual) -a will show all the man pages that match First is shown by default How would you find out more about man? man man

Example

How Am I Supposed To Read This? Name: The name of the program and a brief description Synopsis: How to run this command Description: Listing of all flags and what they do See also: Relevant related commands

What Do You Do If There Isn’t A Man Page? Option 1: run the program and hope it doesn’t destroy anything Option 1b: run the program with random flags and see what exactly it destroys Option 2: do a little snooping Check for man pages or documentation on the web See if there are any environment variables that it might use

Who is logged on and what are they doing? users Shows a list of all currently logged on users who (and whoami) Shows a list of all currently logged on users and where they are logged on from w Shows a list of all currently logged on users and what they are running finger Tells a little more information about users

Privacy issue? You can tell when someone else is logged on and exactly what they are doing Everyone else can see what you are doing Is this acceptable?

One User To Rule Them All The superuser – root Root has the permission to do anything Including wiping the entire system clean The system will allow root to do just about anything Comparable to “Administrator” in Windows Of course, any user in Windows XP can be designated an Administrator and install software

No, You Can’t Get Root For obvious reasons, you will not be given root access Don’t feel bad though, very few people at school have root You can always install your own machine at home to play around with Knoppix

Environment And Environment Variables A set of preset variables that all programs run from that shell can see In order to see them, run the command: printenv Set environment variables with the command: export VAR=VALUE Clear environment variables with: unset VAR

Example

Stupid Analogy Of The Day Each contain useful information Every program can check them out and read them If someone changes them, the next person to check them out will see those changes Environment Variables =

Exporting Or Not If you don’t export the variable, it is a local variable and not accessible to everyone Get access to a local variable by using the dollar sign ($VAR)

A Very Important Environment Variable PATH Tells Unix where to look in order to find programs to run Very important hint: When typing a command, you should be able to hit the tab key in order to complete it Called tab completion, this is a most invaluable tool The system searches your PATH for any program it can run that matches what you have typed so far

Files, Files Everywhere Unix treats almost everything as a file Standard text files and binaries Directories Links Even devices! Your terminal is a file, your keyboard is a file, your hard drive is a file, everything is a file!

What Was That? To repeat, Everything in Unix is a file! Why? This goes back to the design of Unix trying to keep everything simple Treating everything the same allows for a simple interface to interact with everything in the same way

Unix Directory Structure Everything is a file, and the directory structure is like a filing cabinet

Inverted Tree Structure / /usr/bin/home/var/lib /home/csmajs/home/csgrads /home/csmajs/undergrads/home/csgrads/graduates

What Goes Where? / Root of the entire system Comparable in Windows to C:\ Windows, however, has several roots depending on what partition and device you are looking at /bin Commonly used binaries (programs)

And… /sbin More programs to run Statically linked Still should run if you tinker around and mess things up /usr User related commands as well as a whole bunch of random stuff

And… /lib Libraries go in here /dev All devices are located in here /home Traditionally, this is where user accounts are stored /etc Startup files and configuration files for daemons and other programs

And… /var Various files go in here Traditional location of mailboxes /var/spool/mail /proc Special files that contain information about the system or info from running programs

Navigating The Directory Structure You are always located at one location in the tree ls Provides a listing of the current directory All files and directories are shown cd Change directory “cd /” Moves your current directory to / cd without any arguments moves you to your home directory

Creating And Removing Directories mkdir Makes a directory “mkdir myDir” rmdir Removes an empty directory “rmdir myDir”

A Couple Of Notes Unix is case-sensitive myDir is different from MyDir and mydir Not all files are shown with ls “ls –a” will show all files Hidden files in Unix always start with a. Example:.hidden.plan

Command Line Options Almost all Unix commands have options that change what they do Read the man pages for a listing They have the form: -a Depending on the command, they may be lumped together -a –l is the same as -al

How Different?

Special Directories. This stands for the current directory.. This stands for the directory directly above the current directory ~ Your home directory These directories can be “stacked” “../..” stands for two directories directly above the current directory

Relative Versus Absolute Pathnames Unix supports two different styles for directories Absolute pathnames Always start from / and contain the entire route “/home/csgrads/villarre” Relative pathnames Assumed to be relative to current directory Doesn’t start with a / “classes/cs21”

Advanced Navigation Through The Directory Structure pushd “Push” a directory onto a stack popd “Pop” a directory from a stack A Stack is what’s known as a LIFO structure Last in, first out

How Does A Stack Work? e d c b a

e d c b a d

How Does pushd and popd Work? /var/spool/ /home/csmajs /bin /usr /home pushd /var/spool pushd /home popd Current Directory: /home/csmajs/var/spool/home/var/spool/home/csmajs

Today In Lab Put all of the material from today into practice Lab will be posted later today at:

Reading Assignment Read chapters 2-4 I will assign a homework beginning of next week First quiz will be a week from next Tuesday