際際滷

際際滷Share a Scribd company logo
SUBMITTED BY: M. UBAID ASHRAF
REG. NUMBER: 20-CP-09
SUBMITTED TO: SIR ADNAN MUSTAFA
SECTION: ALPHA
SEMESTER: 4th
ASSIGNMENT NO. 1
UNIVERSITY OF ENGINEERING & TECHNOLOGY,
TAXILA
1: Display your current directory.
2: Change to the /etc directory.
3: Go to the parent directory of the current directory.
4: Go to the root directory.
5: List the contents of root directory.
6: List a long listing of the root directory.
7: Stay where you are, and list the contents of /etc
8: Stay where you are and list the contents of /bin and /sbin.
Assignment OS LAB 2022
9: Stay where you are, and list the contents of ~
10:List all the files (including hiddenfiles) inyour home directory.
11:List the files in/boot in a human readable format.
12: Create a directory testdir in your home directory.
13: Change to the /etc directory, stay here and create a directory newdir inyour
home directory.
14: Display the absolute path of your home directory.
15: Create a new subdirectory called COP3353-temp in your home directory.
16: Create a new subdirectory called assign1 in COP3353-temp
a. Create a new subdirectory called assign2 in COP3353-temp.
b. Display the contents of the directory COP3353-temp
c. Delete the directory assign2
d. Display the contents of COP3353-temp
e. Change your current working directory to COP3353-temp.
f. Create a newfile calledMyFile.txtusing the touchcommand and insert
two lines into the file.
a) Thefirstlineshould bea sentencethat tells meyourfavoritemovie.
b) The second line should be a sentence that tells me your favorite
food.
After creating the file using touch command, I use gedit command
to insert two lines into the file and display the content of file using
cat command.
17:Write a shell script tocalculate asimple interest.
Code for calculating simple interest:
echo " Enter the principle value: "
read p
echo " Enter the rate of interest:"
read r
echo " Enter the time period:"
read t
i=`expr $p * $t * $r / 100`
echo " The simple interest is "
echo $i
18: What is the purpose of following commands? Discuss in detail.
 Kill:
kill command in Linux (located in /bin/kill), is a built-in command which is
used to terminate processes manually. kill command sends a signal to a
process which terminates the process.
 Grep:
The grepcommand whichstandsfor global regularexpressionprint,processestextline
by line andprintsanylineswhichmatchaspecifiedpattern.The grepcommandisusedto
search text or searches the given file for lines containing a match to the given strings or
words.
 Tail:
Linux tail command is used to display the last ten lines of one or more
files. Its main purpose is to read the error message. By default, it
displaysthe lastten lines of a file. Additionally, it is used to monitor the
file changes in real-time.
 Head:
The head command is a command-line utility for outputting the first
part of files given to it via standard input. It writes results to standard
output. By default, head returns the first ten lines of each file that it is
given.
 Chmod:
The Linuxcommand chmod allows you to controlexactly who is able to
read, edit, or run yourfiles. Chmod is an abbreviation forchangemode;
if you ever need to say it out loud, justpronounceit exactly as it looks:
ch'-mod.
 Touch:
It is used to create a file without any content. The file created using
touch command is empty. This command can be used when the user
doesnt have data to store at the time of file creation.
 History:
The history command in Linux allows us to view the history of the
commands that we run in the terminal. You can set the maximum
number of entries BASH should storeas history in your . bashrc file. For
most Linux users, using the command line is a daily activity.
 Pr:
In Linux pr command is used to prepare a file for printing by adding
suitable footers,headers,and the formatted text. pr commandactually
adds 5 lines of margin both at the top and bottom of the page.
 Sudo:
Sudo stands for SuperUser DO and is used to access restricted files and
operations. By default, Linux restricts access to certain parts of the
system preventing sensitive files from being compromised.
 Lp:
In Linux, we use lp command to print the files of any mode i.e.
landscape or portrait, multiple copies or single copies and so on.
 Apt-get:
apt-get is a command-line tool which helps in handling packages in
Linux. Its main task is to retrieve the information and packages from
the authenticated sources for installation, upgrade and removal of
packages along with their dependencies.
 Tar:
The Linux 'tar' stands for tape archive, is used to create Archive and
extract the Archive files. tar command in Linux is one of the important
command which provides archiving functionality in Linux.
 Sed:
SED command in linux is for substitution or for find and replace. By
using SED you can edit files even withoutopening them, which is much
quicker way to find and replace something in file, than first opening
that file in VI Editor and then changing it. SED is a powerfultext stream
editor.
 Sort:
The sortcommand is used in Linux to print the output of a file in given
order. This command processes on your data (thecontent of the file or
output of any command) and reorders it in the specified way, which
helps us to read the data efficiently.
 Gzip:
Gzip (GNUzip)is a freeand open sourcealgorithmforfile compression.
The software is overseen by the GNU project. In this context,
compression is the deliberate reduction in sizeof data to savestorage
space or increase the data transfer rate.

More Related Content

What's hot (8)

Bt 1: Stakes and batterboards
Bt 1: Stakes and batterboardsBt 1: Stakes and batterboards
Bt 1: Stakes and batterboards
Tabitha Fuentebella
Welding symbol
Welding symbolWelding symbol
Welding symbol
Tori Tom
Thesis proposal
Thesis proposalThesis proposal
Thesis proposal
Bidur Khadka
Technical report writing and research methodology course
Technical report writing and research methodology courseTechnical report writing and research methodology course
Technical report writing and research methodology course
Nahom Balcha
A report about crippled research culture in pakistan
A report about crippled research culture in pakistanA report about crippled research culture in pakistan
A report about crippled research culture in pakistan
Danyal Ahmad
Nuts bolts-screws-washers
Nuts bolts-screws-washersNuts bolts-screws-washers
Nuts bolts-screws-washers
Obuekwec
Simple welded connection using Fillet weld
Simple welded connection using Fillet weldSimple welded connection using Fillet weld
Simple welded connection using Fillet weld
SHUBHAM SINGH
Techinal reports writing
Techinal reports writingTechinal reports writing
Techinal reports writing
MAbdurRehmanArshad
Bt 1: Stakes and batterboards
Bt 1: Stakes and batterboardsBt 1: Stakes and batterboards
Bt 1: Stakes and batterboards
Tabitha Fuentebella
Welding symbol
Welding symbolWelding symbol
Welding symbol
Tori Tom
Thesis proposal
Thesis proposalThesis proposal
Thesis proposal
Bidur Khadka
Technical report writing and research methodology course
Technical report writing and research methodology courseTechnical report writing and research methodology course
Technical report writing and research methodology course
Nahom Balcha
A report about crippled research culture in pakistan
A report about crippled research culture in pakistanA report about crippled research culture in pakistan
A report about crippled research culture in pakistan
Danyal Ahmad
Nuts bolts-screws-washers
Nuts bolts-screws-washersNuts bolts-screws-washers
Nuts bolts-screws-washers
Obuekwec
Simple welded connection using Fillet weld
Simple welded connection using Fillet weldSimple welded connection using Fillet weld
Simple welded connection using Fillet weld
SHUBHAM SINGH

Similar to Assignment OS LAB 2022 (20)

The structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformaticsThe structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformatics
BITS
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
chockit88
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.ppt
KiranMantri
Linuxppt
LinuxpptLinuxppt
Linuxppt
poornima sugumaran
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
LuigysToro
Linuxppt
LinuxpptLinuxppt
Linuxppt
Reka
18 LINUX OS.pptx Linux command is basic isma
18 LINUX OS.pptx Linux command is basic isma18 LINUX OS.pptx Linux command is basic isma
18 LINUX OS.pptx Linux command is basic isma
perweeng31
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
linux-lecture4.pptuyhbjhbiibihbiuhbbihbilinux-lecture4.pptuyhbjhbiibihbiuhbbihbi
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
YajnadattaPattanayak
Linux basic
Linux basicLinux basic
Linux basic
Pragyagupta37
Linuxppt
LinuxpptLinuxppt
Linuxppt
poornima sugumaran
Directories description
Directories descriptionDirectories description
Directories description
Dr.M.Karthika parthasarathy
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
Sreenatha Reddy K R
TERMINAL COMMANDS IN LINUX TERMINAL USED TO INTERACT WITH SYSTEM
TERMINAL COMMANDS IN LINUX TERMINAL USED TO INTERACT WITH SYSTEMTERMINAL COMMANDS IN LINUX TERMINAL USED TO INTERACT WITH SYSTEM
TERMINAL COMMANDS IN LINUX TERMINAL USED TO INTERACT WITH SYSTEM
pssafvan97
Linux
LinuxLinux
Linux
Rathan Raj
Introduction to the linux command line.pdf
Introduction to the linux command line.pdfIntroduction to the linux command line.pdf
Introduction to the linux command line.pdf
CesleySCruz
OS-Module 2 Linux Programming Important topics
OS-Module 2 Linux Programming Important topicsOS-Module 2 Linux Programming Important topics
OS-Module 2 Linux Programming Important topics
JithinS34
Linux week 2
Linux week 2Linux week 2
Linux week 2
Vinoth Sn
Linux
LinuxLinux
Linux
nazeer pasha
Linux Systems Programming: File Handling
Linux Systems Programming: File HandlingLinux Systems Programming: File Handling
Linux Systems Programming: File Handling
RashidFaridChishti
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdfLinux Cheat Sheet.pdf
Linux Cheat Sheet.pdf
roschahacker
The structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformaticsThe structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformatics
BITS
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
chockit88
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.ppt
KiranMantri
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
LuigysToro
Linuxppt
LinuxpptLinuxppt
Linuxppt
Reka
18 LINUX OS.pptx Linux command is basic isma
18 LINUX OS.pptx Linux command is basic isma18 LINUX OS.pptx Linux command is basic isma
18 LINUX OS.pptx Linux command is basic isma
perweeng31
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
linux-lecture4.pptuyhbjhbiibihbiuhbbihbilinux-lecture4.pptuyhbjhbiibihbiuhbbihbi
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
YajnadattaPattanayak
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
Sreenatha Reddy K R
TERMINAL COMMANDS IN LINUX TERMINAL USED TO INTERACT WITH SYSTEM
TERMINAL COMMANDS IN LINUX TERMINAL USED TO INTERACT WITH SYSTEMTERMINAL COMMANDS IN LINUX TERMINAL USED TO INTERACT WITH SYSTEM
TERMINAL COMMANDS IN LINUX TERMINAL USED TO INTERACT WITH SYSTEM
pssafvan97
Introduction to the linux command line.pdf
Introduction to the linux command line.pdfIntroduction to the linux command line.pdf
Introduction to the linux command line.pdf
CesleySCruz
OS-Module 2 Linux Programming Important topics
OS-Module 2 Linux Programming Important topicsOS-Module 2 Linux Programming Important topics
OS-Module 2 Linux Programming Important topics
JithinS34
Linux week 2
Linux week 2Linux week 2
Linux week 2
Vinoth Sn
Linux Systems Programming: File Handling
Linux Systems Programming: File HandlingLinux Systems Programming: File Handling
Linux Systems Programming: File Handling
RashidFaridChishti
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdfLinux Cheat Sheet.pdf
Linux Cheat Sheet.pdf
roschahacker

Recently uploaded (20)

