0% found this document useful (0 votes)
21 views8 pages

Linux Notes Unit 1

The document provides an overview of Linux, detailing its origins, features, advantages, and disadvantages, as well as its architecture and file system structure. It discusses various Linux distributions, the boot process, and common commands used in Linux administration. Additionally, it compares Linux with Unix, explains the Linux file system layout, and lists essential commands for file management and system operations.

Uploaded by

padickalhouse123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views8 pages

Linux Notes Unit 1

The document provides an overview of Linux, detailing its origins, features, advantages, and disadvantages, as well as its architecture and file system structure. It discusses various Linux distributions, the boot process, and common commands used in Linux administration. Additionally, it compares Linux with Unix, explains the Linux file system layout, and lists essential commands for file management and system operations.

Uploaded by

padickalhouse123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

CSCRT10: Linux Administration (Core)

UNIT I. Overview of Linux


What is Linux?
Linux is a free and open source Operating System Software developed primarily by Linus Torvald.
Linux’s root in Unix. Linux was developed with the help of many unix programmers and wizards
across the internet. Linux allows any one with enough knowledge to develop and change the
system.

Booting: Linux boot process is the initialization of the Linux Open Source OS on a Computer.

Various linux distributions are available today. Some of them are


• Ubuntu
• Fedora
• Open SUSE
• RedHat Linux
• Mandrake Linux
• Debian
• Slackware
• Knoppix

( Other distributions are : Arch linux, Kali linux, Yellow Dog, Gento linux, Scientific linux, Centos, Void linux,
Alphine linux, Parrot os, Vine linux, Black arch, Bodhi linux, Pardus, Sabayo, Linux Endeavour OS, Kubuntu,
Garuda etc)
You can use Linux as Server OS or as a Standalone OS on your PC. It is best suited for Server.
Linux is a multi user & multi tasking OS.

Common Linux Features:


• Open Source: Linux code is freely available to all and is a community based development
project.
• Multi User capability: Multiple users can access the same system resources like memory, hard
disk, etc. But they have to use different terminals to operate.
• Multitasking: More than one function can be performed simultaneously by dividing the CPU time
intelligently.
• Portability: Portability doesn’t mean it is smaller in file size or can be carried in pen drives or
memory cards. It means that it supports different types of hardware.
• Security: It provides security in three ways namely authenticating (by assigning password and
login ID), authorization (by assigning permission to read, write and execute) and encryption
(converts file into an unreadable format).
• Live CD/USB: Almost all Linux distributions provide live CD/USB so that users can run it without
installing it.
• Graphical User Interface (X Window system): Linux is command line based OS but it can be
converted to GUI based by installing packages.
• Support’s customized keyboard: As it is used worldwide, Linux supports different languages
keyboards.
• Application support: It has its own software repository from where users can download and
install many applications.
• File System: Provides a hierarchical file system in which files and directories are arranged. •
Interoperability: Linux works with various software, file formats, and systems, promoting open
standards and collaboration across diverse environments.
• Virtualization: Linux Virtualization provides the suppleness to create a new environment with an
existing physical box with the use of applications.

1
Advantages of Linux:
● Free – Most Linux distributions are free, users do not need to pay for a copy. Linux
distributions can be freely downloaded and legally installed on as many as you want and
freely (and legally) given to other people.
● Open Source – You have access to the source code and can customize Linux to be whatever
you want it to be. Linux is easy to install.
● Linux is very stable – Linux systems rarely crash, and when they do, the whole system
normally does not go down.
● Linux is not easily affected by computer malware – Infection with virus, spyware, Trojans,
and worms is considerably less for Linux. Also security updates normally come much quicker
to Linux than other operating systems because so many people are contributing to it.
● Linux does not have a registry like windows. So it is not troubled with registry errors which
can slow down a computer.
● Linux runs faster on even old computers. Linux runs great on newer computers as well.
● Linux offers a wide variety from which to choose the distribution.
● Linux is easier than other operating systems to use and install.
● Easier to upgrade than other operating systems.
● Linux in Outer Space : NASA’s Mars ExplorationRovers use Linux for Planning, Simulation,
Visualization, etc
● Linux in Gadgets: Embedded Linux Systems are used in Mobile Phones, Sony Play Stations,
notesbooks and PDAs.
● Linux in projects: Myth TV - gathers TV channel listing for your area, select shows you want
to view, record, playback etc.
● Linux Terminal Server Project: Workstations for Schools or small business.
● Linux toys: You can build your own gaming console.

