SlideShare a Scribd company logo
Lab 1: Hello, Linux!
Advanced Operating Systems

Zubair Nabi
zubair.nabi@itu.edu.pk

January 23, 2013
Unix

• Multi-task, multi-user OS out of Bell Labs in 19691
• Initially in Assembly but later in C (1973)2
• Code recycling!
• Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas
McIlroy, Michael Lesk and Joe Ossanna
• Branched into BSD (FreeBSD, NetBSD, etc.)

1
2

http://www.youtube.com/watch?v=tc4ROCJYbm0

Dennis M. Ritchie and Ken Thompson. 1974. The UNIX time-sharing system.
Commun. ACM 17, 7 (July 1974), 365-375. DOI=10.1145/361011.361061
Linux
• Linux (circa 1991) is a Unix-clone under FOSS
• Comes in many flavours/distributions (distros): Linux kernel3 +
GUI (optional) + application/software suite
• bash (shell) + GCC + GDB + coreutils
• 600+ distros
• Popular ones: Ubuntu, Fedora, Debian, Gentoo, SUSE, etc.

• Now being used atop desktops, servers, and mobile/embedded
systems

Linus Torvalds: comp.os.minix mailing list (1991-08-25)
I’m doing a (free) operating system (just a hobby, won’t be big and
professional like gnu) for 386(486) AT clones.
3

http://www.kernel.org/
Ubuntu

• Built on top of Debian and developed/distributed by Canonical
Ltd.
• Most popular desktop/laptop distribution
• Applications: LibreOffice, Firefox (web browser), Thunderbird
(email/chat/news), Empathy (IM/VoIP), etc.
• Variants: Ubuntu Deskop, Ubuntu Server, Ubuntu for Phones, etc.
Linux guide(s)

• Introduction to Linux: A Hands on Guide; Achtelt Garrels;
CreateSpace Independent Publishing Platform
Available online:

http://www.tldp.org/LDP/intro-linux/html/
Common commands

Command

ls
cd
file
cat
pwd
man
logout/exit

Description
List the contents of a directory
Change directory (jump across the filesystem tree)
Display file type
Send file contents to standard output
Display current working directory
Display manual page
Close the current session
Files
Everything is a file
On a UNIX system, everything is a file; if something is not a file, it is a
process.
Type
Regular (-)
Directory (d)
Special (c)
Links (l)
Domain sockets (s)
Named pipes (p)
Block device files (b)

Description
Ordinary files
To list other files
Used for input/output
Pointers to other files
IPC through TCP/IP-like sockets
IPC enablers
To represent block devices
Partitioning

• Divides the disk device into multiple logical storage units
• Data partitions contain regular user data
• Swap partitions house the swap space
• Attached to the file system at mount points
• df displays free disk space in active partitions
Filesystem layout
Type

/bin
/boot
/dev
/etc
/home
/lib
/lost+found
/media
/mnt
/opt
/proc

Description
Programs shared by users, administrators,
and the system itself
Start-up files
Hardware devices
Configuration files
Home directories of users
Library files for programs and the system
Files saved in case of failure
Mount point for removable media
Mount point for external filesystems
Third-party software
Information about system resources (userspace window into kernel data structures)
Filesystem layout (2)

/sbin
/tmp
/usr
/var

Programs shared by administrators and the
system
Temporary space
User processes and libraries
Files which change size regularly, e.g. log
files, etc.
Paths, environment variables, and home directories

• Two types of paths:
1

Relative: Relative to the current working directory
• ∼: Relative to home directory

2

Absolute: Starting from the root directory

• Environment variables: Contain dynamic values that change the
behaviour of running programs, e.g. PATH, HOME, etc.
• Each user has a home directory
Manipulating files/directories

• Create directory: mkdir
• Move file/directory: mv
• Copy file/directory: cp
• Remove file/directory: rm
• Find file/directory: find <path> -name <filename>
Manipulating files and their contents

• Filter results: grep
• Invert: -v
• Display values from the top: head
• Display values from the bottom: tail
• Display unique values: uniq
• Change file permissions: chmod
• Permissions: -, r, w, x (bit masks)
• Permission categories: owner, group, everyone else

