Professional Documents
Culture Documents
1) Just like Windows and Mac, Linux is an operating system. An operating system is
a software that manages all the resources of a computer. It is first and the most
important program that runs on the computer and remains active till the machine is
on.
2) Free and Open source software which means it is free to download and use. It's
source code is freely available for anyone to view, modify and distribute.
3) It is based on the Unix system. Most of the commands used on Unix and Linux are
same. There is no much differene between them and learning one is eqaully learning
other.
Who Created?
1) It is powerful operating system and is popular and widely used because of it's
Effeciency, Reliablity and Security.
2) It is a cross platform compatable. Run on great variety of hardware
platforms(Desktops, Laptops, Servers)
3) Multiuser and multitasking system.
a) Multiuser: means multiple users can work on the system and can access system
resources like printers, memory, hard-disk etc at the same time. There can be
different user accounts that are password protected and each User gets a home
directory for storing the files.
b) Multitasking: which means different applications can run at the same time.
Components of Linux:
The main component of the Linux is the Kernel. It is the lowest level of the OS and
it controls the computer resources like CPU memory and other devices.
It is the core of the system and is actually between the hardware and the software
applications.
The kernel directly communicates with the hardware but it does not directly deals
with the user. It starts a seperate interactive program called SHELL.
Shell acts as the interface between the user and the system.
Shell is a command interpreter that takes a command from user and translate them
into action.
When a user login in the kernel starts a seperate Shell process for the user. So,
Shell interacts with the User and kernel with the hardware.
Different types of Shells were developed for Linux like BASH(Bourne Again shell), C
shell, Korn shell, Z shell. All have different characteristics and we need one of
them.
Most distributions include all shell and by default we run the BASH shell.
Utilities:
Then we have the supporting utilities, system libraries and the application
programs.
Most of the utilites for Linux are written and distributed free by GNU.
Shell is also a special interactive utility.
Linux Distributions:
a) It is a complete Linux system package that contains the Linux kernel, utilities,
libraries and application programs specific to the distribution.
Distributions may include compilers, browsers, text editors, media softwares,
development tools etc.
b) Since, linux is freely re-distributable many distributions are created by many
vendors and communities and each distribution is intended to meet the requriments
of diiferent types of users. We can treat distributions as different versions of
linux that combined linux kernel with their own specialized utilities.
c) Desktop use and Server use
d) Commercial and Non-commercial Distributions
e) one standard version of kernel and many types of distributions.
Graphical Interface:
Installing Linux:
Virtualization:
It allows you to create virtual computers within your physical computer(we can run
more than one OS on machine at the same time)
The Virtual computer which we created on Physical computer is called as Virtual
Machine
Each Virtual Machine acts as a standalone computer and can run its own OS
The OS of physical computer is called as Host OS and the OS's which run inside OS
are Guest OS.
A Guest OS run in the window of Host OS like an other application
TO implement Virtualization we need a Virtualization software application - Oracle
VM Virtual Box
All the files in the Linux OS are organised into Directories. A directory is a
container that contains other directories and files. In windows we use the word
folder and in Linux we call it as Directory.
- The First directory in the directory structure is the Root directory and it
represented by a Forward slash(/).
- All other directories and files in the Linux system are presented inside the Root
directory. So, everything in the Linux system begins with the Root directory.
- Inside the Root directory we will have several directories and some of the common
ones are
a) bin : contains the executable commands and utilities
b) etc : contains system configuration files
c) dev: contains file interfaces for different devices
d) home: contains user home directories
e) opt : contains commercial s/w products that are not installed by default on the
system
f) sbin: contains programs for performing admin level system tasks such as N/W
management and disk partioning
g) tmp: contains temperory files created by various programs, it is generally
cleared on reboot should not store anything which is important
h) usr: contains user related programs and data files
i) var: contains files that change frequently such as log files and DB's
- Linux filesystem names are based on the FHS which is updated occasionally. we can
check the names at the site of FHS.
- Like home directory all the directories will have sub-directories. so all the
directories and files are connected in a Hierachial structure.
- The Hierachial structure will be resembles in a inverted tree. so it is also
reffered to as Directory tree.
- Everything in linux can be viewed as file. Linux treats everything as file so the
directory structure is also referred to as FileSystem.
Pathnames:
Commands:
Linux Commands
who command: tell us about user who logged in and the time
cal command: gives the calendar
cal month year command: gives the calendar of that particular year
Eg: cal 4 1991
Eg: cal apr 1991
Changing Directories:
cd command: used for navigation between directories and folders
cd .. : will takes us to the previous directory
cd / :will take us to the root directory
cd ~/ : takes us to the home directory
cd without any argument, then home directory becomes current directory. So, cd
followed by nothing takes us to home directory.
cd - : take us to the previous working directory
Creating Directories:
mkdir command is used to create directories.
Eg: mkdir followed by directory name creates the directory
mkdir d1
We can make directory trees with single mkdir command
Eg: mkdir d1 d1/d1A d1/d1B
The other way of creating direcorty trees is by using -p option
If we want to create a directory inside directory then we should use the following
command.
Eg: mkdir -p dirA/dirA1/dirA2 (nested directories)
Eg: mkdir -p dir1/dir1A1/dir1B - If the directories are not available it will
create all the directories.
Eg: -rw-rw-r-- 1 owner (group of the file) file size month date time
file name/directory
drwxrwxr-x
First char represents the file type
d for directory
- for ordinary file
After the first character, the remaining 9 characters shows the permissions of the
file.
Number represents the links of the file
more filename
less filename
To view the content of file top and bottom we can use head and tail command. Both
the commands displays 10 lines of the file
head filename
tail filename
If we want to append the content of two files into a new single file then the
following command is used
cat file1 file2 > file3
If we want to append the content of file1 into file2 then the following command is
used
cat file1 >> file2
nano Editor:
WildCards:
Wildcards are special symbols that are used to form patterns that match a group of
file names.
WildCards using sometimes called Globbing
Wildcard characters are called Globs
Globbing - Process of pattern matching with wildcards
[]:character class
Eg: Five character filenames that begin with the poem and end in A, B, C, D, E -
poem[A, B, C, D, E]
Filenames that start with a letter from a to k and end with a digit - [a-
k]*[0-9]
Filenames that start with any letter from a to k 0r u to z and end with a
digit - [a-ku-z]*[0-9]
Filenames that don't start with an x,y,z - [!xyz]*
Filenames that don't begin with a digit - [!0-9]*
Links:
ln command allows us to give more than one name to a file
Linux supports two links 1) Hard Link 2) Symbolic/Soft Link
Hard Link : $ln filename linkname
Soft Link : $ln -s filename linkname
Symbolic links are created across different filesystems while Hard links are
created only inside local filesystem.
We cannot create Hard links for directories while Symbolic links are created for
directories
Comparing Files:
cmp command: $cmp file1 file2
detail list: $cmp -l file1 file2
Paste:
$paste file1,file2,file3......
paste -d"|" f1.txt f2.txt f3.txt
-s paste together lines from the same file
Sorting files:
$sort filename
df command : datafile system, gives the memory used and how much is left and where
it is mounted
Vi Editor: