CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.

Slides:



Advertisements
Similar presentations
POS/420 Philip Robbins – March 19, 2013 (Week 2) University of Phoenix Mililani Campus Introduction to Unix.
Advertisements

Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
CS 497C – Introduction to UNIX Lecture 11: - The File System Chin-Chih Chang
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.
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.
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
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.
GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
Linux Linux File System.
The UNIX File System.
UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat.
Guide To UNIX Using Linux Third Edition
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.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
Linux Shell. 2 Linux Command-Line Interface ■ Linux shells: A shell is a command interpreter that allows you to type commands from the keyboard to interact.
1. This presentation covers :  User Interface Administration  Files System and Services Management 2.
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.
Command Line Interface (CLI) CSCI N321 – System and Network Administration Copyright © 2000, 2011 by Scott Orr and the Trustees of Indiana University.
Guide To UNIX Using Linux Fourth Edition
Introduction to Linux Operating System Tutorial 1
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
The file structure and related utilities CS240 Computer Science II.
Manage Directories and Files in Linux
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.
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.
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
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.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
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:
Manage Directories and Files in Linux. 2 Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change.
Chapter Two Exploring the UNIX File System and File Security.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
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:
Introduction to Programming Using C An Introduction to Operating Systems.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
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.
BIF713 File and Directory Management. File System A File System is a structure used to organize programs and data on a computer ’ s storage device Files.
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
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.
Introduction to UNIX and Linux.  Written by Dennis Ritchie and Ken Thomsom at Bell Labs in 1969  Initially written in assembly language and a high-level.
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.
LINUX Zhengli Zhu, School of Life Sciences. Outline 1. ABC of Linux 2. Basic orers of Linux 3. Bash Programming.
Linux Administration – Finding You Way on the Command Line The Linux File Directory or Tree.
BILKENT UNIVERSITY DEPARTMENT OF COMPUTER TECHNOLOGY AND INFORMATION SYSTEMS CTIS156 INFORMATION TECHNOLOGIES II FILES AND FILE SYSTEM STRUCTURE.
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.
Linux 101 Training Module Linux Basics.
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Linux file system "On a UNIX system, everything is a file;
C151 Multi-User Operating Systems
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Exploring the UNIX File System and File Security
Unix : Introduction and Commands
Tutorial of Unix Command & shell scriptS 5027
Welcome to Linux Chap#1.
January 26th, 2004 Class Meeting 2
Presentation transcript:

CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles

Where to Start Available UNIX: mars, neptune, juniper, …in CSULA campus You have to have an account first through submitting an application (Library). Login name + Password Use telnet to login. There are several different kind of telnet. You also can install Linux at home (if dual boot, windows first).

Telnet C>telnet mars.calstatela.edu C>telnet neptune.calstatela.edu, … Start  Run  telnet mars.calstatela.edu Program  SSH Secure Shell  Secure Shell Client. MochaSoft Telnet ………..

The Shell Shells provide the command line interface to UNIX (there are other types of interface) Why learn the command line? The GUI isn't always available The command line is often more efficient The command line is often more powerful You must become familiar with using the command line

Introduction to UNIX Commands Command line format is command_name [ -switches ] [ parameter1 ] [ parameter2..] There must be whitespace between each of these components command_name the name of command to be executed (will match an executable file somewhere) switches switches or options are used to modify the operation of a command. parameter1 a list of parameters/arguments which will be passed to the command

Introduction to UNIX Commands Examples include ls ls -l ls -l /etc /home ls -ld /etc /home

The File Hierarchy UNIX uses an upside down tree of directories for file storage. For the Windows users: Files are documents, Directories are Folders

The File Hierarchy A file is a container for data, be it an image, text, a word processor file. A directory is a collection of files. To UNIX a directory is just a file that contains pointers to files. We will use file/directory interchangably Each user has a home directory in which they can do what they want.

Paths Paths or path names are specifications of where to find a file/directory. There are two types of paths absolute (full) The path to the file is fully specified /home/….. relative The path to the directory is relative to the current directory (The pwd command will tell you the current directory)../…

Paths Directory and filenames are separated by / (can't be used in filenames) Every directory contains at least two directories. the current directory.. the parent directory Try ls -al in any directory. Example neptune> ls -al total 1848 drwx--S jguo 1024 Apr 23 12:02. drwxr-sr-x 227 root 4096 Apr 7 10:26.. -rw jguo 500 Dec 16 22:05.Xauthority -rw jguo 221 Apr 17 12:29.bash_history -rw jguo 2205 Nov cshrc

Important Directories /bin binaries required when in single user mode /bin /dev device files /dev /etc System configuration files and scripts /etc /home User home directories /home /lib Main OS shared libraries and kernel modules /lib /sbin System administration binaries and tools /sbin /tmp Storage of temporary files /tmp /usr Contains almost everything else including libraries, binaries, applications and packages /usr /var Variable data, usually machine specific. Including spool directories for mail and news. Also system logs and messages. /var

Moving around the file hierarchy cd command is used to change directories Examples  cd Return to the home directory of the user. Can also use ~ as your home directory (at least in bash)  cd / Return to the root directory.  cd.. Change to the parent directory.  cd. Change to the current directory.  cd../../../bin Move to the bin directory which is up three directories

Commands are programs UNIX commands are actually executable programs stored on the disk. This means you can write commands too! The shell reads the command line you typed extracts out the name of the command looks for a file with a matching filename creates a new process using the code in that file Common commands are stored in the bin directories: /bin /usr/bin /usr/local/bin /usr/X11R6/bin /sbin /usr/sbin There are around hundreds commands. If you see the error message dir: command not found This means that the shell was unable to find the executable file with a name which matches the name of the command.

Help We can't show you how to use all hundreds commands. However, most of these commands have online documentation in the form of manual pages. Manual (man) pages are a reference to individual commands. They can be difficult to read (take your time). As with any manual, the manual pages are divided into sections

Help Manual Section Description 1 User commands 2 System calls 3 Library functions 4 Special files 5 File formats 6 Games

What are the man pages They are text files written using a special format. (one file for each man page)text files Stored in subdirectories of the man directories (/usr/man /usr/local/man) Written by people to provide assistance with commands Displayed using the man command Examples man ls man convert man man

Some Commands date Display the current time and date who display who is currently on the computer gcc/g++ C++/C compilers cal display a calendar wc count the number of characters, words and lines cat display the contents of a file more and less display the contents of a file a page at a time

Some Commands rm Remove a file cp Make a copy of a file mv Move a file or change the name of a file file Display the information of a file grep Search for a specific string in a file whereis Display the path of a utility program Which Display the path of a command finger Display detail information about users echo Display a line of text on the terminal Mail Send and receive s write, talk, mesg Communicate each other

vi vi is an editor. It is the editor I strongly suggest you start using since you will be a professional software engineer. Why? it's always available on UNIX it makes you look like professional it is hugely powerful

Introduction to vi vi is a modal editor (two mode) command mode The initial mode where most of the keys perform vi commands insert mode The mode where what you type is inserted into your document command line mode Transitions command mode to insert mode Several commands/keys put you into insert mode i a I A o O insert mode to command mode Hit the escape key

vi Commands 23x Delete 23 characters 25dd Delete 25 lines d$ Delete from current position to the end of the line

vi Command Line Commands :wq Write any changes and quit :q Quit (will only do so if no changes) :q! Quit without saving changes

PICO pico is a full screen editor. It is easy to learn and easy to use.