Disadvantages of Linux:
● Many Windows programs will not run in Linux. Microsoft Office, Internet Explorer and many
other Windows programs will not run natively in Linux.
● There is a smaller selection of peripheral hardware drivers for Linux.
● Gaming software are less compared to Windows.

Unix and Linux Architecture

2
The functioning of Unix and Linux are managed in 3 levels:
1. Application programs and other utilities are in the outer level. They speak our language.
2. Shell is the command interpreter. It interprets commands that we give and then conveys them to
the kernel which executes them. Shell is in the middle layer. Shell is responsible for the
communication between the outer and inner layers..
3. Kernel is the heart of the OS. It interacts directly with the actual h/w. It is responsible for all the
major activities of the Linux OS. The Kernel has various functions like managing files, carrying out all
the data transfer between the files system and the hardware. It also manages the resources of Linux
OS (memory, cpu, etc.).

(1. What is the basic difference between Unix and Linux operating system? )

Unix Linux
1. Unix is not open source Linux is open source
2. Unix is licensed OS Linux is free to use
3. Distributions are AT&T, Ultrix, SunSolaris, Distributions are RedHat, Caldera, Debian,
Xenix, IRIX SUSE )
4. Not Portable Portable
5. High rigid hardware requirements Flexible
6. Mainly used in Server System Used in PC, mobile phone also

Linux file System


( Explain Linux file system in detail. 8 marks)
(Define the term file system 2 marks)
A file system is a group of files and relevant information regarding them. It is the way in which files
are named and where they are placed logically for storage and retrieval. Without a file system, stored
information would be difficult to identify and retrieve. Hard disk may comprise a single file system
or it may be partitioned to have several file systems. The disk space allotted to a Linux file system
is made up of "blocks" each of which is typically of 512 bytes, but may be longer or shorter.

Layout of the file system:


● Each physical drive can be divided into several partitions
● Each partition can contain one file system
● Each file system contains: boot block, superblock, inode list, data blocks.
1. A boot block may contain the bootstrap code that is read into the machine upon booting.
2. A superblock describes the state of the file system:how large it is; how many files it can
store; where to find free space on the file system; who has ownership of it; and more.
3. The inode list is an array of "information nodes". Each file or directory is uniquely identified
by its name, directory in which it resides and a unique identifier called “inode”.
4. Data blocks start at the end of the inode list and contain file data and directory blocks.
( What is a data block? 2 marks) A data block is a basic unit of data storage in a file system. It is the
smallest unit of data that can be read or written in a single operation. In most file systems, each data
block is a fixed size, typically between 512 and 4096 bytes.

Inode: An Inode is a data structure containing metadata about the files. The Inode of a file contains
Owner of the file, File size, Date of creation, Permission, Device ID, number of links, etc An Inode
number is a unique number for all the files in Linux and Unix type systems. When a file is created
on a system, a file name and Inode number is assigned to it. Generally, to access a file, a user
uses the file name but internally the file name is first mapped with respective Inode number stored
in a table.

The Linux file system is the structure in which all the information on the computer is stored. Linux
uses a hierarchical file system to organize its files. It has a root directory (/) that contains other files
and directories.
A full path or relative path can be used to refer a file or directory. In Linux there are several types of

3
files. They are:
1. Ordinary files
2. Directory files and
3. Device files (In Linux systems, the devices are considered as special files.)