Hackathon-Problem-Statements-Technology-Track-with-Link.pptx
Hackathon-Problem-Statements-Technology-Track-with-Link.pptxHackathon-Problem-Statements-Technology-Track-with-Link.pptx
Hackathon-Problem-Statements-Technology-Track-with-Link.pptx
datahiverecruitment
GRAPHS AND DISCONTINUITIES POWERPOINT.pptx
GRAPHS AND DISCONTINUITIES POWERPOINT.pptxGRAPHS AND DISCONTINUITIES POWERPOINT.pptx
GRAPHS AND DISCONTINUITIES POWERPOINT.pptx
ChrisPuyoc1
Crude-Oil-System for oil and gas industry
Crude-Oil-System for oil and gas industryCrude-Oil-System for oil and gas industry
Crude-Oil-System for oil and gas industry
Okeke Livinus
NBA Criteria TIER I and TIER II Comparison
NBA Criteria TIER I and TIER II ComparisonNBA Criteria TIER I and TIER II Comparison
NBA Criteria TIER I and TIER II Comparison
Dr INBAMALAR T M
Production Planning & Control and Inventory Management.pptx
Production Planning & Control and Inventory Management.pptxProduction Planning & Control and Inventory Management.pptx
Production Planning & Control and Inventory Management.pptx
VirajPasare
applicationof differential equation.pptx
applicationof differential equation.pptxapplicationof differential equation.pptx
applicationof differential equation.pptx
PPSTUDIES
Project Manager | Integrated Design Expert
Project Manager | Integrated Design ExpertProject Manager | Integrated Design Expert
Project Manager | Integrated Design Expert
BARBARA BIANCO
Virtual Power plants-Cleantech-Revolution
Virtual Power plants-Cleantech-RevolutionVirtual Power plants-Cleantech-Revolution
Virtual Power plants-Cleantech-Revolution
Ashoka Saket
CCNA_Product_OverviewCCNA_Productsa.pptx
CCNA_Product_OverviewCCNA_Productsa.pptxCCNA_Product_OverviewCCNA_Productsa.pptx
CCNA_Product_OverviewCCNA_Productsa.pptx
UdayakumarAllimuthu
Scalling Rails: The Journey to 200M Notifications
Scalling Rails: The Journey to 200M NotificationsScalling Rails: The Journey to 200M Notifications
Scalling Rails: The Journey to 200M Notifications
Gustavo Araujo
Lecture 16 - 17 - NonTraditional Machining Presentation.ppt
Lecture 16 - 17 - NonTraditional Machining Presentation.pptLecture 16 - 17 - NonTraditional Machining Presentation.ppt
Lecture 16 - 17 - NonTraditional Machining Presentation.ppt
INSTITUTE OF ENGINEERING /BKC
Cloudera Partner Network Enablement Full.pdf
Cloudera Partner Network Enablement Full.pdfCloudera Partner Network Enablement Full.pdf
Cloudera Partner Network Enablement Full.pdf
Nguy畛n H畉i
Introduction to 3D Printing Technology.pptx
Introduction to 3D Printing Technology.pptxIntroduction to 3D Printing Technology.pptx
Introduction to 3D Printing Technology.pptx
pprakash21252
UHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptx
UHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptxUHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptx
UHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptx
ariomthermal2031
Disruption channel in business model innovation topic
Disruption channel in business model innovation topicDisruption channel in business model innovation topic
Disruption channel in business model innovation topic
anandraj930873
PLANT CELL REACTORS presenation PTC amity
PLANT CELL REACTORS presenation PTC amityPLANT CELL REACTORS presenation PTC amity
PLANT CELL REACTORS presenation PTC amity
UrjaMoon
UHV Unit - 4 HARMONY IN THE NATURE AND EXISTENCE.pptx
UHV Unit - 4 HARMONY IN THE NATURE AND EXISTENCE.pptxUHV Unit - 4 HARMONY IN THE NATURE AND EXISTENCE.pptx
UHV Unit - 4 HARMONY IN THE NATURE AND EXISTENCE.pptx
ariomthermal2031
Telehealth technology A new horizon in health care
Telehealth technology  A new horizon in health careTelehealth technology  A new horizon in health care
Telehealth technology A new horizon in health care
Dr INBAMALAR T M
Introduction to Forensic Research Digital Forensics
Introduction to Forensic Research Digital ForensicsIntroduction to Forensic Research Digital Forensics
Introduction to Forensic Research Digital Forensics
SaanviMisar
271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ
271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ
271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ
QualityManager48
Hackathon-Problem-Statements-Technology-Track-with-Link.pptx
Hackathon-Problem-Statements-Technology-Track-with-Link.pptxHackathon-Problem-Statements-Technology-Track-with-Link.pptx
Hackathon-Problem-Statements-Technology-Track-with-Link.pptx
datahiverecruitment
GRAPHS AND DISCONTINUITIES POWERPOINT.pptx
GRAPHS AND DISCONTINUITIES POWERPOINT.pptxGRAPHS AND DISCONTINUITIES POWERPOINT.pptx
GRAPHS AND DISCONTINUITIES POWERPOINT.pptx
ChrisPuyoc1
Crude-Oil-System for oil and gas industry
Crude-Oil-System for oil and gas industryCrude-Oil-System for oil and gas industry
Crude-Oil-System for oil and gas industry
Okeke Livinus
NBA Criteria TIER I and TIER II Comparison
NBA Criteria TIER I and TIER II ComparisonNBA Criteria TIER I and TIER II Comparison
NBA Criteria TIER I and TIER II Comparison
Dr INBAMALAR T M
Production Planning & Control and Inventory Management.pptx
Production Planning & Control and Inventory Management.pptxProduction Planning & Control and Inventory Management.pptx
Production Planning & Control and Inventory Management.pptx
VirajPasare
applicationof differential equation.pptx
applicationof differential equation.pptxapplicationof differential equation.pptx
applicationof differential equation.pptx
PPSTUDIES
Project Manager | Integrated Design Expert
Project Manager | Integrated Design ExpertProject Manager | Integrated Design Expert
Project Manager | Integrated Design Expert
BARBARA BIANCO
Virtual Power plants-Cleantech-Revolution
Virtual Power plants-Cleantech-RevolutionVirtual Power plants-Cleantech-Revolution
Virtual Power plants-Cleantech-Revolution
Ashoka Saket
CCNA_Product_OverviewCCNA_Productsa.pptx
CCNA_Product_OverviewCCNA_Productsa.pptxCCNA_Product_OverviewCCNA_Productsa.pptx
CCNA_Product_OverviewCCNA_Productsa.pptx
UdayakumarAllimuthu
Scalling Rails: The Journey to 200M Notifications
Scalling Rails: The Journey to 200M NotificationsScalling Rails: The Journey to 200M Notifications
Scalling Rails: The Journey to 200M Notifications
Gustavo Araujo
Lecture 16 - 17 - NonTraditional Machining Presentation.ppt
Lecture 16 - 17 - NonTraditional Machining Presentation.pptLecture 16 - 17 - NonTraditional Machining Presentation.ppt
Lecture 16 - 17 - NonTraditional Machining Presentation.ppt
INSTITUTE OF ENGINEERING /BKC
Cloudera Partner Network Enablement Full.pdf
Cloudera Partner Network Enablement Full.pdfCloudera Partner Network Enablement Full.pdf
Cloudera Partner Network Enablement Full.pdf
Nguy畛n H畉i
Introduction to 3D Printing Technology.pptx
Introduction to 3D Printing Technology.pptxIntroduction to 3D Printing Technology.pptx
Introduction to 3D Printing Technology.pptx
pprakash21252
UHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptx
UHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptxUHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptx
UHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptx
ariomthermal2031
Disruption channel in business model innovation topic
Disruption channel in business model innovation topicDisruption channel in business model innovation topic
Disruption channel in business model innovation topic
anandraj930873
PLANT CELL REACTORS presenation PTC amity
PLANT CELL REACTORS presenation PTC amityPLANT CELL REACTORS presenation PTC amity
PLANT CELL REACTORS presenation PTC amity
UrjaMoon
UHV Unit - 4 HARMONY IN THE NATURE AND EXISTENCE.pptx
UHV Unit - 4 HARMONY IN THE NATURE AND EXISTENCE.pptxUHV Unit - 4 HARMONY IN THE NATURE AND EXISTENCE.pptx
UHV Unit - 4 HARMONY IN THE NATURE AND EXISTENCE.pptx
ariomthermal2031
Telehealth technology A new horizon in health care
Telehealth technology  A new horizon in health careTelehealth technology  A new horizon in health care
Telehealth technology A new horizon in health care
Dr INBAMALAR T M
Introduction to Forensic Research Digital Forensics
Introduction to Forensic Research Digital ForensicsIntroduction to Forensic Research Digital Forensics
Introduction to Forensic Research Digital Forensics
SaanviMisar
271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ
271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ
271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ
QualityManager48

