Laboratory: Mechatronics Workshop, Room# E2-2-13.12.

Slides:



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

Jump to first page Unix Commands Monica Stoica Jump to first page Introduction to Unix n Unix was born in 1969 at Bell Laboratories, a research subdivision.
1 Introduction to UNIX Ke Liu
5 Basic utilities When a user logs in to the Linux operating system the directory that they will start in is their home directory. Most users will have.
Exploring the UNIX File System and File Security
Linux+ Guide to Linux Certification, Second Edition
Guide To UNIX Using Linux Third Edition
Basic UNIX © McGraw Hill All rights reserved.
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.
Guide To UNIX Using Linux Fourth Edition
Overview of Linux CS3530 Spring 2014 Dr. José M. Garrido Department of Computer Science.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
The file structure and related utilities CS240 Computer Science II.
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.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Lesson 1. PC vs. Multi-user System  Personal Computer – each user gets his/her own processor (or multicore processor).  Multi-user system – The processor,
Unix Basics Chapter 4.
Cmsc 312 Operating Systems. UNIX? DOS – PC? VAX/VMS - mainframe Unix – PC, workstation, mainframe 1970 bell Lab For computer scientist? Why popular? Free.
Linux+ Guide to Linux Certification, Second Edition
ICT Foundation 1 Copyright © 2010, IT Gatekeeper Project – Ohiwa Lab. All rights reserved. File and Directory.
Linux overview. Architecture Kernel File system Shell: Korn, Bourne, C, Bash X Windows: Motif, Open Look, X.OrgX.Org Desktop: Gnome, KDE,etc.
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.
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.
UNIX File System by Tero Toikkanen, CAP02S. UNIX Multi-user system Multi-user system Multi-tasking system Multi-tasking system Wide selection of tools.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.
L&T Infotech1 UNIX – Getting Started - Aneesh Ramani.
Chapter Two Exploring the UNIX File System and File Security.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Chapter 1 : The Linux System Part 2 Lecture 2 11/14/
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
CS2204: Introduction to Unix January 19 th, 2004 Class Meeting 1 * Notes adapted by Christian Allgood from previous work by other members of the CS faculty.
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.
Λειτουργικά Συστήματα – 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.
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 Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  There are many different.
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.
Learning Unix/Linux Based on slides from: Eric Bishop.
Agenda The Linux File System (chapter 4 in text) Directory Structures / Navigation Terminology File Naming Rules Relative vs Absolute pathnames Unix Commands:
Laboratory 1.2a1 First steps with Unix - Lab Boris Steipe Department of Biochemistry Department.
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
Agenda The Linux File System (chapter 4 in text)
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:
Lecture 2 Working with Files and Directories
UNIX Basics Internet Technology.
Exploring the UNIX File System and File Security
Unix : Introduction and Commands
Operating Systems and Using Linux
Operating Systems and Using Linux
Web Programming Essentials:
Introduction Paul Flynn
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Chapter 4: The Linux Filesystem
January 26th, 2004 Class Meeting 2
Presentation transcript:

Laboratory: Mechatronics Workshop, Room# E

Every computer uses an operating system. The operating system forms a platform for other system software and application software. The most popular operating systems in use today are: Windows from Microsoft Mac OS from Apple UNIX / LINUX 3

Multitasking & Multi-user OS. Unix has user interfaces called Shells (Terminals) that is more controlled, more flexible and powerful than the standard operating system text-based interface. Main purpose is to make it easier for the user to manipulate the functions of the operating system 4

Unix is more flexible and can be installed on many different types of machines, main-frame computers, Supercomputers micro-computers. Unix is more stable, which means, does not go down as often as Windows, so, Needs less administration and maintenance. Unix has comparably greater built-in security and permissions features. Unix possesses much greater processing power. 5

Unix is the leader in serving the Web. About 90% of the Internet relies on Unix operating systems running Apache, most widely used Web server. Mostly free or inexpensive open-source operating systems. Unix also inspires novel approaches to software design, such as, solving problems by interconnecting simpler tools instead of creating large monolithic application programs. 6

Need to Remember One single type of Operating System (OS) can not provide universal answers to all your computing needs. 7

Developed in 1969 by a group of AT&T employees at Bell Labs. The Unix operating system was first developed in Assembly Language. By 1973 had been almost entirely recoded in C. Today's Unix systems are split into various branches, developed over time by AT&T as well as various commercial vendors and non-profit organizations. As of 2007, the owner of the trademark is The Open Group, an industry standards consortium. Only systems fully compliant with and certified according to the Single UNIX Specification are qualified to use the trademark; others are called, "Unix system-like" or "Unix-like“ Ex: MINIX, Linux, and BSD. 8