• Count number of lines (-l), words (-w), and bytes(-c): wc
Pipes and input/output redirection

• Pipe (|): Redirect standard output to standard input
• Input/output redirection (<>): Redirect standard input or output
to a file
• Appending redirection: << or >>
• Replacing a string in place:

sed -i s/<original_string>/<new_string>/
<file>
• Replacing a string and copying into a new file:

sed s/<original_string>/<new_string>/
<input_file> > <output_file>
Shell scripts

• Shell commands can be put into a file and executed as a script
• A file can be made executable through chmod
Today’s Task
• Write a bash script that:
1
2

3

4

5

Creates two folders in your home directory: 1) temp, and 2)
results,
Copies both dictionaries into temp and renames them to
american-english-dictionary and
british-english-dictionary,
Counts the total number of lines in both dictionaries and stores
them in count-british-english-dictionary and
count-american-english-dictionary in the
results folder,
Stores unique American English words (not present in the British
English dictionary) in unique-american-english and
unique British English words (not present in the American English
dictionary) in unique-british-english in the results
folder,
Stores common words (present in both dictionaries) in
common-english in the results folder.

More Related Content

What's hot

Some basic unix commands
Some basic unix commandsSome basic unix commands
Some basic unix commandsaaj_sarkar06
 
Linux Knowledge Transfer
Linux Knowledge TransferLinux Knowledge Transfer
Linux Knowledge TransferTapio Vaattanen
 
Useful linux-commands
Useful linux-commandsUseful linux-commands
Useful linux-commandsHimani Singh
 
An Introduction to User Space Filesystem Development
An Introduction to User Space Filesystem DevelopmentAn Introduction to User Space Filesystem Development
An Introduction to User Space Filesystem DevelopmentMatt Turner
 
Basic commands
Basic commandsBasic commands
Basic commandsambilivava
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linuxrowiebornia
 
Linux powerpoint
Linux powerpointLinux powerpoint
Linux powerpointbijanshr
 
Linux Network commands
Linux Network commandsLinux Network commands
Linux Network commandsHanan Nmr
 
AOS Lab 10: File system -- Inodes and beyond
AOS Lab 10: File system -- Inodes and beyondAOS Lab 10: File system -- Inodes and beyond
AOS Lab 10: File system -- Inodes and beyondZubair Nabi
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbookWave Digitech
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic CommandsHanan Nmr
 
AOS Lab 7: Page tables
AOS Lab 7: Page tablesAOS Lab 7: Page tables
AOS Lab 7: Page tablesZubair Nabi
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelDivye Kapoor
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginnersSuKyeong Jang
 
AOS Lab 1: Hello, Linux!
AOS Lab 1: Hello, Linux!AOS Lab 1: Hello, Linux!
AOS Lab 1: Hello, Linux!Zubair Nabi
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command ShellTushar B Kute
 

What's hot (20)

Some basic unix commands
Some basic unix commandsSome basic unix commands
Some basic unix commands
 
UNIX Basics and Cluster Computing
UNIX Basics and Cluster ComputingUNIX Basics and Cluster Computing
UNIX Basics and Cluster Computing
 
Linux Knowledge Transfer
Linux Knowledge TransferLinux Knowledge Transfer
Linux Knowledge Transfer
 
Useful linux-commands
Useful linux-commandsUseful linux-commands
Useful linux-commands
 
An Introduction to User Space Filesystem Development
An Introduction to User Space Filesystem DevelopmentAn Introduction to User Space Filesystem Development
An Introduction to User Space Filesystem Development
 
Basic commands
Basic commandsBasic commands
Basic commands
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linux
 
Introduction to UNIX
Introduction to UNIXIntroduction to UNIX
Introduction to UNIX
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
 
Linux powerpoint
Linux powerpointLinux powerpoint
Linux powerpoint
 
Linux Network commands
Linux Network commandsLinux Network commands
Linux Network commands
 
