Basic UNIX © McGraw Hill 2000. All rights reserved.

Slides:



Advertisements
Similar presentations
CS 497C – Introduction to UNIX Lecture 11: - The File System Chin-Chih Chang
Advertisements

UNIX file systems Learning Objectives: 1. To understand the basics of file systems 2. To understand the hierarchical structure in Unix file system 3. To.
Exploring the UNIX File System and File Security
The UNIX File System CS465. File Systems What is a file system? A means of organizing information on the computer. A file system is a logical view, not.
Linux+ Guide to Linux Certification, Second Edition
Linux Files. Files and directories As in Windows directories are structures which contain –Other directories –Files.
Guide To UNIX Using Linux Third Edition
UNIX Files and Security Software Tools. Slide 2 File Systems l What is a file system? A means of organizing information on the computer. A file system.
A Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  Currently there.
Linux Commands LINUX COMMANDS.
Learning basic Unix command IT 325 operating system.
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
File Systems Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
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”
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.
CHAPTER 1 UNIX FOR NONPROGRAMMERS By U ğ ur Halıcı.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Unix Basics Chapter 4.
Linux+ Guide to Linux Certification, Second Edition
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.
Linux file system "On a UNIX system, everything is a file; if something is not a file, it is a process." Sorts of files (on a Linux system) Directories:
Introduction to UNIX Road Map: 1. UNIX Structure 2. Components of UNIX 3. Process Structure 4. Shell & Utility Programs 5. Using Files & Directories 6.
Chapter Two Exploring the UNIX File System and File Security.
Chapter 1 : The Linux System Part 2 Lecture 2 11/14/
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:
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
1 © 2001 John Urrutia. All rights reserved. Chapter 4 The LINUX Filesystem.
Introduction to Programming Using C An Introduction to Operating Systems.
Manage Directories and Files in Linux Part 2. 2 Identify File Types in the Linux System The file types in Linux referred to as normal files and directories.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Linux Commands C151 Multi-User Operating Systems.
File Systems, telnet and ftp Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
A gentle introduction to LINUX at the command prompt.
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
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.
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.
UNIX file systems Learning Objectives: 1. To understand the basics of file systems 2. To understand the hierarchical structure in Unix file system 3. To.
Learning basic Unix command It 325 operating system.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
Chapter 2: Exploring the UNIX File System (For Tuesday Section) File and File Systems.
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.
UNIX Basics Matt Hayward October 18, 2016 LS560 – Information Technology for information professionals.
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.
Introducing the UNIX Operating System.
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 file system "On a UNIX system, everything is a file;
Lecture 2 Working with Files and Directories
Some Linux Commands.
C151 Multi-User Operating Systems
The Command Prompt Commands are the way to “do things” in Unix
Exploring the UNIX File System and File Security
Operating Systems and Using Linux
Web Programming Essentials:
The Unix File System.
Introduction Paul Flynn
Module 6 Working with Files and Directories
Lab 2: Terminal Basics.
Linux Commands LINUX COMMANDS.
Chapter 4: The Linux Filesystem
January 26th, 2004 Class Meeting 2
Presentation transcript:

Basic UNIX © McGraw Hill All rights reserved.

Introduction UNIX is an operating system UNIX has 3 main parts:  Kernel - manages hardware resources like terminals and printers  File System - accesses files; tree structured  Shell - interacts with users UNIX is interactive UNIX is multi-tasking UNIX is multi-user

System Prompt % or $ or computername> System prompt indicates that system is waiting for a command Enter commands at the prompt: %pine%menu %date%who %help%whoami %cal%cal arg (arg = year) %man arg (arg = command name) Note: UNIX commands are case sensitive!

File System File is a container for data 3 kinds of files: Directories (like folders) Container for files and other directories Sub-directory is a directory contained within another directory Ordinary files Special files

File Structure Directories and files are organized in a tree- like hierarchy Directory at the top is known as the root directory and is represented as a / Some standard subdirectories under the root directory are etc, usr, and tmp

UNIX Tree-like Hierarchy / mnt n bin tmp_mnt m jrp hdb ehepp root Full pathname: /n/m/37/ehepp

Home Directory “Home” directory is where you find yourself when you log in To print the name of the directory you are in: %pwd (print working directory) Shows the “full pathname” eg. /n/m/37/ehepp

Pathnames A pathname is the concatenation of the directories you traverse to reach a file A relative pathname is the concatenation of the directory names from where you are currently “located” in the file hierarchy A full pathname specifies the complete path traversed starting with the root (also called an absolute pathname)

File and Directory Organization You can create and maintain files and directories in your home directory Use subdirectories to organize files Use the mkdir command to create a subdirectory: %mkdir myCS403stuff New subdirectory will be be created in current directory (also called working directory)

Moving Through the File Structure Using the cd command cd is the change directory command Specify a directory name as an argument to cd command to move to that directory within the current directory %cd myCS403stuff Specify a full pathname as an argument to change directories %cd /n/m/37/ehepp/myCS403stuff

cd Command (continued) %cd or %cd ~ will put you in your home directory: %cd %pwd /n/m/37/ehepp To move up one one level in a directory hierarchy, follow the cd command with two dots: %cd.. %pwd /n/m/37

File Manipulation Rename a file (move) %mv index.html index.old Delete a file (remove) %rm -i mystuff.txt Look at contents of a file %more index.html Copy a file %cp -i index.html index.bkup Create a file %pico myfile.html Update a file %pico myfile.html

Other UNIX Commands List a directory’s contents %ls List a directory’s contents in the “long form” %ls -l List a directory’s contents including hidden files %ls -a Remove a directory %rmdir myCS403stuff

File Permissions Permissions provide a measure of security by establishing who is able to access what files and directories, and how they can be accessed File and directory permissions can be displayed using the ls -l command %ls -l -r--r--r-- 1 marymc Spanish 167 Jul 27 08:15 file.txt

Permission Codes 3 identifiers specify who can access the file:  User who owns file – u (aka “owner”)  Users who are members of the same group as the file owner - g  All other users - o (aka “rest of the world”) 3 levels of access:  Read - r  Write - w  Execute – x (or “search” for directories)

Permission Codes (continued) r w x r w x r w x ug Nine characters are split into three sets of three characters each: - 1st set identifies permissions for the user - 2nd set identifies permissions for the group - 3rd set identifies permissions for others (the rest of the world) o

Permission Code Examples r - - r - - r - - user, group members, and others can read the file r only the user can read the file r w - r user can read and write the file, group members can read the file, all others are denied access

Changing Permissions Use the chmod command to change permissions Two ways to use chmod command:  Symbolic form  Numeric form

Symbolic Form of chmod Uses permission code symbols (u, g, o, r, w, x) to add and remove permissions Basic form of command:  To add a permission: %chmod [who]+[access] filename eg. - %chmod o+r README  To remove a permission: %chmod [who]-[access] filename eg. - %chmod o-w README Note: Can set more than one at a time eg. - %chmod o+r,og-w myfile.html

Numeric Form of chmod Think of 9 character permission codes as 9 on/off switches represented by 1/0 r w x r w x r w x r w x r - x r View the binary representation as 3 triplets

Numeric Form of chmod (continued) Use chmod command with octal value representing desired permissions Examples: %chmod 777 myfile.html r w x r w x r w x %chmod 711 mydirectory r w x - - x - - x %chmod 644 myfile.html r w - r - - r - -

File Names UNIX is case sensitive so Myfile.html is not the same as myfile.html Avoid special characters in file names: | & * Extension at end of file name indicates type of file:.html or.htm - Web page.c - C program file.ps - postscript file * represents any arbitrary character string eg. - %ls *.html