UNIX Basics Internet Technology.

Slides:



Advertisements
Similar presentations
Exploring the UNIX File System and File Security
Advertisements

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
Guide To UNIX Using Linux Third Edition
UNIX Files and Security Software Tools. Slide 2 File Systems l What is a file system? A means of organizing information on the computer. A file system.
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.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Learning basic Unix command IT 325 operating system.
Guide To UNIX Using Linux Fourth Edition
File Systems Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
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.
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.
Unix Basics Chapter 4.
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.
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.
Chapter Two Exploring the UNIX File System and File Security.
November 5, 2015CIS 118 Intro to UNIX What’s a Unix? Unix is an Operating System Designed for high-traffic usage Many variants –Linux, BSD: free versions.
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:
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Λειτουργικά Συστήματα – 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.
File Systems, telnet and ftp Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
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.
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
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).
Chapter 2: Exploring the UNIX File System (For Tuesday Section) File and File Systems.
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.
Using UNIX Charles Duan FAS Computer Services June 12, 2016.
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
Linux Filesystem Management
Agenda The Linux File System (chapter 4 in text)
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.
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
Some Linux Commands.
C151 Multi-User Operating Systems
The Command Prompt Commands are the way to “do things” in Unix
Tools of Web Development 1: Module C: Using Unix
BIF703 File Permissions.
Using Linux Commands Lab 3.
Operating Systems and Using Linux
Operating Systems and Using Linux
Lecture #3 Modern OS characteristics
Exploring the UNIX File System and File Security
Operating Systems and Using Linux
Unix : Introduction and Commands
Operating Systems and Using Linux
Operating Systems and Using Linux
Web Programming Essentials:
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.
Chapter 4: The Linux Filesystem
January 26th, 2004 Class Meeting 2
Presentation transcript:

UNIX Basics Internet Technology

What is UNIX? Operating System Characteristics Types (flavors) of Unix An operating system (OS) is software that enable the computer to function Developed in 1960’s at Bell Laboratories OS for servers Fundamental building block of the Internet Characteristics Multi-user, multi-tasking Powerful & efficient Reliable & robust First “open” system Freeware → created to develop as a public collaboration A command line interface Types (flavors) of Unix BSD (Berkley): most well-known System V (AT&T) : first commercial Unix Linux: Unix on PC Mac OS X: Unix by Apple Internet Technology

Unix Basics Unix: The Good, Bad & Ugly Unix Fundamentals 9/14/2018 Unix Basics Unix: The Good, Bad & Ugly It does what you say no prompting, "Are you sure?" It's not intuitive Designed by & for engineers It's CASE SENSITIVE Unix Fundamentals Know the difference between a directory and a file Know what directory you are in When in directory doubt, type ‘pwd‘ Internet Technology

Unix Basics: File System 9/14/2018 Unix Basics: File System Hierarchical Naming No explicit disk drives e.g., /home/kiyang (vs. C:\Document and Settings\kiyang) Top level is called the root (e.g. cd /) Absolute (full) vs. relative path (filename) Full path: /home/kiyang/file1.txt Relative path: file1.txt (current directory = /home/kiyang) Navigation No graphical interface or desktop utility Command line using Unix commands pwd (where am I?) ls -l (what are the files in the current directory?) cd dirname (move to a directory named dirname) Internet Technology