AOS Lab 10: File system -- Inodes and beyond
AOS Lab 10: File system -- Inodes and beyondAOS Lab 10: File system -- Inodes and beyond
AOS Lab 10: File system -- Inodes and beyond
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbook
 
Fun with FUSE
Fun with FUSEFun with FUSE
Fun with FUSE
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 
AOS Lab 7: Page tables
AOS Lab 7: Page tablesAOS Lab 7: Page tables
AOS Lab 7: Page tables
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
 
AOS Lab 1: Hello, Linux!
AOS Lab 1: Hello, Linux!AOS Lab 1: Hello, Linux!
AOS Lab 1: Hello, Linux!
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command Shell
 

Viewers also liked

AOS Lab 11: Virtualization
AOS Lab 11: VirtualizationAOS Lab 11: Virtualization
AOS Lab 11: VirtualizationZubair Nabi
 
AOS Lab 8: Interrupts and Device Drivers
AOS Lab 8: Interrupts and Device DriversAOS Lab 8: Interrupts and Device Drivers
AOS Lab 8: Interrupts and Device DriversZubair Nabi
 
Topic 13: Cloud Stacks
Topic 13: Cloud StacksTopic 13: Cloud Stacks
Topic 13: Cloud StacksZubair Nabi
 
Raabta: Low-cost Video Conferencing for the Developing World
Raabta: Low-cost Video Conferencing for the Developing WorldRaabta: Low-cost Video Conferencing for the Developing World
Raabta: Low-cost Video Conferencing for the Developing WorldZubair Nabi
 
MapReduce and DBMS Hybrids
MapReduce and DBMS HybridsMapReduce and DBMS Hybrids
MapReduce and DBMS HybridsZubair Nabi
 
MapReduce Application Scripting
MapReduce Application ScriptingMapReduce Application Scripting
MapReduce Application ScriptingZubair Nabi
 
AOS Lab 4: If you liked it, then you should have put a “lock” on it
AOS Lab 4: If you liked it, then you should have put a “lock” on itAOS Lab 4: If you liked it, then you should have put a “lock” on it
AOS Lab 4: If you liked it, then you should have put a “lock” on itZubair Nabi
 
The Anatomy of Web Censorship in Pakistan
The Anatomy of Web Censorship in PakistanThe Anatomy of Web Censorship in Pakistan
The Anatomy of Web Censorship in PakistanZubair Nabi
 
AOS Lab 5: System calls
AOS Lab 5: System callsAOS Lab 5: System calls
AOS Lab 5: System callsZubair Nabi
 
AOS Lab 6: Scheduling
AOS Lab 6: SchedulingAOS Lab 6: Scheduling
AOS Lab 6: SchedulingZubair Nabi
 
AOS Lab 9: File system -- Of buffers, logs, and blocks
AOS Lab 9: File system -- Of buffers, logs, and blocksAOS Lab 9: File system -- Of buffers, logs, and blocks
AOS Lab 9: File system -- Of buffers, logs, and blocksZubair Nabi
 
Topic 14: Operating Systems and Virtualization
Topic 14: Operating Systems and VirtualizationTopic 14: Operating Systems and Virtualization
Topic 14: Operating Systems and VirtualizationZubair Nabi
 
The Big Data Stack
The Big Data StackThe Big Data Stack
The Big Data StackZubair Nabi
 
AOS Lab 12: Network Communication
AOS Lab 12: Network CommunicationAOS Lab 12: Network Communication
AOS Lab 12: Network CommunicationZubair Nabi
 
Topic 15: Datacenter Design and Networking
Topic 15: Datacenter Design and NetworkingTopic 15: Datacenter Design and Networking
Topic 15: Datacenter Design and NetworkingZubair Nabi
 

Viewers also liked (15)

AOS Lab 11: Virtualization
AOS Lab 11: VirtualizationAOS Lab 11: Virtualization
AOS Lab 11: Virtualization
 
AOS Lab 8: Interrupts and Device Drivers
AOS Lab 8: Interrupts and Device DriversAOS Lab 8: Interrupts and Device Drivers
AOS Lab 8: Interrupts and Device Drivers
 