Outlined by The Open Group, a consortium that holds the UNIX trademark. Only system that complies with the specification can use the trademark. Those that not complies are classified as UNIX-like. Registered UNIX products - Digital ® UNIX, Hewlett Packard HP-UX ®, IBM AIX ®, SCO UnixWare ®, SGI IRIX ®, Sun Solaris ® Linux is a product that mimics the form and function of a UNIX system, but is not derived from original UNIX licensed source code and is classified as UNIX- like. 9

o Kernel Master control of all computer operations. Controls access to files, Allocates resources, Controls input/output (I/O), Manages memory. o Shell Command interpreter: transfers information between user and the Kernel Common shells: “C” shell, Bourne Shell, Korn Shell. Shell uses prompt (% or $) to indicate readiness to accept next command. 10 Shell Kernel Applications

commands SHELL OR TERMINAL 11 Shell or Terminal

Everything in UNIX is either a file or a process. A process is an executing program identified by a unique Process Identifier (PID). A file is a collection of data. They are created by users using text editors, running compilers etc. Examples of files: a document (report, essay etc.) the text of a program written in some high-level programming language instructions comprehensible directly to the machine and incomprehensible to a casual user, for example, a collection of binary digits (an executable or binary file); a directory (or folder in Windows), containing information about its contents, which may be a mixture of other directories (subdirectories) and ordinary files. 12

Unix file-store is divided into a tree of directories and sub-directories. At the very top-level (or bottom level depending on how you look at it) is the root directory, represented by the ‘/’ character. Users can sub-divide their own directory into a number of sub-directories, so that they may group their files according to the different areas of their work. Pathname: “directions” to a file through directories and subdirectories 13

Below are a number of system directories (such as /bin, /lib, /dev) together with the directories for user files. 14

Main login directory (the home directory) for the user Fred who has been allocated to the u1 directory would be /u1/fred. The full filename or pathname for Fred's file results1 in the subdirectory plants would be /u1/Fred/plants/results1. If user Fred is working in the default, home directory, then only plants/results1 need be used to refer to the file. 15

Absolute: Every file has 1 and only 1 absolute address. Usually starts with a “/” as first character. Starts at root directory and moves through directories/subdirectories to file. Can use “~” to start the path at the user level. Relative: Describe path to file from current working directory. Relative addresses are not unique. Do not need to begin with a “/”. 16

Single dot (.) used to signify current working directory. Double dot (..) used to describe parent (1 step up) directory. Relative address starts at current level and moves through subdirectories. Each step (directory/subdirectory) is separated by a “/”. 17

Up to 256 characters in length. Can start with/be all numbers. Can use: period (.) underscore (_) dash (-) comma (,) Case sensitive (PC usually not). Do not include spaces in file name. 18

Characters that can be used to match a number of different character combinations are called WILD CHARACTERS. ( ? ) - represents 1 character ex.: Lab?.c could describe Lab3.c, Lab8.c, LabK.c (*) - represents more than 1 character ex.: Lab*.c could describe Lab223.c, LabA1155.c 19

Relative Address:“.” = current directory “..” = dir. 1 step up “/” = separates steps 20 Examples

Absolute Address of file ex7.c /home/lookout/a/fred/c/hmwks/ex7.c Using “~” shortcut to “users” level: ~/c/hmwks/ex7.c 21 Examples (Con.)

If working dir. is fred, relative address of ex7.c is c/hmwks/ex7.c 22 Examples (Con.)

Relative Address of fred to file “data”:../../../boreas/b/eric/chm/lab1/data 23 Examples (Con.)

Files are grouped in the directory structure. The file-system is arranged like hierarchical tree (inverted) structure. The top of the tree is called “root” which usually contains several sub-directories. In UNIX “/” (forward slash) is used to present the “root”. 24

Home directory might contain a public_html directory. public_html directory might contain an “index.html” file. public_html home_directory index.html 25

A file cannot hold a directory or a file! public_html home_directory index.html New_file_or_directory 26

Directories can hold files and other directories / binetc users tmp backup user1 user2 … usern public_html file1 index.html 27

Absolute Pathnames In the previous tree /users/usern/file1 is an absolute pathname. Relative pathnames If you are already in the users directory, the relative pathname for file1 is usern/file1.