Assignment OS LAB 2022

  • 1. SUBMITTED BY: M. UBAID ASHRAF REG. NUMBER: 20-CP-09 SUBMITTED TO: SIR ADNAN MUSTAFA SECTION: ALPHA SEMESTER: 4th ASSIGNMENT NO. 1 UNIVERSITY OF ENGINEERING & TECHNOLOGY, TAXILA
  • 2. 1: Display your current directory. 2: Change to the /etc directory. 3: Go to the parent directory of the current directory. 4: Go to the root directory. 5: List the contents of root directory. 6: List a long listing of the root directory.
  • 3. 7: Stay where you are, and list the contents of /etc
  • 4. 8: Stay where you are and list the contents of /bin and /sbin.
  • 6. 9: Stay where you are, and list the contents of ~ 10:List all the files (including hiddenfiles) inyour home directory. 11:List the files in/boot in a human readable format.
  • 7. 12: Create a directory testdir in your home directory. 13: Change to the /etc directory, stay here and create a directory newdir inyour home directory. 14: Display the absolute path of your home directory. 15: Create a new subdirectory called COP3353-temp in your home directory.
  • 8. 16: Create a new subdirectory called assign1 in COP3353-temp a. Create a new subdirectory called assign2 in COP3353-temp. b. Display the contents of the directory COP3353-temp c. Delete the directory assign2
  • 9. d. Display the contents of COP3353-temp e. Change your current working directory to COP3353-temp. f. Create a newfile calledMyFile.txtusing the touchcommand and insert two lines into the file. a) Thefirstlineshould bea sentencethat tells meyourfavoritemovie. b) The second line should be a sentence that tells me your favorite food. After creating the file using touch command, I use gedit command to insert two lines into the file and display the content of file using cat command. 17:Write a shell script tocalculate asimple interest. Code for calculating simple interest: echo " Enter the principle value: " read p echo " Enter the rate of interest:" read r
  • 10. echo " Enter the time period:" read t i=`expr $p * $t * $r / 100` echo " The simple interest is " echo $i 18: What is the purpose of following commands? Discuss in detail. Kill: kill command in Linux (located in /bin/kill), is a built-in command which is used to terminate processes manually. kill command sends a signal to a process which terminates the process. Grep: The grepcommand whichstandsfor global regularexpressionprint,processestextline by line andprintsanylineswhichmatchaspecifiedpattern.The grepcommandisusedto search text or searches the given file for lines containing a match to the given strings or words. Tail: Linux tail command is used to display the last ten lines of one or more files. Its main purpose is to read the error message. By default, it displaysthe lastten lines of a file. Additionally, it is used to monitor the file changes in real-time. Head: The head command is a command-line utility for outputting the first part of files given to it via standard input. It writes results to standard output. By default, head returns the first ten lines of each file that it is given. Chmod: The Linuxcommand chmod allows you to controlexactly who is able to read, edit, or run yourfiles. Chmod is an abbreviation forchangemode; if you ever need to say it out loud, justpronounceit exactly as it looks: ch'-mod. Touch: It is used to create a file without any content. The file created using touch command is empty. This command can be used when the user doesnt have data to store at the time of file creation. History:
  • 11. The history command in Linux allows us to view the history of the commands that we run in the terminal. You can set the maximum number of entries BASH should storeas history in your . bashrc file. For most Linux users, using the command line is a daily activity. Pr: In Linux pr command is used to prepare a file for printing by adding suitable footers,headers,and the formatted text. pr commandactually adds 5 lines of margin both at the top and bottom of the page. Sudo: Sudo stands for SuperUser DO and is used to access restricted files and operations. By default, Linux restricts access to certain parts of the system preventing sensitive files from being compromised. Lp: In Linux, we use lp command to print the files of any mode i.e. landscape or portrait, multiple copies or single copies and so on. Apt-get: apt-get is a command-line tool which helps in handling packages in Linux. Its main task is to retrieve the information and packages from the authenticated sources for installation, upgrade and removal of packages along with their dependencies. Tar: The Linux 'tar' stands for tape archive, is used to create Archive and extract the Archive files. tar command in Linux is one of the important command which provides archiving functionality in Linux. Sed: SED command in linux is for substitution or for find and replace. By using SED you can edit files even withoutopening them, which is much quicker way to find and replace something in file, than first opening that file in VI Editor and then changing it. SED is a powerfultext stream editor. Sort: The sortcommand is used in Linux to print the output of a file in given order. This command processes on your data (thecontent of the file or output of any command) and reorders it in the specified way, which helps us to read the data efficiently.
  • 12. Gzip: Gzip (GNUzip)is a freeand open sourcealgorithmforfile compression. The software is overseen by the GNU project. In this context, compression is the deliberate reduction in sizeof data to savestorage space or increase the data transfer rate.