Topic 13: Cloud Stacks
Topic 13: Cloud StacksTopic 13: Cloud Stacks
Topic 13: Cloud Stacks
 
Raabta: Low-cost Video Conferencing for the Developing World
Raabta: Low-cost Video Conferencing for the Developing WorldRaabta: Low-cost Video Conferencing for the Developing World
Raabta: Low-cost Video Conferencing for the Developing World
 
MapReduce and DBMS Hybrids
MapReduce and DBMS HybridsMapReduce and DBMS Hybrids
MapReduce and DBMS Hybrids
 
MapReduce Application Scripting
MapReduce Application ScriptingMapReduce Application Scripting
MapReduce Application Scripting
 
AOS Lab 4: If you liked it, then you should have put a “lock” on it
AOS Lab 4: If you liked it, then you should have put a “lock” on itAOS Lab 4: If you liked it, then you should have put a “lock” on it
AOS Lab 4: If you liked it, then you should have put a “lock” on it
 
The Anatomy of Web Censorship in Pakistan
The Anatomy of Web Censorship in PakistanThe Anatomy of Web Censorship in Pakistan
The Anatomy of Web Censorship in Pakistan
 
AOS Lab 5: System calls
AOS Lab 5: System callsAOS Lab 5: System calls
AOS Lab 5: System calls
 
AOS Lab 6: Scheduling
AOS Lab 6: SchedulingAOS Lab 6: Scheduling
AOS Lab 6: Scheduling
 
AOS Lab 9: File system -- Of buffers, logs, and blocks
AOS Lab 9: File system -- Of buffers, logs, and blocksAOS Lab 9: File system -- Of buffers, logs, and blocks
AOS Lab 9: File system -- Of buffers, logs, and blocks
 
Topic 14: Operating Systems and Virtualization
Topic 14: Operating Systems and VirtualizationTopic 14: Operating Systems and Virtualization
Topic 14: Operating Systems and Virtualization
 
The Big Data Stack
The Big Data StackThe Big Data Stack
The Big Data Stack
 
AOS Lab 12: Network Communication
AOS Lab 12: Network CommunicationAOS Lab 12: Network Communication
AOS Lab 12: Network Communication
 
Topic 15: Datacenter Design and Networking
Topic 15: Datacenter Design and NetworkingTopic 15: Datacenter Design and Networking
Topic 15: Datacenter Design and Networking
 

Similar to AOS Lab 1: Hello, Linux!

Unix _linux_fundamentals_for_hpc-_b
Unix  _linux_fundamentals_for_hpc-_bUnix  _linux_fundamentals_for_hpc-_b
Unix _linux_fundamentals_for_hpc-_bMohammad Reza Beygi
 
Presentation for RHCE in linux
Presentation  for  RHCE in linux Presentation  for  RHCE in linux
Presentation for RHCE in linux Kuldeep Tiwari
 
PowerPoint_merge.ppt on unix programming
PowerPoint_merge.ppt on unix programmingPowerPoint_merge.ppt on unix programming
PowerPoint_merge.ppt on unix programmingPriyadarshini648418
 
Online Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadRavikumar Nandigam
 
LINUX_admin_commands.pptx
LINUX_admin_commands.pptxLINUX_admin_commands.pptx
LINUX_admin_commands.pptxGuhanSenthil2
 
KMSUnix and Linux.pptx
KMSUnix and Linux.pptxKMSUnix and Linux.pptx
KMSUnix and Linux.pptxGanesh Bhosale
 
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERSVTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERSvtunotesbysree
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Chander Pandey
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxRajesh Kumar
 
Linux: Everyting-as-a-service
Linux: Everyting-as-a-serviceLinux: Everyting-as-a-service
Linux: Everyting-as-a-serviceRohit Sansiya
 
GMES_FOR_006_EN_TPZ - Linux - Start-v1.0.pptx
GMES_FOR_006_EN_TPZ - Linux - Start-v1.0.pptxGMES_FOR_006_EN_TPZ - Linux - Start-v1.0.pptx
GMES_FOR_006_EN_TPZ - Linux - Start-v1.0.pptxAhmedWasiu
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptxPriyadarshini648418
 
