Introducing the UNIX Operating System.

Slides:



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

Chapter One The Essence of UNIX.
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.
Linux+ Guide to Linux Certification, Second Edition
Very Quick & Basic Unix Steven Newhouse Unix is user-friendly. It's just very selective about who its friends are.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
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.
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.
Introducing UNIX EMBnet slide 1 Introducing the UNIX Operating System.
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ı.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
Unix Basics Chapter 4.
Basic unix commands that everyone should know (Even if you have a mac) Slightly more advanced:
Basic Linux/UNIX Commands The symbol of Linux. Unix doesn’t really care where you log in from, though some system administrators might. Logging in Log.
Linux+ Guide to Linux Certification, Second Edition
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
Introduction to UNIX Geraint Vaughan. What is UNIX? Command-line operating system (not point- and click) Designed for ‘experts’ Lots of different variants.
Linux+ Guide to Linux Certification, Third Edition
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.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
Linux Commands C151 Multi-User Operating Systems.
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 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
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.
 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.
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).
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.
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 Basics Matt Hayward October 18, 2016 LS560 – Information Technology for information professionals.
By Jonathan Rinfret UNIX/LINUX By Jonathan Rinfret
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.
Prepared by: Eng. Maryam Adel Abdel-Hady
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Andy Wang Object Oriented Programming in C++ COP 3330
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
CSE 374 Programming Concepts & Tools
Introduction to UNIX.
Using Linux Commands Lab 3.
Exploring the UNIX File System and File Security
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
Operating Systems and Using Linux
Module 6 Working with Files and Directories
Lab 2: Terminal Basics.
January 26th, 2004 Class Meeting 2
Presentation transcript:

Introducing the UNIX Operating System

What is UNIX? • A family of operating systems • Multitasking IRIX SOLARIS AIX LINUX Digital UNIX MacOSX ... • Multiuser Runs more than one program at the same time. A busy system can be running several hundred or even thousands of programs at the same time. • Networked Many different people can use the system at the same time. It is designed to be linked to other computers and to allow people to work over a network. The network IS the computer.

X What does UNIX do? UNIX Kernel users User Interaction • Many different users, typically accessing the system from remote machines in different ways The Shell (or command line) • Allows the user to interact directly with the computer by typing commands. • The shell interprets these and instructs the kernel accordingly. • Very powerful but can be intimidating • Controls access to the hardware. • Prevents programs interfering with each other. • Provides an easy way for programmers to talk to the electronics. • Controls data storage and protection. Pointy, clicky program. • Any number of users can use any number of programs and methods to access the system from any number of remote machines at the same time. Disk storage Memory Network adapter Modem Screen Keyboard The X Window System • Graphical interface (point, click, drag, drop etc.) • Network enabled • Can use many programs at once • Is a separate program • Easier to use than the shell but less powerful Console programs • Run from the shell • Use one program actively at a time unix> help X Press ENTER to continue: Xprog X · UNIX Kernel The Computer

Logging in Unix doesn’t really care where you log in from, though some system administrators might. You must have a username (login id) to use a unix system Log in from anywhere you have permission Have graphical output sent anywhere you have permission Every user is a member of one or more groups of users. This identifies you to the system so it can manage your work properly. This helps the system manage different types of user properly.

Logging in Connect to the unix machine using a suitable program on your local machine. Connecting to embnet.org Connected. Welcome to the European Molecular Biology Network. Login: Telnet Xterm Secure Shell Kermit Other terminal emulators You may get some messages here from the system administrator. username Password: unix doesn’t show anything on the screen as you type your password. unix is case sensitive. username is not the same as Username or USERNAME The system will be unavailable on friday afternoon for maintenance. You have new mail. username@embnet ~>

The shell or command line Several different shells but they behave more or less the same 1. The Prompt. username@embnet ~> your present location your username the machine you are logged in to The prompt can be customised to look how you wish

The shell or command line 2. Commands username@embnet ~> ls -ald *.txt The subsequent words form a list of arguments to the command ls -ald *.txt * is a special character. It means ‘any group of characters’ (including none). The shell finds all the filenames that match anything.txt and adds them to the list of arguments The first word is a command ls -ald *.txt arguments beginning with - are options ls -ald *.txt ls -ald *.txt The shell breaks the command up into individual words By default the boundary between words is a space. To get the shell to treat a phrase that includes spaces as a single word, put it in quotes like this: 'my word' or "my word". Options control how the program runs. '-a -l -d' is equivalent to '-ald'

More Special Characters Any group of characters including none. Any single character. word delineation * ? " ' Cause the process to run in the background Pipe. Pass the output of the command on the left as the input to the command on the right. Redirect the commands output, eg. to a file Redirect a commands input. eg. from a file instead of the keyboard. & | > < Backticks (not '). Take the output of the command as an argument String or Dollar Treat the next word as a variable and write out its value Backslash. Change the meaning of the next character. Semicolon Seperate commands typed in together. `` $ \ ; Some special characters can lose their special meaning if they are inside quotes.

Organisation "Everything is a file" • An ordinary file contains data. • A directory contains other files. • A link is a file that is a shortcut to another file. The data could be an image, a document, a set of instructions (a program) or any fixed information. • There are many other types of file . This is also known as a folder on some systems. A directory can contain other directories (which are then known as sub-directories.) Files can have more than one name, and be in different directories at the same time You don't need to worry about these. You probably won't come across one in normal use of the system.

