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

Similar documents
Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Chapter-3. Introduction to Unix: Fundamental Commands

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

Std: XI CHAPTER-3 LINUX

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

Unix Introduction to UNIX

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)

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

Introduction to Linux. Fundamentals of Computer Science

Unix System Architecture, File System, and Shell Commands

Introduction to Unix: Fundamental Commands

Introduction to Linux

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Perl and R Scripting for Biologists

Introduction to the UNIX command line

Introduction of Linux

Using the Zoo Workstations

Physics REU Unix Tutorial

Introduction to Linux

Introduction to Linux

The UNIX Operating System. HORT Lecture 2 Instructor: Kranthi Varala

INTRODUCTION TO LINUX

Linux Systems Administration Getting Started with Linux

Introduction: What is Unix?

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

FILE MAINTENANCE COMMANDS

CSCI 2132 Software Development. Lecture 4: Files and Directories

Examples: Directory pathname: File pathname: /home/username/ics124/assignments/ /home/username/ops224/assignments/assn1.txt

Commands are in black

commandname flags arguments

CS/CIS 249 SP18 - Intro to Information Security

Overview of the UNIX File System

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Outline. Structure of a UNIX command

Essential Unix (and Linux) for the Oracle DBA. Revision no.: PPT/2K403/02

Session 1: Accessing MUGrid and Command Line Basics

Chapter 6. Linux File System

Getting Started with UNIX

Mills HPC Tutorial Series. Linux Basics I

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

Presented by Bill Genske Gary Jackson

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

Introduction to remote command line Linux. Research Computing Team University of Birmingham

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]

Overview of the UNIX File System. Navigating and Viewing Directories

Files and Directories

Essential Unix and Linux! Perl for Bioinformatics, ! F. Pineda

Introduction. SSH Secure Shell Client 1

Basic Survival UNIX.

A Brief Introduction to Unix

System Administration for Beginners

You will automatically be in your user (home) directory when you login.

Working With Unix. Scott A. Handley* September 15, *Adapted from UNIX introduction material created by Dr. Julian Catchen

Unix Handouts. Shantanu N Kulkarni

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

Operating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm

Introduction to Linux Environment. Yun-Wen Chen

UNLV Computer Science Department CS 135 Lab Manual

INTRODUCTION TO BIOINFORMATICS

CS4350 Unix Programming. Outline

Getting Started With UNIX Lab Exercises

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

Linux & Shell Programming 2014

Helpful Tips for Labs. CS140, Spring 2015

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Oxford University Computing Services. Getting Started with Unix

Week 2 Lecture 3. Unix

Introduction to Linux

Course 144 Supplementary Materials. UNIX Fundamentals

Due: February 26, 2014, 7.30 PM

Tutorial 1: Unix Basics

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

EECS2301. Lab 1 Winter 2016

Editors in Unix come in two general flavours:

Manage Directories and Files in Linux. Objectives. Understand the Filesystem Hierarchy Standard (FHS)

Unix Workshop Aug 2014

Introduction to Linux

Files

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you.

Basic File Attributes

Lab 3a Using the vi editor

CHE3935. Lecture 1. Introduction to Linux

Linux Shell Script. J. K. Mandal

CSE 391 Lecture 1. introduction to Linux/Unix environment

Part I. Introduction to Linux

Connecting to ICS Server, Shell, Vim CS238P Operating Systems fall 18

Basic UNIX Commands BASIC UNIX COMMANDS. 1. cat command. This command is used to create a file in unix. Syntax: $ cat filename

UNIX File Hierarchy: Structure and Commands

CMSC 201 Spring 2017 Lab 01 Hello World

Short Read Sequencing Analysis Workshop

(a) About Unix. History

Crash Course in Unix. For more info check out the Unix man pages -orhttp:// -or- Unix in a Nutshell (an O Reilly book).

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

Transcription:

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 the actual m/c h/w & interacts with h/w. The kernel program is usually stored in a file called Unix that handle all application & commands in Unix. There may be many shells running

But there will be only 1 kernel. The kernel is the lowest layer of Unix which allows processes to access the h/w in an orderly manner. Basically the kernel control processes, input/output processes, file system operations. The kernel allows the system to run in multiuser, multitasking mode.

The kernel also manages the memory i.e. a key element of the system. The system must provide all processes with an access of adequate amount of memory and some processes require a lot of it. The kernel also works as a device manager.

2. Shell : It acts as an interface b/w user & kernel. When a user logs in, the login program checks the username & password & then starts another program called shell. The shell is a command line interpreter that interprets the command submitted by user. The shell keeps a list of the commands you have typed in.if you need to repeat a

Command, use the cursor keys to scroll up and down the list or type history for a list of previous commands. Three major shells are :- (a) the Bourne shell (b) the C shell (c) the Korn shell

3. System Utilities: They are designed to be powerful tools that do a single task extremely well. Unix systems utilities also include server programs called daemons which provide remote n/w and administration services. E.g. remote login, printing

4. Application Program : Unix operating system has more than thousand Unix based application programs like dbms, word processors, accounting s/w etc.

File system :- File system is an important part of an O.S. all files systems consist of structures necessary for storing and managing the data. These structures typically include directories, files. In UNIX, everything is a file, directories, images, text, device drivers, services, etc are all files.

Root(/) bin de v etc home lib sbin stand tmp usr var cat date who dsk rds k kumar sharma unix bin include sbin f0q18dt Login.sq l progs safe

Unix makes no difference b/w file and directory Files :- 1. Directory :- These in Unix are known as directory files. A directory is just a file containing names of other files. 2. Ordinary files :- these in Unix are text files, program files & executable programs. Executable programs are

Also files that are commands. When a user enters a command the corresponding file is executed. 3. Special File :- these are known as device files. In Unix device files are used to access all physical devices & to communicate with the h/w.

Unix file system is organized as a tree with a single node i.e. called root ( / ). The name of a file is given by a path name that describes how to locate a file in the hierarchy. A full path name starts with a / and specifies a file that can be found starting from root.

Directory structure

Unix provides a hierarchical directory structure in which directories are central to the use of unix sys. Unix treats everything as a files. Even a dir is treated as file which contains several other files.

Created by administrator when he creates a/c for diff users. Each user is allowed to work with his directory called home directory within user dir.

1) Root:-the dir at the top most position is called root. It is the source from where all other directories emerges. 2) bin:- it contains executable files for most of the unix cmds. 3) lib:- it contains all the library fn s

4. dev:- it contains files that control various input/output devices like terminal printer, disk drives etc. For each device there is a separate file. 5. user:- in user there are several directories each associated with a particular user. These directories are

6. Tmp:- it contains the temporary files created by unix/users. These files get automatically deleted when the system is shutdown and restarted.

Command Execution

A command is a program that instructs Unix system to perform some task. A UNIX command is composed of a command name, option, arguments. The UNIX cmds is represented in the following format :- $command [option][arguement]

1. Command :- it is always listed at the beginning of the command line. These are case sensitive e.g. COMMAND & command are not the same. 2. argument :- cmd performs its action on argument. Argument can be file name, directory name. They are

Listed at the last. 3. option :- it modifies the command. An option may give additional information or it may change the way in which additional information is displayed. Options are generally preceded by hyphen(-), more then 1

Option can be listed as follows :- $ command *option1+*option2+

Logging into the system :- Unix is a security conscious & can be listed only by those persons who maintain an account with the PC. Because the system can be used by many users. Someone has to be given charge of administration of the system

This person is known as system administration. System administration will grant you the authority to use the system. He opens an account with a name for your use & gives you a secret code. If UNIX is running on the desktop then that person will

Be the administrator of that m/c. Login :- in order to login you must have an a/c on system you are accessing. Suppose you have a name Sahil for a/c. Type your username & press enter key.

Login : Sahil [Enter] password : Now after pressing [enter] key the system asks you for password. Password :- now type the password/secret code

Login : Sahil password : *****[Enter] if entry not displayed then the code/username would be wrong and an error msg would appear on screen. Login incorrect login :

If both username & password are correct then you would see a prompt $. Changing the password :- to change the current password the command used will be $ password

System will prompt you to enter you old password & displays. Old password : by entering old password press enter key system will display. New password : enter new pw & then press

enter key. To avoid any kind of error the system will prompt you to re-enter new password & the system displays. Re-enter new password : enter new p.w. & then press enter key.

Logging out the system :- if the user wants to quit his/her a/c type the command. After typing exit Press enter key or press cntrl - d command to log out your a/c

Init 0 to shutdown the system init 6 to reboot the system. The super User :- the super user is also known as the system administration who has all the permissions and will grant user to access the system.

Super user s login is root and is provided with a password called root which is defined during the installation of UNIX. You can log in as an administrator by using the username root & passwrd root. You can also log in as administrator while

working in the user mode by using. SU (switch user utility) $ SU password ****** #

Root a/c displays a difference prompt i.e. #. To return to the user a/c, simply type exit at the shell prompt. All the files are present in the directory /dev which are used to display o/p.

To find the name of terminal file command is used is $tty /dev/tty01

1. Pwd(print working directory) Purpose:-it tells about the path of current working directory Syntax :- $pwd e.g. :- $pwd,it will display path like /ritu/bca (root)(subdirectory)

2. Mkdir (Make directory) Purpose :- It is used to create a new or subdirectory. A directory is created to store the files & subdirectories. We can create multiple directories with single command. Name of directory must be less then 14 characters. Syntax :- $mkdir directory name

3. cd(change directory) Purpose :- It changes the present working directory to the new directory. Syntax :- $cd path e.g.:- $pwd /ritu/bca $cd gg $pwd /ritu/bca/gg

4. mv(move) Purpose :- It is used to move / rename the directory from one directory to another. Syntax :- $mv source destination e.g. :- $mv ritu bca, if bca exists then ritu is shifted to bca. If bca doesn t exists then ritu is renamed as bca

5. Rmdir (Remove Directory) Purpose :- It is used to remove the directory. Syntax :- $rmdir [path] directory e.g. :- $rmdir usr/ritu/bca, it will remove the subdirectory bca if it is empty. Before deleting make sure it is an empty directory. If there are files existing in the directory then remove those files first.

Editor Commands

An editor is a program that allows you to edit the plain text files including.txt,.html. Vi is the basic text editor. To open a file in Vi Enter :- $vi filename filename is the name of the file which you want to edit. Vi program has 3 modes of operation.

1. Command Mode In this mode all the keys pressed by the user are interpretted to be editor commands. In this mode, any character you pass from the keyboard does not show on the screen but perform a function. When you start Vi it is in command mode.

2. Insert Mode This mode permits insertion of new text/replacement of existing text. Each of these operation can be performed after changing from command mode to insert mode. Press ESC to end insert mode & return to command mode. When you press I you will enter insert mode,write a line then press Enter.

To erase a word use[cntrl-w]. Backspace can be used to go back position. After inputting text you will have to save that text. By default that text is saved in temporary storage called Buffer. So to save the entered text you must switch to the Exmode (Last Line Mode)

3. Last Line Mode To enter this mode write(:) colon. The bottom line of the Vi screen is called the command line. Vi uses the command line to the display messages & commands. In this the user is permitted to give commands at the last line known as command line. After the command is run, you will enter the command mode by default.

Comman ds I a A c C o R Functions Inserts characters before the cursor Appends characters after the current character Appends characters at the end of the current line Changes the following text Changes the rest of the text on the line Inserts new line immediately before current line Replaces characters with characters until<esc> key is pressed Saving the text

Commands (left arrow) (right arrow) (up arrow) O Functions Moves the cursor to the beginning of current line Moves the cursor at the end of current line Moves the cursor to left character on same line Same as left arrow key $ Same as right arrow key H Moves cursor to top line of the screen Moving M Moves the cursor cursor to middle of the screen during b editing :- e Moves cursor to the beginning of the previous word Moves cursor to the end of the next word

Command y yy yn Function Cuts the characters at cursor position Cuts the current line Cuts the n number of characters from cursor position y$ Cuts from cursor position to end of line yw nyy Cuts the word at cursor position Cuts the n number of lines from current line Cutting the text :-