Unix fundamentals and_shell scripting
Unix fundamentals and_shell scriptingUnix fundamentals and_shell scripting
Unix fundamentals and_shell scriptingGanesh Bhosale
 
Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptxDavidMaina47
 
Introduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkiiIntroduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkiicmdept1
 

Similar to AOS Lab 1: Hello, Linux! (20)

Unix _linux_fundamentals_for_hpc-_b
Unix  _linux_fundamentals_for_hpc-_bUnix  _linux_fundamentals_for_hpc-_b
Unix _linux_fundamentals_for_hpc-_b
 
Presentation for RHCE in linux
Presentation  for  RHCE in linux Presentation  for  RHCE in linux
Presentation for RHCE in linux
 
PowerPoint_merge.ppt on unix programming
PowerPoint_merge.ppt on unix programmingPowerPoint_merge.ppt on unix programming
PowerPoint_merge.ppt on unix programming
 
Online Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in Hyderabad
 
LINUX_admin_commands.pptx
LINUX_admin_commands.pptxLINUX_admin_commands.pptx
LINUX_admin_commands.pptx
 
KMSUnix and Linux.pptx
KMSUnix and Linux.pptxKMSUnix and Linux.pptx
KMSUnix and Linux.pptx
 
redhat_by_Cbitss.ppt
redhat_by_Cbitss.pptredhat_by_Cbitss.ppt
redhat_by_Cbitss.ppt
 
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERSVTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01
 
3. intro
3. intro3. intro
3. intro
 
cisco
ciscocisco
cisco
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptx
 
Linux: Everyting-as-a-service
Linux: Everyting-as-a-serviceLinux: Everyting-as-a-service
Linux: Everyting-as-a-service
 
Linux
LinuxLinux
Linux
 
GMES_FOR_006_EN_TPZ - Linux - Start-v1.0.pptx
GMES_FOR_006_EN_TPZ - Linux - Start-v1.0.pptxGMES_FOR_006_EN_TPZ - Linux - Start-v1.0.pptx
GMES_FOR_006_EN_TPZ - Linux - Start-v1.0.pptx
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx
 
Unix fundamentals and_shell scripting
Unix fundamentals and_shell scriptingUnix fundamentals and_shell scripting
Unix fundamentals and_shell scripting
 
Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptx
 
Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptx
 
Introduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkiiIntroduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkii
 

More from Zubair Nabi

Lab 5: Interconnecting a Datacenter using Mininet
Lab 5: Interconnecting a Datacenter using MininetLab 5: Interconnecting a Datacenter using Mininet
Lab 5: Interconnecting a Datacenter using MininetZubair Nabi
 
Topic 12: NoSQL in Action
Topic 12: NoSQL in ActionTopic 12: NoSQL in Action
Topic 12: NoSQL in ActionZubair Nabi
 
Lab 4: Interfacing with Cassandra
Lab 4: Interfacing with CassandraLab 4: Interfacing with Cassandra
Lab 4: Interfacing with CassandraZubair Nabi
 
Topic 10: Taxonomy of Data and Storage
Topic 10: Taxonomy of Data and StorageTopic 10: Taxonomy of Data and Storage
Topic 10: Taxonomy of Data and StorageZubair Nabi
 
Topic 11: Google Filesystem
Topic 11: Google FilesystemTopic 11: Google Filesystem
Topic 11: Google FilesystemZubair Nabi
 
Lab 3: Writing a Naiad Application
Lab 3: Writing a Naiad ApplicationLab 3: Writing a Naiad Application
Lab 3: Writing a Naiad ApplicationZubair Nabi
 
Topic 8: Enhancements and Alternative Architectures
Topic 8: Enhancements and Alternative ArchitecturesTopic 8: Enhancements and Alternative Architectures
Topic 8: Enhancements and Alternative ArchitecturesZubair Nabi
 