Unix: Directories File and directory paths use the forward slash “/” 9/14/2018 Unix: Directories File and directory paths use the forward slash “/” / "root" directory /home/kiyang subdirectory “home” → subdirectory “kiyang” root ~ Unix Home directory shorthand ~kiyang = /home/kiyang ~batman = /home/stud/batman ~/ = (current) user’s home directory ~/public_html/ = user’s web directory ~/IT/homework/ = user’s homework directory home usr kiyang stud batman catwoman IT public_html IT /home/stud/catwoman/public_html (http://widit.knu.ac.kr/~catwoman/) public_html homework homework ithw /home/stud/batman/IT/homework symbolic link created by ‘ln –s’ command Internet Technology

Unix: Command Syntax Unix command syntax: 9/14/2018 Unix: Command Syntax Unix command syntax: command [space] option switches [space] arguments To get help on a command Type ‘man command’ e.g., man ls (example) ls -l /home/kiyang/share Internet Technology

Unix Basics: ls Command 9/14/2018 Unix Basics: ls Command ls lists files in a directory Default argument = current directory Common options: -a → list all files including dot files -s → list files sizes -l → display detailed info Options can be combined, for example: ls –la List detailed info of all files (including dot files) in current directory ls -al List detailed info of hw1.txt in kiyang’s share directory ls -l /home/kiyang/share/hw1.txt List detailed info of files that starts with hw in current directory ls -l hw* Internet Technology

Unix Basics: cd Command 9/14/2018 Unix Basics: cd Command cd dir_name Change directory to the directory named dir_name To change to userid’s homework directory cd /home/stud/userid/IT/homework cd ~userid/IT/homework To change to your own homework directory cd ~/IT/homework cd IT/homework (from home directory) cd homework (from IT directory) Default argument = home directory e.g., cd (change to home directory) ..  parent directory e.g., cd .. (change to parent directory) Internet Technology

Unix Basics: Other Command 9/14/2018 Unix Basics: Other Command cp file1 file2  copy file1 to file2 mv file1 file2  rename file1 to file2 rm file1  delete file1 mkdir dir_name  to create a directory named dir_name rmdir dir_name  to delete a directory named dir_name cat filename  display the content of filename more filename  display filename content a screen at a time less filename  same as more & scroll back Internet Technology

UNIX Shortcuts Up arrow Tab key after partial filename 9/14/2018 UNIX Shortcuts Up arrow Cycles through previous commands Tab key after partial filename Completes the filename if enough has been typed (like auto-complete) Aliases (~/.aliases) Use shorter commands in place of longer one. Syntax: alias short_cmd=‘long command’ e.g., alias dir='ls -al |more' alias cdit='cd ~/IT/homework' alias cdw='cd ~/public_html' alias chmo='chmod 755 ~/IT/homework/*' Internet Technology

Unix Basics: Working with Files 9/14/2018 Unix Basics: Working with Files Files have owners and permissions Owner = person who created the file Permission read, write, execute by owner, group, everyone Cannot "more" all files read permission needed Special files Dot files: ls –a to list Symbolic links: ls –I to list the original file "ls" to list "cp" to copy "mv" to rename. "rm" to delete "more" (less, cat) to view the content Try: ls -l /etc/motd Try "cp" to copy: cp /etc/motd ~/motd.my.copy Try "mv" to rename: mv motd.my.copy blah Try "rm" to delete (forever): rm blah Directories are special types of files mkdir blahdir ("rmdir" to remove) cp /etc/motd ~/blahdir ("ls blahdir" to view) Internet Technology

Unix Basics: Working with Directories 9/14/2018 Unix Basics: Working with Directories Directories are special types of files Unix filesystem is hierarchical use "cd" and "ls" to get around cannot "cd" everywhere due to file access restrictions execute permission needed ~/  your home directory ~/public_html = /home/kiyang/public_html "cd" to change directory "mkdir" to create "rmdir" to remove "pwd" to print current working cirectory "cd" alone brings you home (RUBY slippers!) "cd ~" and "cd ~username" brings you home (or to "username's" home) "cd.." brings you down a directory Internet Technology

Unix Basics: Permissions 9/14/2018 Unix Basics: Permissions The system administrator sets the default permissions Permissions allow you to share or protect information Set up into three user groups owner, group, and world. chmod to change permissions e.g., chmod 755 hw1.txt Internet Technology

Unix Permissions - rwx r-x r-- 111 101 100 7 5 4 9/14/2018 Unix Permissions Unix file permissions are represented in octal (based on binary) -rwxr-xr-- 1 kiyang kiyang 30 May 25 16:17 hw1.txt 000 = 0 = - - - 001 = 1 = - - x 010 = 2 = - w - 011 = 3 = - w x 100 = 4 = r - - 101 = 5 = r - x 110 = 6 = r w - 111 = 7 = r w x owner group world - rwx r-x r-- 1=Allowed 0=Not Allowed 111 101 100 In decimal number 7 5 4 So, the permissions for the file hw1.txt are 754. Internet Technology

9/14/2018 Unix Permissions WIDIT: ~/public_html -> ls -l total 118 -rwxr--r-- 1 robin superG 30 2013-03-19 16:17 hw1.txt -rw-r-xr-x 1 robin robin 221 2013-03-19 16:19 index.htm -rw-r--r-- 1 robin robin 28672 2013-03-22 16:21 lab1.doc lrwxrwxrwx 1 robin robin 15 2013-03-22 16:20 ithw -> ../IT/homework/ drwx--x--x 2 robin robin 4096 2013-03-31 16:21 test file type permission owner group size last modified date name Shows files and directories, owners, file sizes, last modified date, and permissions File hw1.txt has read, write, and execute permissions for owner (robin) and read permissions for group (superG) and the world test is a directory ithw is a symbolic link to ~/IT/homework Internet Technology

Changing Unix File Permissions 9/14/2018 Changing Unix File Permissions Use the chmod command Syntax: chmod permissions filename e.g., chmod 754 hw1.txt This would change the permissions to? Important in web authoring Web pages Must be world readable → chmod 644 (rw- r-- r--) index.htm Server-side Programs Must be executable → chmod 755 (rwx r-x r-x) roster.cgi User group depending on web server configuration Directories Must be world executable → chmod 711 (rwx --x --x) public_html Internet Technology

Unix Permissions: In English 9/14/2018 Unix Permissions: In English Whose permission? u (owner), g (group), o (world), a (all) What action? + (give), - (take away) What rights? r (read), w (write), x (execute) Syntax chmod who+action+rights Examples chmod u+rwx file1.txt (give owner read, write, execute rights) chmod go+rx file1.txt (give group & world read and execute rights) → after both of these commands have executed, the file rights will be 755. Internet Technology

UNIX Network Tools nslookup Ping UNIX command for a DNS name look up 9/14/2018 UNIX Network Tools nslookup UNIX command for a DNS name look up Translates hostname to IP address Syntax: nslookup hostname e.g., nslookup widit.knu.ac.kr Ping Utility for determe if an Internet host is alive & responding e.g. ping –c 5 www.knu.ac.kr Internet Technology