/ : It is the root filesystem. It is the top-level filesystem directory. It must include every file
needed to boot the Linux system.
/boot : It has bootable Linux kernel, bootloader configuration files and executable files needed
to start a Linux computer.
/bin: This directory includes user executable files. This directory contains common linux
commands such as ls, date etc.(binary files or executable files)
/dev: It includes the device file for all hardware devices connected to the system. These aren't
device drivers; instead, they are files that indicate all devices on the system and provide
access to these devices. (such as printers,disk storage devices, terminals, modems, memory
etc. )
/etc: It contains administrative configuration files.
/home: The home directory storage is available for user files. All users have a subdirectory
inside /home.
/root: It's the home directory for a root user. Keep in mind that it's not the '/' (root) file system.
/lib: It contains shared library files needed by applications in /bin to start the system.
/tmp: It is used to store all temporary files. It is a temporary directory used by the OS and
several programs for storing temporary files. Also, users may temporarily store files here.
Remember that files may be removed without prior notice at any time in this directory.
/usr : used to store all files of user accounts.
/mnt: It is a temporary mount point for basic filesystems.
/media: A place for mounting external removable media devices like USB thumb drives that
might be linked to the host.
/opt: It contains optional files like vendor supplied application programs.
/sbin: These are system binary files. They are executables utilized for system administration.
/var: Here, variable data files are saved. It can contain things such as MySQL, log files, other
database files, email inboxes, web server data files, and much more.
Linux supported File Systems are Ext, Ext2, Ext3, Ext4, XFS, NFS, JFS etc.

4
LINUX Commands
Syntax: $ command options arguments

The Linux command is followed by options and a list of arguments. The options can modify the
behavior of a command. The arguments may be files or directories or some other data on which
the command acts. Every command might not need arguments. The options can be provided in
two ways:
(i) single letter option with a - (eg: -a, -l, -abc)

(ii) full word option with -- (eg: --help)

I. Simple Commands

1. man – It is an online help system (manual).


Syntax : man <commandname>
eg: man date

2. info – Gives help in info format. Syntax : info <commandname>


eg: info date

3. date - To display the current date and time. Syntax : date [option] [format]
eg: date
o/p: Tue Jan 9 10:55:36 IST 2024
Eg: date "+%y/%m/%d"
o/p: 24/01/09

4. cal – To display the calendar. Syntax : date [option [number]]


eg: cal : display the calendar for the current month.
cal –y : calendar is displayed for the entire current year.
cal –y 2018 : displays last year's calendar.
cal 06 2018 : calendar of 6th month of 2018 is displayed.

5. more – the output of a command can be send to the more command, using ‘|’ symbol .
The more command will allow the user to view the contents of a file one screenful at a
time.
Syntax1: more <filename>
eg: more abc.text
Syntax2: <command> | more
eg: cal –y | more

6. less – it is a more powerful command than ‘more’.


The ‘less’ command allows to use the page up and page down keys to scroll back and forth in
the output.
Syntax: less <filename>
eg: less notes.txt
Syntax: <command> | less
eg: cal –y | less

II. Creating and Viewing files using cat command:


1. cat – used to create and view files. Used to concatenate files also.
Syntax1: cat > <filename>
This command is used to input standard output into a file.
eg:1) cat > music - to create a file music from keyboard.
artist
album
playlist
Ctrl + Z

5
Suntax2: cat <filename>
eg:2) cat music - to display the contents of the file music.
Syntax3: cat <filename> . . . > <filename>

5
eg:3) cat music game > new : to concatenate multiple files (music, game) and
write into a single file.
eg:4) cat * - to display all files.

III. File commands