Topic 7: Shortcomings in the MapReduce Paradigm
Topic 7: Shortcomings in the MapReduce ParadigmTopic 7: Shortcomings in the MapReduce Paradigm
Topic 7: Shortcomings in the MapReduce ParadigmZubair Nabi
 
Lab 1: Introduction to Amazon EC2 and MPI
Lab 1: Introduction to Amazon EC2 and MPILab 1: Introduction to Amazon EC2 and MPI
Lab 1: Introduction to Amazon EC2 and MPIZubair Nabi
 
Topic 6: MapReduce Applications
Topic 6: MapReduce ApplicationsTopic 6: MapReduce Applications
Topic 6: MapReduce ApplicationsZubair Nabi
 

More from Zubair Nabi (11)

Lab 5: Interconnecting a Datacenter using Mininet
Lab 5: Interconnecting a Datacenter using MininetLab 5: Interconnecting a Datacenter using Mininet
Lab 5: Interconnecting a Datacenter using Mininet
 
Topic 12: NoSQL in Action
Topic 12: NoSQL in ActionTopic 12: NoSQL in Action
Topic 12: NoSQL in Action
 
Lab 4: Interfacing with Cassandra
Lab 4: Interfacing with CassandraLab 4: Interfacing with Cassandra
Lab 4: Interfacing with Cassandra
 
Topic 10: Taxonomy of Data and Storage
Topic 10: Taxonomy of Data and StorageTopic 10: Taxonomy of Data and Storage
Topic 10: Taxonomy of Data and Storage
 
Topic 11: Google Filesystem
Topic 11: Google FilesystemTopic 11: Google Filesystem
Topic 11: Google Filesystem
 
Lab 3: Writing a Naiad Application
Lab 3: Writing a Naiad ApplicationLab 3: Writing a Naiad Application
Lab 3: Writing a Naiad Application
 
Topic 9: MR+
Topic 9: MR+Topic 9: MR+
Topic 9: MR+
 
Topic 8: Enhancements and Alternative Architectures
Topic 8: Enhancements and Alternative ArchitecturesTopic 8: Enhancements and Alternative Architectures
Topic 8: Enhancements and Alternative Architectures
 
Topic 7: Shortcomings in the MapReduce Paradigm
Topic 7: Shortcomings in the MapReduce ParadigmTopic 7: Shortcomings in the MapReduce Paradigm
Topic 7: Shortcomings in the MapReduce Paradigm
 
Lab 1: Introduction to Amazon EC2 and MPI
Lab 1: Introduction to Amazon EC2 and MPILab 1: Introduction to Amazon EC2 and MPI
Lab 1: Introduction to Amazon EC2 and MPI
 
Topic 6: MapReduce Applications
Topic 6: MapReduce ApplicationsTopic 6: MapReduce Applications
Topic 6: MapReduce Applications
 

Recently uploaded

In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Alison B. Lowndes
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...Product School
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupCatarinaPereira64715
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaRTTS
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Thierry Lestable
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Product School
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...Product School
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 

Recently uploaded (20)

In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 

