CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux.

Slides:



Advertisements
Similar presentations
Linux Orientation Computer Systems Lab Computer Sciences Department Room 2350.
Advertisements

Pre-Assessment Questions
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -
Working with Files How to create, view, copy, rename and print files.
Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
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
UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat.
Unix Basics. Systems Programming: Unix Basics 2 Unix Basics  Unix directories  Important Unix file commands  File and Directory Access Rights through.
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.
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.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
Systems Programming Concepts
CMSC 104, L031 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
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.
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.
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.
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.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
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.
Chapter Two Exploring the UNIX File System and File Security.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Some content in this lecture added.
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.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Introduction to UNIX Geraint Vaughan. What is UNIX? Command-line operating system (not point- and click) Designed for ‘experts’ Lots of different variants.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Linux+ Guide to Linux Certification, Third Edition
Introduction to Programming Using C An Introduction to Operating Systems.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
CMSC 104, Section 301, Fall Lecture 04, 9/11/02 Operating Systems and Using Linux Review Operating System. Linux Overview. Frequently Used Linux.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
Unix Fundamentals CS 127. File navigation cd - change directory cd /var/log cd /etc/apache2 cd ~/Desktop ~ is a shortcut for the home directory.
Learning basic Unix command It 325 operating system.
Operating Systems and Using Linux Courtesy of John Y. Park 1.
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.
Agenda The Linux File System (chapter 4 in text) Directory Structures / Navigation Terminology File Naming Rules Relative vs Absolute pathnames Unix Commands:
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
Overview of Linux Fall 2016 Dr. Donghyun Kim
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:
Lecture 2 Working with Files and Directories
The Command Prompt Commands are the way to “do things” in Unix
Operating Systems and Using Linux
Intro to UNIX System and Homework 1
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Web Programming Essentials:
The Unix File System.
Operating Systems and Using Linux
Operating Systems and Using Linux
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
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.
Presentation transcript:

CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.

CMSC 104, Version 8/062L03OperatingSystems.ppt What is an Operating System (OS)? A computer program Performs many operations, such as: Allows you to communicate with the computer (tell it what to do) Controls access (login) to the computer Keeps track of all processes currently running At this point, your main concern is how to communicate with the computer using the OS

CMSC 104, Version 8/063L03OperatingSystems.ppt What Is A Process? A process is a task or program that you have requested the operating system do on your behalf. That process is given an identifying number, called a PID (process ID).

CMSC 104, Version 8/064L03OperatingSystems.ppt How Do I Communicate With the Computer Using the OS? You communicate using the operating system’s user interface. Graphical User Interface (GUI) – Microsoft Windows, Linux KDE Command-driven interface - DOS, UNIX, Linux, Microsoft Command Prompt We will be using the Linux operating system, which is very similar to UNIX.

CMSC 104, Version 8/065L03OperatingSystems.ppt How Do I Communicate With the Computer Using the OS? (con’t) When you log in to the Linux system here, a user prompt will be displayed: linux#[1]% _ where # is the number of the Linux server that you have connected to. You may use any of the Linux servers. The number in the brackets will change as you work. It is the “number” of the command that you are about to type. If this prompt is not on the screen at any time, you are not communicating with the OS.

CMSC 104, Version 8/066L03OperatingSystems.ppt User Prompt While the normal (or default) prompt is: linux#[1]% you can change this. To learn Linux well enough to do this, we recommend that you take CMSC121, a one credit course.

CMSC 104, Version 8/067L03OperatingSystems.ppt Linux Overview Files and Filenames Directories and Subdirectories Frequently Used Commands

CMSC 104, Version 8/068L03OperatingSystems.ppt Files A file is a sequence of bytes. It can be created by o a text editor (xemacs or pico) o a computer program (such as a C program) It may contain a program, data, a document, or other information. Files that contain other files are called directories (sometimes called folders).

