Professional Documents
Culture Documents
CIT-333
CIT-323
M SHUMRAIZ SHARIF
ACKNOWLEDGMENTS
There Is A Great Blessing Of Allah, Allah Give Me Such Ability And Confidence To Accomplish The Goal.
My Name Is MUHAMMAD SHUMRAIZ SHARIF. I Have Passed BS-IT From Virtual University Of
Pakistan. Before BS, I Have Also Passed D.A.E In Computer Information Technology. From Pak
Polytechnic Institute Lahore. I Have Done CCNA, CCNP Course From PUCIT Lahore. I Have Been
Teaching Computer Subjects Since 2015 In Abbas College Of Technology. Almost Hundred above
Students Passing Out From This Course. I Will Special Thanks To Mr. Shahid Jahangir (Principal) And
ACT Staff For Giving Me A Platform.
THANK YOU
Proud To Be A PAKISTANI
1) Accepting input.
2) Performing processing.
3) Outputting results.
An interrupt is a signal from a device attached to a computer or from a program within the computer
that causes the main program that operates the computer (the operating system ) to stop and figure
out what to do next. Almost all personal (or larger) computers today are interrupt-driven - that is,
they start down the list of computer instruction s in one program (perhaps an application such as a
word processor) and keep running the instructions until either (A) they can't go any further or (B) an
interrupt signal is sensed. After the interrupt signal is sensed, the computer either resumes running
the program it was running or begins running another program.
An operating system usually has some code that is called an interrupt handler . The interrupt handler
prioritizes the interrupts and saves them in a queue if more than one is waiting to be handled. The
operating system has another little program, sometimes called ascheduler , that figures out which
program to give control to next.
Answer: list of basic Input Devices, Output devices and Both input-output devices related
to computer.
3) CD 8) Memory Card
Hacking unauthorized access to or use of data, systems, server or networks, including any illegal attempt, scan
or test the vulnerability of a system, server or network or to breach security or authentication measures
without express authorization of the owner of the system, server or network. Members of the University
should not run computer programs that are associated with hacking without prior authorization. Obtaining and
using such programs is not typical of normal usage and may therefore otherwise be regarded as misuse.
Use of University owned computer equipment, including the network, for illegal activities including copying
Copyright material without permission. The vast majority of files shared on P2P (peer-to-peer) networks
violate copyright law because they were posted without permission of the artist or label.
Sending abusive e-mails or posting offensive Web pages.
Creation or transmission of any offensive or indecent images.
Giving unauthorized access to University computing resources e.g. allowing an account to be used by someone
not authorized to use it.
Unauthorized running of applications that involve committing the University to sharing its computing
resources, e.g. network bandwidth, in an uncontrolled and unlimited way.
Memory management
It's a directory path. Paths are often expressed by listing the directories along the path separated by
slashes. For instance, animals/prehistoric/dinosaurs would represent the path starting at the
All of the files in the UNIX file system are organized into a multi-leveled hierarchy called a
directory tree.
A family tree is an example of a hierarchical structure that represents how the UNIX file
system is organized. The UNIX file system might also be envisioned as an inverted tree or the
root system of plant.
At the very top of the file system is single directory called "root" which is represented by a /
(slash). All other files are "descendants" of root.
The number of levels is largely arbitrary, although most UNIX systems share some
organizational similarities. The "standard" UNIX file system is discussed later. Example:
/(root)
|
---------------------
| | |
/bin /usr /tmp
|
|
------------------------------------------------------------
| | | |
/public /misc /staff /students
| | |
------------ ------------------- ---------------------
| | | | | | | | |
/software /doc /john /mary /bill /carl /tom /dick /mary
Disk Management is an extension of the Microsoft Management Console that allows full
management of the disk-based hardware recognized by Windows.
To open it Click Start and in the Run line type diskmgmt.msc and press enter.
It manages the hardware and software resources of the system. In a desktop computer,
these resources include such things as the processor, memory, disk space and more (On a
cell phone, they include the keypad, the screen, the address book, the phone dialer, the
battery and the network connection).
System calls provide the interface between a running program and the operating system. (an
instruction that interrupts the program being executed and passes control to the supervisor.
In computing, a system call is how a program requests a service from an operating system's kernel.
This may include hardware related services (e.g. accessing the hard disk), creating and executing
new processes, and communicating with integral kernel services (like scheduling). System calls
provide an essential interface between a process and the operating system.
1. Process control
2. File management
3. Device management
4. Information maintenance
5. Communications
Q# 17- Who is System Administrator and what are the Responsibilities of System
Administrator?
This individual will assist project teams with technical issues in the Initiation and Planning phases of
our standard Project Management Methodology. These activities include the definition of needs,
benefits, and technical strategy; research & development within the project life-cycle; technical
analysis and design; and support of operations staff in executing, testing and rolling-out the
solutions. Participation on projects is focused on smoothing the transition of projects from
development staff to production staff by performing operations activities within the project life-cycle.
This individual is accountable for the following systems: Linux and Windows systems that support
GIS infrastructure; Linux, Windows and Application systems that support Asset Management;
Responsibilities on these systems include SA engineering and provisioning, operations and support,
maintenance and research and development to ensure continual innovation.
The person who is responsible for setting up and maintaining the system or server is
called as the system administrator. System administrators may be members of an
The duties of a system administrator are wide-ranging, and vary widely from one
organization to another. Sysadmins are usually charged with installing, supporting,
and maintaining servers or other computer systems, and planning for and
responding to service outages and other problems.
computer system and network 9. Verify that peripherals are working properly
5. Setup security policies for users. A sysadmin 10. Quickly arrange repair for hardware in
security (e.g. firewalls and intrusion detection 11. Monitor system performance
6. CD-ROM drive
3. 5 GB of hard-drive space (or USB stick, memory card or external drive but see LiveCD for
an alternative approach)
4. VGA capable of 1024x768 screen resolution
System programming (or systems programming) is the activity of computer programming system
software. The primary distinguishing characteristic of systems programming when compared
to application programming is that application programming aims to produce software which
provides services to the user (e.g. word processor), whereas systems programming aims to produce
software which provides services to the computer hardware (e.g. disk defragmenter). It requires a
greater degree of hardware awareness.
The computer architecture of a computing system defines its attributes as seen by the programs that
are executed in that system, that is, the conceptual structure and functional behavior of the machine
hardware. Then, the computer architect defines the functions to be executed in the hardware and
the protocol to be used by the software in order to exploit such functions. Note that the architecture
has nothing to do with the organization of the data flow, the logical design, the physical design, and
the performance of any particular implementation in the hardware.
Hence By Architecture we mean the order in which certain hardware Processes are carried out by
the OS and has nothing to do with the logical software flow of the Computer.
1. The kernel of an operating system is the part responsible for all other operations. When a
computer boots up, it goes through some initialization functions, such as checking memory.
It then loads the kernel and switches control to it. The kernel then starts up all the processes
needed to communicate with the user and the rest of the environment (e.g. the LAN)
2. The kernel is always loaded into memory, and kernel functions always run, handling
processes, memory, files and devices.
3. The traditional structure of a kernel is a layered system, such as Unix. In this, all layers are
part of the kernel, and each layer can talk to only a few other layers. Application programs
and utilities live above the kernel.
4. The Unix kernel looks like
Linux is a multi-user, multitasking system with a full set of UNIX-compatible tools. Its file system
adheres to traditional UNIX semantics, and it fully implements the standard UNIX networking model.
Linux is designed to be compliant with the relevant POSIX documents; at least two Linux
distributions have achieved official POSIX certification.
The Linux programming interface adheres to the SVR4 UNIX semantics, rather than to BSD behavior.
Like most UNIX implementations, Linux is composed of three main bodies of code; the most
important distinction between the kernel and all other components.
The kernel is responsible for maintaining the important abstractions of the operating system.
Kernel code executes in kernel mode with full access to all the physical resources of
Computer.
All kernel code and data structures are kept in the same single address space.
The system libraries define a standard set of functions through which applications interact with the
kernel, and which implement much of the operating-system functionality that does not need the full
privileges of kernel code.
When you sit down at a Linux computer in the computer science lab, you will see a log-in screen with
a space for you to fill in your user name. Do so, press return, and there will be a space for your
password. Enter your password, and press return again. Your user name should be the same as the
user name that you use on other campus systems such as the Windows network. A password for the
Linux system was assigned to you when your account was created. It is probably not the same as
your Windows password. You are free to change this password, if you want, as described below. If
you forget your password, you will have to ask the system administrator to assign you a new one.
It might take some time -- ten or fifteen seconds -- for the desktop to appear. Be patient. You should
always log out when you are finished with a computer in the Math/CS computer lab. In Gnome,
there is a "Log out" commands in the "System" menu at the top of the screen. After selecting the
command, you might have to click a button to confirm your choice.
(Syntax for logout): logout command - Logout of a login shell. This command can be used by
normal users to end their own session.
$ logout
It's easy to change your password. Just log in as usual, open a command line window (konsole), and
enter the kpasswd command. (Note the spelling: kpasswd not kpassword.) You will be asked for
your old password, then for the new password. Finally, you will be asked to re-type the new
password to verify it. The computer will reject your password if it is shorter than 5 characters. A
good password should use a mixture of letters and symbols or of upper case and lower case letters.
1. All file names are case sensitive. So filename abc.txt, Abc.txt and ABC.txt all are three different files.
2. You can use upper and lowercase letters, numbers, "." (dot), and "_" (underscore) symbols.
3. You can use other special characters such as blank space, but they are hard to use and it is better to
avoid them.
4. In short, filenames may contain any character except / (root directory), which is reserved as the
separator between files and directories in a pathname. You cannot use the null character.
5. Most modern Linux and UNIX limit filename to 255 characters (255 bytes). However, some older
version of UNIX system limits filenames to 14 characters only.
6. A filename must be unique inside its directory. For example, inside /home/vivek directory you cannot
create a demo.txt file and demo.txt directory name. However, other directory may have files with the
same names. For example, you can create demo.txt directory in /tmp.
Q# 32- What are the Reserved Characters & Words in Linux/ Unix?
1. /
2. >
3. <
4. |
5. :
6. &
Please note that Linux and UNIX allows white spaces, <, >, |, \, :, (, ), &, ; , as well as
wildcards such as ? and * to be quoted or escaped using \ symbol.
The rm command removes a file (assuming you have permission to do so) without even saying hasta la
vista. Be sure you really want to delete your files before you use rm, because once the files are gone, they're
not coming back. For example, $ rm wallet
Immediately deletes the file named wallet in the current directory without prompting. If you want to be
prompted before the deletion, use the -i flag. One other rm flag is -f, which translates roughly to "Don't ask me
any questions--just delete the files." While rm normally asks for confirmation before deleting a write-
protected file, the -f (force) flag overrides this prompt. Be careful with the rm command, since the multiuser
nature of Linux does not allow for undelete as in DOS. As soon as you let go of the space occupied by a file, the
operating system is likely to use it for something else.
Deleting Directories
If you created a directory named spelunking six months ago, and now you're not so keen on crawling through
slimy caves, the rmdir command may be able to help:
$ rmdir spelunking
This command removes the specified directory, but only if it's empty. If the directory contains files or
subdirectories, you'll have to delete them using rm first. One alternative to painstakingly removing all the
contents of a directory that you just want to make disappear is to use the rm -rcommand. The -r flag
gives rm license to kill directories, their files, and even their subdirectories. Be very sure you understand
what's about to happen before using a command like this:
$ rm -r spelunking
Use the command "logout" to exit a given session. If you have logged in, then typed "su" to become a
super user or another user, you may need to type "exit" until your SHLVL environment value is 1.
Then you can type "logout" to exit your session. The "exit" command will take you back to previous
shell levels.
The system is intended to be shutdown by the system administrator using the shutdown
command in one of the forms shown below. Many systems are set up to capture the
<CTRL><ALT><DEL> keystroke combination to issue the shutdown command through the
init program. This will work on most systems if the root user is logged in. Examples of using
the shutdown command are shown below.
shutdown -h now
shutdown -r +10 "Rebooting in 10 minutes"
shutdown -r 13:0
1. Planning - cost, capacity planning, logistics (network design, server locations, where to
install, wiring, IP address assignments, ...), network service providers (ISPs)
2. Preparing - temperature, humidity, electrical, fire, security, EIA/TIA wiring closet and cabling
standards, UPS; Change management (preparing for any service changes)
3. Installing hardware - computers, terminals, disk drives, CD-ROMs, RAM, printers, NICs,
cabling
4. Maintaining - regular preventative maintenance (daily, weekly, ...), boot and shutdown
systems when needed, printers, backup media, tune systems for performance
5. Monitoring - printers, disk space, network, servers and workstations, performance, and
security, and all log files regularly
6. Installing/upgrading/removing software - OS (kernel patches, new device drivers, ...),
applications (new versions, DLLs, new configurations), documentation
7. Backups and archives
8. Trouble-shooting - network connections, services that don't start, faulty security, ...
9. Help and educate users - This includes working with your management (who sometimes
needs the most help and education even if they don't think so), helping new users,
experienced users, and yourself
10. Problem solving - System administration is about solving problems, not memorizing how-to
directions. Often something won't work as it should. What will you do then?
We can define a Kernel is the main component of most computer operating systems. It provides
an interface between applications and actual data processing at the hardware level.
Kernal is the part of an operating system which is responsible for interacting directly with hardware
and does this by using your device drivers. think of the kernel as a manager managing and using the
processes between the other parts of the operating system and the hardware. it executes tasks to be
done and handles errors and access to your computer.
Kernel is considered as the Heart of an Operating System. Kernel provides the lowest-level
abstraction layer for the resources (especially processors and I/O devices) that application software
must control to perform its function. It makes these facilities available to applicaton
processes through Inter- Process Communication (IPC) mechanism and System Call.
The default editor that comes with the UNIX operating system is called vi (visual editor). [Alternate
editors for UNIX environments include pico and emacs, a product of GNU.]
The UNIX vi editor is a full screen editor and has two modes of operation:
1. Command mode commands which cause action to be taken on the file, and
2. Insert mode in which entered text is inserted into the file.
The vi editor can be a little difficult to learn, so I've been writing some vi tutorials here recently. One of the first things to
know about vi is that it typically functions in three different modes:
1. Command mode
2. Insert mode
3. Last line mode
1) vi command mode
When you first start editing a file with the vi editor yoou will be in vi command mode. In this mode
you can issue many vi commands, including commands like insert, append, and delete, and other
search and navigation commands that let you move around your file.
2) vi insert mode
Once you issue a vi insert, append, or open command, you will be in vi insert mode. If you're working
with a modern vi implementation, your vi editor is typically configured to show the current mode of
operation, so when you go into insert mode, you'll see a text string like this on the last line of your vi
editor window:
3) vi last line mode
The last vi mode is known as vi last line mode. You can only get to last line mode from command
mode, and you get into last line mode by pressing the colon key, like this :
Simply put, the shell is a program that takes your commands from the keyboard and gives them
to the operating system to perform. In the old days, it was the only user interface available on a
Unix computer. Nowadays, we have graphical user interfaces (GUIs) in addition to command line
interfaces (CLIs) such as the shell.
On most Linux systems a program called bash (which stands for Bourne Again SHell, an
enhanced version of the original Bourne shell program, sh, written by Steve Bourne) acts as the
shell program.
Q# 44- What are the Functions of the shell?
As programs get longer and more complex, they become more difficult to design, code, and
maintain. As with any large program, it is often useful to break a single, large task into a
number of smaller tasks.
To get familiar with this idea, let's consider the description of an everyday task -- going to
the market to buy food. Imagine that we were going to describe the task to a man from
Mars.
Our first top-level description might look like this:
Leave house
Drive to market
Park car
Enter market
Purchase food
Drive home
Park car
Enter house
This description covers the overall process of going to the market; however a man from Mars will
probably require additional detail. For example, the "Park car" sub task could be described as
follows:
Of course the task "Turn off motor" has a number of steps such as "turn off ignition" and "remove
key from ignition switch," and so on.
This process of identifying the top-level steps and developing increasingly detailed views of those
steps is called top-down design. This technique allows you to break large complex tasks into many
small, simple tasks.
As our script continues to grow, we will use top down design to help us plan and code our script. If
we look at our script's top-level tasks, we find the following list:
1. Open page
2. Open head section
3. Write title
4. Close head section
5. Open body section
6. Write title
7. Write time stamp
8. Close body section
9. Close page
All of these tasks are implemented, but we want to add more. Let's insert some additional tasks after
task 7:
Whether you’re a new Linux user or you’ve been using Linux for a while, we’ll help you get started
with the terminal. The terminal isn’t something you should be scared of – it’s a powerful tool with
lots of uses.
Q#47- What is Basic Terminal Usage?
Launch a terminal from your desktop’s application menu and you will see the bash shell.
There are other shells, but most Linux distributions use bash by default.
You can launch a program by typing its name at the prompt. Everything you launch here
– from graphical applications like Firefox to command-line utilities – is a program. (Bash
actually has a few built-in commands for basic file management and such, but those
function like programs, too.) Unlike on Windows, you don’t have to type the full path to a
program to launch it. For example, let’s say you wanted to open Firefox. On Windows,
you’d need to type the full path to Firefox’s .exe file. On Linux, you can just type:
Press Enter after typing a command to run it. Note that you don’t need to add an .exe or
anything like that – programs don’t have file extensions on Linux.
Folder/Directory Permissions
Directories have directory permissions. The directory permissions restrict different actions
than with files or device nodes.
Permission Action chmod option
Read (view contents, i.e. ls command) r or 4
Q# 49- How we can correctly use the Linux (Ubuntu) Commands to search and
view the content?
Here are a few ways to use find
$ find /home/david -name 'index*'
$ find /home/david -iname 'index*'
The 1st command would find files having the letters index as the beginning of the file name.
The search would be started in the directory /home/david and carry on within that directory
and its subdirectories only.
The 2nd command would search for the same, but the case of the filename wouldn't be
considered. So all files starting with any combination of letters in upper and lower case such
as INDEX or indEX or index would be returned.
The Trash Bin is not a directory belonging to the filesystem hierarchy itself; instead,
the Trash Bin is most often implemented by the desktop environment and its window
manager. You cannot rely on there being a Trash Bin on all installations of Linux.
Q# 53- Where are my configuration files?
Most user-specific configuration files are stored in "hidden" text files known as dot files. Dot
files are files whose names are prefixed with a dot (.), and are often located in the user's
home directory; having their name prefixed with a dot keeps them hidden from normal ls
commands; for example, running ls on my machine shows:
include
The include directory contains header files for use in the programming languages "C" and
"C++". If you are not programming in either of these languages, then you will likely not have
to worry about this directory. The directory is usually located in /usr and /usr/local, but
not /.
lib
The lib directory contains files which provide common functionality to multiple programs,
usually in the form of architecture-dependent binary data. The "lib" stands for "library".
share
The share directory contains data that is "architecture-independent"; this means that the
directory contains data that may be shared by multiple computers with different
architectures that are running the same distribution of Linux. Note that data under this
directory is likely not shareable between multiple distributions (such as Ubuntu, Fedora, and
Gentoo).
Specific directories.
These are specific directories with the Linux filesystem that are noteworthy.
/boot
Contains files essential for booting the Linux kernel. This usually includes the kernel itself,
the initramfs, and System.map files.
/dev
This directory contains device files (note: "device", not "developer"). Device files may be
thought of as "raw" interfaces to hardware devices. Several common and important device
files are:
/home
An optional directory that contains each user's individual data
/media
Most removable storage devices, such as USB sticks and SD cards, are mounted in here in a
subdirectory.
/root
The equivalent of a /home/root directory for the administrative user
/run
Process that contains information that has accumulated since system boot. Generally not
important
/sys
A Linux virtual filesystem which exports kernel object information to userspace. This usually
consists of hardware, module, and driver information. It is usually fairly difficult to decipher,
though fun to look around; to make sense of it, you'll have to scrounge up the appropriate
documentation.
/tmp
Directory for programs that require temporary files. The contents of this are generally not of
concern to the user.
/var
Contains data that varies over time. This usually includes things such as kernel boot logs,
useful if the system crashed but is now working again. Internal system mail is also often
stored within this directory. This directory is sometimes worth checking if the file system has
run out of space; copious amounts of kernel debugging via a poorly-written rogue driver can
sometimes fill up smaller file systems.
_________________________________________________
An A-Z Index of the Bash command line for Linux.
alias Create an alias •
apropos Search Help manual pages (man -k)
apt-get Search for and install software packages (Debian/Ubuntu)
aptitude Search for and install software packages (Debian/Ubuntu)
aspell Spell Checker
awk Find and Replace text, database sort/validate/index
b
basename Strip directory and suffix from filenames
bash GNU Bourne-Again SHell
bc Arbitrary precision calculator language
bg Send to background
break Exit from a loop •
builtin Run a shell builtin
bzip2 Compress or decompress named file(s)
c
cal Display a calendar
case Conditionally perform a command
cat Concatenate and print (display) the content of files
cd Change Directory
cfdisk Partition table manipulator for Linux
chgrp Change group ownership
chmod Change access permissions
chown Change file owner and group
chroot Run a command with a different root directory
chkconfig System services (runlevel)
d
date Display or change the date & time
dc Desk Calculator
dd Convert and copy a file, write disk headers, boot records
ddrescue Data recovery tool
declare Declare variables and give them attributes •
df Display free disk space
diff Display the differences between two files
diff3 Show differences among three files
dig DNS lookup
dir Briefly list directory contents
dircolors Colour setup for `ls'
dirname Convert a full pathname to just a path
dirs Display list of remembered directories
dmesg Print kernel & driver messages
du Estimate file space usage
e
echo Display message on screen •
egrep Search file(s) for lines that match an extended
expression
eject Eject removable media
enable Enable and disable builtin shell commands •
env Environment variables
ethtool Ethernet card settings
eval Evaluate several commands/arguments
exec Execute a command
exit Exit the shell
expect Automate arbitrary applications accessed over a terminal
expand Convert tabs to spaces
export Set an environment variable
expr Evaluate expressions
f
false Do nothing, unsuccessfully
fdformat Low-level format a floppy disk
fdisk Partition table manipulator for Linux
fg Send job to foreground
fgrep Search file(s) for lines that match a fixed string
file Determine file type
find Search for files that meet a desired criteria
fmt Reformat paragraph text
fold Wrap text to fit a specified width.
for Expand words, and execute commands
format Format disks or tapes
free Display memory usage
GOOD LUCK!
CIT-333,323
Author M SHUMRAIZ SHARIF
ABBAS COLLEGE OF TECHNOLOGY
13-B Lake Road Lahore.