AOS Lab 1: Hello, Linux!

  • 1. Lab 1: Hello, Linux! Advanced Operating Systems Zubair Nabi zubair.nabi@itu.edu.pk January 23, 2013
  • 2. Unix • Multi-task, multi-user OS out of Bell Labs in 19691 • Initially in Assembly but later in C (1973)2 • Code recycling! • Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, Michael Lesk and Joe Ossanna • Branched into BSD (FreeBSD, NetBSD, etc.) 1 2 http://www.youtube.com/watch?v=tc4ROCJYbm0 Dennis M. Ritchie and Ken Thompson. 1974. The UNIX time-sharing system. Commun. ACM 17, 7 (July 1974), 365-375. DOI=10.1145/361011.361061
  • 3. Linux • Linux (circa 1991) is a Unix-clone under FOSS • Comes in many flavours/distributions (distros): Linux kernel3 + GUI (optional) + application/software suite • bash (shell) + GCC + GDB + coreutils • 600+ distros • Popular ones: Ubuntu, Fedora, Debian, Gentoo, SUSE, etc. • Now being used atop desktops, servers, and mobile/embedded systems Linus Torvalds: comp.os.minix mailing list (1991-08-25) I’m doing a (free) operating system (just a hobby, won’t be big and professional like gnu) for 386(486) AT clones. 3 http://www.kernel.org/
  • 4. Ubuntu • Built on top of Debian and developed/distributed by Canonical Ltd. • Most popular desktop/laptop distribution • Applications: LibreOffice, Firefox (web browser), Thunderbird (email/chat/news), Empathy (IM/VoIP), etc. • Variants: Ubuntu Deskop, Ubuntu Server, Ubuntu for Phones, etc.
  • 5. Linux guide(s) • Introduction to Linux: A Hands on Guide; Achtelt Garrels; CreateSpace Independent Publishing Platform Available online: http://www.tldp.org/LDP/intro-linux/html/
  • 6. Common commands Command ls cd file cat pwd man logout/exit Description List the contents of a directory Change directory (jump across the filesystem tree) Display file type Send file contents to standard output Display current working directory Display manual page Close the current session
  • 7. Files Everything is a file On a UNIX system, everything is a file; if something is not a file, it is a process. Type Regular (-) Directory (d) Special (c) Links (l) Domain sockets (s) Named pipes (p) Block device files (b) Description Ordinary files To list other files Used for input/output Pointers to other files IPC through TCP/IP-like sockets IPC enablers To represent block devices
  • 8. Partitioning • Divides the disk device into multiple logical storage units • Data partitions contain regular user data • Swap partitions house the swap space • Attached to the file system at mount points • df displays free disk space in active partitions
  • 9. Filesystem layout Type /bin /boot /dev /etc /home /lib /lost+found /media /mnt /opt /proc Description Programs shared by users, administrators, and the system itself Start-up files Hardware devices Configuration files Home directories of users Library files for programs and the system Files saved in case of failure Mount point for removable media Mount point for external filesystems Third-party software Information about system resources (userspace window into kernel data structures)
  • 10. Filesystem layout (2) /sbin /tmp /usr /var Programs shared by administrators and the system Temporary space User processes and libraries Files which change size regularly, e.g. log files, etc.
  • 11. Paths, environment variables, and home directories • Two types of paths: 1 Relative: Relative to the current working directory • ∼: Relative to home directory 2 Absolute: Starting from the root directory • Environment variables: Contain dynamic values that change the behaviour of running programs, e.g. PATH, HOME, etc. • Each user has a home directory
  • 12. Manipulating files/directories • Create directory: mkdir • Move file/directory: mv • Copy file/directory: cp • Remove file/directory: rm • Find file/directory: find <path> -name <filename>
  • 13. Manipulating files and their contents • Filter results: grep • Invert: -v • Display values from the top: head • Display values from the bottom: tail • Display unique values: uniq • Change file permissions: chmod • Permissions: -, r, w, x (bit masks) • Permission categories: owner, group, everyone else • Count number of lines (-l), words (-w), and bytes(-c): wc
  • 14. Pipes and input/output redirection • Pipe (|): Redirect standard output to standard input • Input/output redirection (<>): Redirect standard input or output to a file • Appending redirection: << or >> • Replacing a string in place: sed -i s/<original_string>/<new_string>/ <file> • Replacing a string and copying into a new file: sed s/<original_string>/<new_string>/ <input_file> > <output_file>
  • 15. Shell scripts • Shell commands can be put into a file and executed as a script • A file can be made executable through chmod
  • 16. Today’s Task • Write a bash script that: 1 2 3 4 5 Creates two folders in your home directory: 1) temp, and 2) results, Copies both dictionaries into temp and renames them to american-english-dictionary and british-english-dictionary, Counts the total number of lines in both dictionaries and stores them in count-british-english-dictionary and count-american-english-dictionary in the results folder, Stores unique American English words (not present in the British English dictionary) in unique-american-english and unique British English words (not present in the American English dictionary) in unique-british-english in the results folder, Stores common words (present in both dictionaries) in common-english in the results folder.