CMSC 104, Version 8/069L03OperatingSystems.ppt Linux Filenames Restrictions o May not contain blanks or other reserved characters. o Have a maximum length (however, make your filenames long enough to be useful and short enough to type without making a mistake. o Are case sensitive. It is best to stick with filenames that contain letters (uppercase or lowercase), numbers, and the underscore ( _ ) for now. Filenames that start with a period are hidden files, so that when see the files in a directory, they don’t show up.

CMSC 104, Version 8/0610L03OperatingSystems.ppt Directories Directories contain files or other directories called subdirectories. They may also be empty. Directories are organized in a hierarchical fashion, or directories can contain other directories. They help us to keep our files organized.

CMSC 104, Version 8/0611L03OperatingSystems.ppt Directories (con’t) /afs/umbc.edu/users/j/d/jdoe28 junkrecipes notes piescookies CMSC104 apple peach choc_chip

CMSC 104, Version 8/0612L03OperatingSystems.ppt Directories (con’t) One example is to have a directory for CMSC104. Inside you could have a directory for each project, and whatever. Rule of Thumb: Never have more files in one directory than fits on the screen when you list them.

CMSC 104, Version 8/0613L03OperatingSystems.ppt Directories (con’t) Your home directory is where you are located when you log in (e.g., /afs/umbc.edu/users/j/d/jdoe28 ). The current directory is where you are located at any time while you are using the system. Files within the same directory must be given unique names. Paths allow us to give the same name to different files located in different directories. Each running program has a current directory and all filenames are implicitly assumed to start with the name of that directory unless they begin with a slash.

CMSC 104, Version 8/0614L03OperatingSystems.ppt Subdirectories Are used for organizing your files For example, o make a subdirectory for CMSC104 o make subdirectories for each project CMSC104 project1 project2... project8

CMSC 104, Version 8/0615L03OperatingSystems.ppt Moving in the Directory Tree. (dot) is the current directory... (dot-dot) is the parent directory. Use the Linux command cd to change directories. Use dot-dot to move up the tree. Use the directory name to move down. Use the complete directory name (path name) to move anywhere.

CMSC 104, Version 8/0616L03OperatingSystems.ppt Pathnames Pathnames that start at the beginning (and start with a /): /afs/umbc.edu/users/j/d/jdoe28 are called absolute pathnames. Pathnames can be shorted, so that if jdoe28 is the current directory and we have a file in that directory call schedule, we can edit it with just the filename (a relative pathname): pico schedule

CMSC 104, Version 8/0617L03OperatingSystems.ppt Permissions Files and directories have permissions. There are three sets of permissions for three groups: o Read, write, execute (or, if a directory, access) o User, group, other You are the user, and can set and change permissions.

CMSC 104, Version 8/0618L03OperatingSystems.ppt Frequently Used Linux Commands passwd, man, lpr pwd, ls, cat, more, cd, cp, mv, rm mkdir, rmdir ctrl-c, ctrl-z References: Linux man pages Links from the 104 homepage Books and the Internet

CMSC 104, Version 8/0619L03OperatingSystems.ppt Linux Command Format Fromat: cmd options arguments Options and arguments are optional. Options start with - or - - Options are different for each command. Arguments are different for each command. When in doubt, look up the command in the on-line help, man.

CMSC 104, Version 8/0620L03OperatingSystems.ppt man On-line help. Argument is the command you wish to have help for. Option –k is most common, which looks for a description that contains the argument. When the description of a command takes more than one screen to display, press the space bar for more information and q to quit.

CMSC 104, Version 8/0621L03OperatingSystems.ppt man (cont’d) Example: ~]$ man -k passwd htpasswd htpasswd (1) - Create and update user authentication files kpasswd kpasswd (1) - change a user's Kerberos password mkpasswd mkpasswd (1) - generate new password, optionally apply it to a user passwd.nntp passwd.nntp (5) - passwords for connecting to remote NNTP servers saslpasswd saslpasswd (8) - set a user's sasl password saslpasswd2 saslpasswd2 (8) - set a user's sasl password v5passwd v5passwd (1) - change a user's Kerberos password

