0% found this document useful (0 votes)
2 views

Lecture 1(LAB)

The document outlines the first lab for the Operating System course (CSC 2209) and covers essential topics such as the definition and types of shells, kernel version, current directory, and basic commands like ls, mkdir, and cd. It provides instructions on how to create directories and files in UNIX/Linux. Additionally, it mentions a recommended book for further reading on Unix Shell Programming.

Uploaded by

Sumaiya
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lecture 1(LAB)

The document outlines the first lab for the Operating System course (CSC 2209) and covers essential topics such as the definition and types of shells, kernel version, current directory, and basic commands like ls, mkdir, and cd. It provides instructions on how to create directories and files in UNIX/Linux. Additionally, it mentions a recommended book for further reading on Unix Shell Programming.

Uploaded by

Sumaiya
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

LAB 1

Course Code: CSC 2209 Course Title: Operating System

Dept. of Computer Science


Faculty of Science and Technology

Lecturer No: 01 Week No: 01 Semester: Fall 20-21


Lecturer: Syeda Anika Tasnim
[email protected]
Lecture Outline

1. What is Shell and it’s types


2. kernel Version
3. Current Directory
4. ls Command
5. Directory Creation
6. Directory Change
7. Empty File Creation
Kernel Version
What Is a Shell?
 A shell is a program that provides an interface between a user
and an operating system (OS) kernel. An OS starts a shell for
each user when the user logs in or opens a terminal or console
window.
Types of shells
 In UNIX/Linux there are two major types of shells:
 The Bourne shell. If you are using a Bourne-type shell, the default prompt is the $
character.
 The C shell. If you are using a C-type shell, the default prompt is the % character.
 There are again various subcategories for Bourne Shell which are listed as follows:
 Bourne shell ( sh)
 Korn shell ( ksh)
 Bourne Again shell ( bash)
 POSIX shell ( sh)
 The different C-type shells follow:
 C shell ( csh)
 TENEX/TOPS C shell ( tcsh)
Kernel Version
 Open the Terminal.

 Enter uname -r this will show you what kernel version you have.

 Architecture (32bit or 64bit)

 This is useful if you want to determine which architecture are you


running, 86, 64 or 32 bit.
 Open the Terminal.

 Enter uname -m this will show you what architecture you are
running.
Current Directory
 Your shell has a current directory — the directory in which you
are currently working
■ Commands like ls use the current directory if none is
specified
■ Use the pwd (print working directory) command to see what
your current directory is:
$ pwd
/home/fred
ls command
 ls is one of the most used basic linux commands, used
to print contents of a directory, by default it lists contents
of current working directory(pwd).
How to create a directory
 To create a directory in UNIX or Linux using the mkdir command
pass the name of directory to the mkdir command.
 The mkdir command makes new, empty, directories
Syntax: $ mkdir mydirectory
Example: $ mkdir OS1
How to create multiple
directories
 To create multiple directories in UNIX or Linux using the mkdir
command pass the names of directories to be created to the
mkdir command. The names of directories should be separated
by spaces.

 mkdir foo bar baz

 ls

 foo bar baz


Change directory
 Change the current directory with cd:
 Syntax: $ cd /folder/subfolder
 Example: $ cd /desktop/os

 You can check changed directory using pwd

 $ pwd
 /desktop/os

 Use cd without specifying a path to get back to your home directory


Current , Parent, and Hidden Directories

 The special . and .. directories don’t show up when you do ls


They are hidden directories,
. means current directory
.. means parent directory
 Directories name starting with . are considered ‘hidden’
 Make ls display all files and directories, even the hidden ones,
by giving it the -a (all) option:
$ ls –a
.
..
 To go to parent directory we can use $ cd ..
How to Create an Empty File
 The following touch command creates an empty (zero byte)
new file called test.

 >> touch test.txt


Books
 Unix Shell Programming
 Written by Yashavant P. Kanetkar

You might also like