What is the absolute path to index.html? / binetc users tmp backup user1 user2 … usern public_html file1 index.html Answer: /users/usern/public_html/index.html 29

What is the relative path to index.html (assuming that usern is your working directory) / binetc users tmp backup user1 user2 … usern public_html file1 index.html Answer: public_html/index.html 30

ls [names] – list files contained in a directory name or that match a file name. If no name is given list those files in current directory. ls –a list all files including hidden files ls –l list in long format (including details like permissions, owner, size, etc.), works very much like dir ls –al list all files (including hidden files) in long format ls –dl dir_name lists information about the directory, “dir_name”. 31

pwd –let you know the absolute pathname of your current working directory (Print Working Directory) cd [dir] – change directory cd.. –go back to parent directory. “..” is the relative pathname to the parent directory. “.” stands for current (working) directory. “~” – the tilde character can refer to your home directory. 32

mkdir directories – create one or more directories. You can specify them by absolute or relative pathnames. cp cp file1 file2 – copy file1 to file2. If there’s already a file2, the old one will be overwritten. cp file(s) directory – file(s) will be copied to the directory. 33

mv sourcefile targetfile – basically mv renames sourcefile to targetfile. If there’s a file with the same name as targetfile, it will be overwritten. mv works for directories in a similar fashion. 34

rm file(s) – delete file(s). rmdir directories – delete one or more empty directories. rm –r directories – can be used to delete non empty directories. WARNING!!! This will DELETE EVERYTHING in that directory!!! You can not recover your files after you removed them (unlike Windows OS). 35

There are three types of file access supported by UNIX. r – read, view the contents of a file or a directory w –write, edit file/directory contents x –execute, run executable file 36

User – the person who created the file. Group – the group owns the file. Other – the rest of the world. “754” is a decimal number. But you can represent each digit with a binary number. 4 => r ead permission, 2 => w rite permission, 1 => e x ecute permission 37

rwx r-x r USER ACCESSGROUP ACCESSOTHER’S ACCESS 38 read=4; write= 2; execute=1, ‘-’ = 0

{rwx r-x r--} is a symbolic way to specify file modes, while {754} is a numeric way. 7  111, 5  101, 4  100. How to represent file mode numerically? --x --x –wx How to represent bit string symbolically? Change it to binary numbers rw- --x r--

chmod mode file(s) – another UNIX command! Change the access mode of one or more files. Examples: chmod 751 my_file – the owner of my_file has rwx(7) permission, the group has r-x(5) permission, others have --x permission. What the following command will do? chmod u=rwx,g=r,o=wr my_file Set Permisson as: Owner to have ‘rwx’ Group to have ‘r’ Other to have ‘rw ‘ Answer: chmod 746 my_file 40

Create a new directory in your grove account named public_html by using the following command, $ mkdir public_html Go to this directory $ cd public_html Create a new file named $ cat >index.html -- create a file This is an html file.-- content of the file ^D -- closing the file 41

Viewing the content of the file $ cat index.html This is an html file. Adding content of the file $ cat >>index.html Adding second line to the html file. ^D Viewing the content of the file $ cat index.html This is an html file. Adding second line to the html file. 42

OR Use pico to create a new file named index.htm Note: Pico is a simple, display-oriented text editor for UNIX. 43

After you save the file index.html, change the mode of this file by using the following command, chmod 644 index.html (u=rw-, g=r--, o=r--) Check whether you did it right ls –l or dir (What result should be displayed?) -rwx r-x r-- 1 hans doc 858 Aug 22 22:28 index Unix file types, permissions, number of hard links, owner, group, size, date, filename 44

Then go back to parent directory cd.. Change the mode of public_html directory chmod 755 public_html ( What’s the meaning of this command?) Ans: u=rwx, g= r-x, o=r-x Check if you got the mode set right ls –dl public_html 45

Some short cuts for the pico editor ^G Get Help ^O WriteOut ^R Read File ^Y Prev Pg ^K Cut Text ^C Cur Pos ^X Exit ^J Justify ^W Where is ^V Next Pg ^U UnCut Text ^T To Spell 46

47 Clear screen: $ ^L For Help:$ help To exit/close:$ exit Help on command:$ command_name --help

Listing files and directories Making Directories Changing to a different directory The directories. and.. Pathnames home directories 48

Copying Files Moving Files Removing Files and directories Displaying the contents of a file on the screen Searching the contents of a file 49

Wildcards Filename Conventions Getting Help 50

File system security (access rights) Changing access rights Processes and Jobs Listing suspended and background processes Killing a process 51

52