CMSC 104, Version 8/0622L03OperatingSystems.ppt passwd Used to change your password. NAME passwd - update a user's authentication tokens(s) SYNOPSIS passwd [-k] [-l] [-u [-f]] [-d] [-n mindays] [-x maxdays] [-w warndays] [-i inactivedays] [- S] [username]

CMSC 104, Version 8/0623L03OperatingSystems.ppt lpr Used to print something on the printer. You must pay per page. Pick up your print-out at ECS-019.

CMSC 104, Version 8/0624L03OperatingSystems.ppt cd Change directory. With no argument, it will take you back to your home directory. With a argument, it will set that directory to be your current working directory, assuming you have permission to access the directory.

CMSC 104, Version 8/0625L03OperatingSystems.ppt pwd Print the current working directory. Helpful when you forget where you are. Has no options or arguments.

CMSC 104, Version 8/0626L03OperatingSystems.ppt ls Lists the names of files in a directory. Arguments are name(s) of file(s) and/or director(ies). Normally, when you specify a directory, you get the contents of the directory.

CMSC 104, Version 8/0627L03OperatingSystems.ppt ls Options -aall (including hidden files) -djust show the directory, not the files in the directory -Fclassify files as ordinary, directory (/), or executable (*) --color classify with color -llong format -rshow in reverse order -Rrecursive, show the contents of all subdirectories.

CMSC 104, Version 8/0628L03OperatingSystems.ppt cat Used to display the contents of a file. If there is too much to fit on the screen, the first part scrolls off and leaves only the last screenful. Argument is the name of a file or files. Useful option is –n (or –number) to show the line numbers.

CMSC 104, Version 8/0629L03OperatingSystems.ppt more More shows a screen full of a file at a time. SYNOPSIS more [-dlfpcsu] [-num] [+/ pattern] [+ linenum] [file] DESCRIPTION More is a filter for paging through text one screenful at a time. This version is especially primitve. Users should realize that less(1) provides more(1) emulation and extensive enhancements. Less is a similar command with more features.

CMSC 104, Version 8/0630L03OperatingSystems.ppt cp This allows you to create a new copy of an existing file. Two mandatory arguments, source and destination. o Source is the name of the existing file. o Destination is the name for new file. If you change the contents of the new file, you do not change the contents of the old file.

CMSC 104, Version 8/0631L03OperatingSystems.ppt ln Allows you to create two names for one file by “linking” them, similar to a shortcut in Microsoft Windows. Two mandatory options are the source and destination, just like for cp. If you change the new version, you change the old version.

CMSC 104, Version 8/0632L03OperatingSystems.ppt mv This allows you to rename a file and/or move it to a new location. Two mandatory arguments, source and destination. o Source is the name of the existing file. o Destination is the new name and/or location for the existing file. At completion, there is only one file.

CMSC 104, Version 8/0633L03OperatingSystems.ppt rm Allows you to remove or delete a file. Normally, once a file is removed, it is gone forever! (UMBC has changed this and it moves the file to a backup directory, where you can recover it, if necessary. However, this is not a long-term option!)

CMSC 104, Version 8/0634L03OperatingSystems.ppt rm (cont’d) The argument(s) are a list of files to remove. Options include: o -iinteractive, ask first (UMBC has set this as the default) o -rrecursive, delete the files in the subdirectories and the subdirectories. NOTE: rm –r directory will remove directories that are not empty!

CMSC 104, Version 8/0635L03OperatingSystems.ppt mkdir Used to create a new directory. Argument(s) is/are the name(s) of the new directory(ies).

CMSC 104, Version 8/0636L03OperatingSystems.ppt Wildcard Characters You will find wildcard characters useful when manipulating files (e.g., listing or moving them). The wildcard characters are * and ? ? is used to represent any single character. * is used to represent 0 or more characters.