Organisation of the file system /home/username/prot / / bin etc /home/username/prot home usr home The top of the file system is the directory '/', commonly known as the root directory /home/username/prot username username Several subdirectories under the root directory /home/username/prot prot project seq2 seq1 seq3 seq4 letter prot Any file in the file system can be uniquely identified by describing the path to it from the root directory. An example users home directory with a subdirectory and several files Another subdirectory.

Organisation of the file system / bin usr etc home username project seq2 seq1 seq3 seq4 letter prot Organisation of the file system /home/username Any process is located somewhere in the filesystem The command 'pwd' will tell you where. username@embnet ~> pwd '~' is a unix shortcut meaning 'your home directory'

Looking at the file system / bin usr etc home username project seq2 seq1 seq3 seq4 letter prot Looking at the file system 'ls' lists the files in a directory or directories Without an argument, ls lists all the files that don't start with . in the current directory There are many options to ls that allow you to select and control the information it presents. username@embnet ~> username@embnet ~> ls ls project prot letter project project: seq1 seq2 seq3 seq4

Moving around the file system / bin usr etc home username project seq2 seq1 seq3 seq4 letter prot Moving around the file system /home/username '..' means the parent directory. '.' means the current directory. .. You can move to a different directory with the command 'cd directory ' /home/username/project /home/username/project 'directory' is the directory to which you want to move. The name can be written as the full path (from root) or as the relative path (from your current directory) username@embnet ~/project> username@embnet ~> repeat using the relative path username@embnet ~> username@embnet ~> cd /home/username/project cd project cd .. username@embnet ~/project> username@embnet ~> username@embnet ~/project> pwd pwd pwd

Changing the file system / bin usr etc home username project seq2 seq1 seq3 seq4 letter prot Changing the file system You can create a new subdirectory in the current directory with the command ' mkdir directory ' username@embnet ~> model username@embnet ~> mkdir model

Changing the file system / bin usr etc home username project seq2 seq1 seq3 seq4 letter prot Changing the file system You can delete an empty subdirectory with the command ' rmdir directory ' username@embnet ~> model username@embnet ~> model You can delete a file with the command ' rm file ' username@embnet ~> You can delete a subdirectory and its contents with the command ' rm -rf directory ' rmdir model rm prot

More about files: filenames Filenames can contain any normal text character including spaces and special characters. Filenames can be almost any length. It is best to stick to a-z, A-Z, _, -, and numbers. It is best to keep them short as it saves typing. If a filename contains a special character or a space you may need to put quotes around the whole path. Special characters in filenames can cause problems with some programs.

More about files: reading files You can print the contents of one or more files to the screen with the command: 'cat file1 file2 ...' You can view the contents of one or more files a page at a time on the screen with the command: ' more file1 file2 ...' cat prints the whole file at once, so a file longer than just a few lines will run off the top of your screen. You can print the first few lines of a file with the command: 'head file1 file2 ...' more will let you search through a file, go backwards and forwards and has many other functions. The last few lines can be viewed with 'tail'

More about files: editing files You can change the content of text files and create new files with a text editor. Text editors edit text. They do not try to format the text like word processors. PICO EMACS A novice friendly basic text editor used as standard on many systems. Start with the command 'pico filename' VI A powerful editing environment which can be programmed. It has many modes for auto layout of program code. Start with the command 'emacs filename' A powerful editor which can be somewhat confusing for newcomers. It is designed for rapid editing of text files and programming. Start with the command 'vi filename'

More about files: copying files You can copy a file with the command 'cp oldfilename newfilename' If newfilename is a directory, then the file will be copied to 'newfilename/oldfilename' username@embnet ~> ls letter project username@embnet ~> cp letter draft username@embnet ~> ls draft letter project username@embnet ~> Warning: If a file called newfilename already exists then it will be overwritten. The command 'mv oldfilename newfilename' can be used to rename a file

More about files: permissions • Every file is protected to a greater or lesser extent. • Permissions determine who can read, write, or execute a given file. World Group Owner The user who owns the file Other users in the same group as the user who owns the file. All the other users in the system. • Files can have read, write or execute permission for each of the three types of user.

More about files: permissions You can view the permissions for a file by listing it in long format with the command 'ls -l filename' username@embnet ~> ls -l letter Permissions for the owner -rwxr--r-- Permissions for everyone else -rwxr--r-- Permissions for the owners group -rwxr--r-- -rwxr--r-- 1 username users 6048 Aug 17 16:07 letter Aug 17 16:07 The date the file was last modified 6048 The files size username The user who owns the file users The files group The letter l letter The files name The file type: - - ordinary file d - directory l - link (shortcut)

More about files: permissions You can change the permissions for a file with the command 'chmod change filename' change is the modification you want to make to the files permissions username@embnet ~> ls -l letter -rwxr--r-- 1 username users 6048 Aug 17 16:07 letter username@embnet ~> chmod o-r letter Permissions being changed: r - read permission w - write permission x - execute (run) permission chmod o-r letter How you are changing permissions: - - remove these permissions + - add these permissions = - set permissions to this chmod o-r letter For whom you are changing permissions: o - other g - group u - user a - all chmod o-r letter username@embnet ~> ls -l letter -rwxr----- 1 username users 6048 Aug 17 16:07 letter username@embnet ~>

Getting help You can get help on a command by using the command ' man command' This will bring up the manual page and show it to you screen by screen If you do not know what a command is called, use the option '-k' to get a list of commands that may be relevant 'man -k word' This will find all manual pages containing word in the short description of the command. Try using the options '-h', '-help', or '--help' if you can't find the man page.

Useful literature 'Learning the UNIX operating system', O'Reilly press. 'UNIX Quickguide' EMBnet PDF-files provided during this course