1. ls : list directory contents
Syntax: ls [option] [file/directory]
eg:1) ls - displays all files and directories in the current directory. Ordinary files are denoted
by white color and Directories are denoted by blue color.
Output: pictures
desktop
documents
downloads
videos
music
eg:2) ls - l : to display a long list with file permission modes. Number of links, owner, group,
size in bytes, date and time of last modification and file name.
output: drwxr -xr –x 4 casp casp 4096 NOV 16 12 : 32 Desktop
–rw –rw –r - - 1 casp casp 69 Jul 17 21 : 01 dance.pl

eg:3) ls – R : to list all files and directories recursively from current directories.

eg: 4) ls - a : In linux low level configuration file names start with a period. By default ls
does not display those files. – a option is used to display those hidden files.

eg: 5) ls – s : to list by size, print the allocated size of each file in blocks.

eg: 6) ls – F : to list files and file type indicators.


eg: 7) ls - - hide = D * : do not include files beginning with D.

eg: 8) ls - - help : to display the help screen of ls.


( - - is used to consider the following letters as a whole world)

2. cp - used to create copies of an ordinary file. The copy command is used to copy the contents of
one file to another. You can also use this command to copy a file from one directory into another.
Syntax: cp [option] <file1> <file2>
eg:1) cp music musicnew : to copymusic to musicnew
eg:2) cp file? /data : to copy the file1, file2 to data directory
eg:3) cp file1 ~ : to copy the file to home directory
eg:4) cp -i *.txt /data : i confirm each copy (interractive)

3. mv - to move or rename files.


Syntax1: mv <file1> <file2>
eg:1) mv musicnew newmusic: rename musicnew to newmusic
Syntax2: mv [option] <file1/directory> <file2/directory>
eg:2) mv -t data file1 : move file1 to data directory
eg:2) mv file3 /data : move file3 to data directory
eg:3) mv file1 ~ : move to home directory

6
4. rm - To remove a file or directory
Syntax: rm <file1>
eg:1) rm newmusic : to remove newmusic file
eg:2) rm * : to remove all files.
eg:3) rm - R : To delete the entire directory tree. (recursion)

5. cmp - To compare 2 files

6
Syntax: cmp <file1> <file2>
eg: cmp file1 file2

6. file - To find out the type of the file (text file, executable file, script file etc.)
Syntax: file <file1>
eg: file music

File matching meta characters


Meta characters are used to easily refer to a group of files.
* - Matches any number of characters
? - Matches any one character
[…] - Matches any one of the character can also include a range of letters or numbers
separated by dash

eg:1) ls f* - to list all files starting with the character ' f '
eg:2) ls a???? - to list all files starting with the character ' a ' and having 4 more characters
eg:3) ls [ab]* - to list all files starting with the letter ' a ' or ' b'
eg:4) ls [a-c]* - to list all files starting with the letter ' a ' or ' b ' or ' c '

IV. Directory commands


1. pwd - (Present working directory) To display the full path name of the present working
directory.
Syntax: pwd [option]
eg: pwd

2. mkdir - (Make directory) To create a subdirectory in the current directory.


Syntax: mkdir [directory]
eg: mkdir stud

3. cd - (change directory) Change to another directory.


Syntax: cd [directory]
eg:1) cd stud
eg:2) cd .. - To change to the parent directory.
eg:3) cd ~ - To change to home directory.
eg:4) cd / - To change to root directory.

4. rmdir - (Remove directory) To remove a directory.


Syntax: rmdir [directory]
eg: rmdir stud

7
Minimum Requirements for Linux :

Minimum Requirements for Fedora or RedHat Linux:

Processor - 400 MHz Pentium for GUI Installation


RAM - 1 GB (At least 2 or 3 GB is better)
DVD Drive - To boot up installation process
Network card - Wired or wireless; to add more software for software updates

Disk space - 10 GB for installation


Special Hardware - AMD – V or Intel VT chip for using it as a virtualization host.

There are many linux distributors for handheld devices or old PC’s (such as Damn Small Linux,
Slack ware) which require as little as 24 MB RAM and 486 process0or.

You might also like