SlideShare uma empresa Scribd logo
Enrollment No:-20020201337 Subject:-Unix
1 | P a g e
1. Write a command to delete all special character from the file
x1
$ sed ‘s/[#$@*%]//g’ d
2. To extract all username and their home directory from
/etc/passwd file
$ grep -oP '^[^:]+|.*:K[^:]+(?=:[^:]+)' /etc/passwd | perl -pe 's/n/ : / if $.%2'
3. . Count frequency of users who are logged-in from more than one terminal. $ who |
wc-l
4. Delete all leading and trailing spaces in all line of file f1.
Enrollment No:-20020201337 Subject:-Unix
2 | P a g e
$ sed 's/^[ t]*//' d
5. Display string in uppercase.
$ awk '{print toupper($0)}' d
6. Write a command to locate lines that begin and end with a
dot(.) ans containing anything between them
$ grep "^..*.$" d
$ sed -n '/^..*.$/p' d
7. Write a command to remove duplicate lines form a file
$ sed -n 's/unix/linux/p' d
8. Replace the word UNIX with Linux in between 5th to 10th
lines including both.
$ sed '5,10 s/unix/linux/' d
Enrollment No:-20020201337 Subject:-Unix
3 | P a g e
9. Remove all leading space from a file x1.
$ sed -ne 's/^[ t]*//p' d
10. To display lines of file f1 this contains pattern as user1 or
user2 or user3
$ grep -e 'user1' -e 'user2' -e 'user3' d
11. . Display a line of file f1 which contains exact 8 characters
$ grep '^.{8}$' d
Enrollment No:-20020201337 Subject:-Unix
4 | P a g e
12. Count all empty lines (consist of only new line character) of
file f2
$ grep -c '^$' d
10. To display lines of file f1 this contains pattern as user1 or
user2 or user3
$ grep -e 'user1' -e 'user2' -e 'user3' d
11. . Display a line of file f1 which contains exact 8 characters
$ grep '^.{8}$' d
Enrollment No:-20020201337 Subject:-Unix
5 | P a g e
12. Count all empty lines (consist of only new line character) of
file f2
$ grep -c '^$' d
17. Write awk script to display lines whose last word id UNIX of
file x1
$ awk '/unix$/{print}' d
Enrollment No:-20020201337 Subject:-Unix
6 | P a g e
17. Write awk script to display lines whose last word id UNIX of
file x1
$ awk '/unix$/{print}' d
Enrollment No:-20020201337 Subject:-Unix
7 | P a g e
a. Find Greatest No.
b. Palindrome No.
BEGIN{ print"main menu" ;
print"1.factorial of number" ;
print"2.Greater number" ;
print"3.palindrome of
number" ; print "Enter ur
choice" ; getline ch<"-" ;
print ch ;
if(ch==1)
{
print "enter the number" ;
getline tmp<"-" ;
c=1 ;
while(tmp != 0)
{
c=c*tmp ;
tmp-- ;
}
print c ;
}
if(ch==2)
{
print "enter first number" ;
getline a1<"-" ; print
"enter second number" ;
getline a2<"-" ; print
"enter third number" ;
Enrollment No:-20020201337 Subject:-Unix
8 | P a g e
getline a3<"-" ; if(a1>a2
&& a1>a3) print "first
number is greater " ;
if(a2>a1 && a2>a3)
print "second number is greater " ;
if(a3>a1 && a3>a2)
print "third number is greater " ;
}
if(ch==3)
{
print "enter the number" ;
getline tmp<"-" ;
a. Find Greatest No.
b. Palindrome No.
BEGIN{ print"main menu" ;
print"1.factorial of number" ;
print"2.Greater number" ;
print"3.palindrome of
number" ; print "Enter ur
choice" ; getline ch<"-" ;
print ch ;
if(ch==1)
{
print "enter the number" ;
getline tmp<"-" ;
c=1 ;
while(tmp != 0)
{
c=c*tmp ;
tmp-- ;
}
print c ;
}
if(ch==2)
{
print "enter first number" ;
getline a1<"-" ; print
"enter second number" ;
getline a2<"-" ; print
"enter third number" ;
Enrollment No:-20020201337 Subject:-Unix
9 | P a g e
getline a3<"-" ; if(a1>a2
&& a1>a3) print "first
number is greater " ;
if(a2>a1 && a2>a3)
print "second number is greater " ;
if(a3>a1 && a3>a2)
print "third number is greater " ;
}
if(ch==3)
{
print "enter the number" ;
getline tmp<"-" ;

Mais conteúdo relacionado

Semelhante a unix3.docx

Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administration
Mohammed Farrag
 
Unix lab
Unix labUnix lab
III MCS python lab (1).pdf
III MCS python lab (1).pdfIII MCS python lab (1).pdf
III MCS python lab (1).pdf
srxerox
 
lec4.docx
lec4.docxlec4.docx
lec4.docx
ismailaboshatra
 
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptx
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptxLab 4 -Linux Files, Directories and Basic Commands Part-2.pptx
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptx
Ciceer Ghimirey
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1
Leandro Lima
 
Bozorgmeh os lab
Bozorgmeh os labBozorgmeh os lab
Bozorgmeh os lab
FS Karimi
 
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfAssignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
formicreation
 
Unix lab manual
Unix lab manualUnix lab manual
Unix lab manual
Chaitanya Kn
 
RedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative worksRedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative works
Md Shihab
 
University of North Texas 2 The sed Stream Editor .docx
University of North Texas 2 The sed Stream Editor .docxUniversity of North Texas 2 The sed Stream Editor .docx
University of North Texas 2 The sed Stream Editor .docx
ouldparis
 
SL-2.pptx
SL-2.pptxSL-2.pptx
Intermediate code generation1
Intermediate code generation1Intermediate code generation1
Intermediate code generation1
Shashwat Shriparv
 
ANSHUL RANA - PROGRAM FILE.pptx
ANSHUL RANA - PROGRAM FILE.pptxANSHUL RANA - PROGRAM FILE.pptx
ANSHUL RANA - PROGRAM FILE.pptx
jeyel85227
 
C Exam Help
C Exam Help C Exam Help
C Exam Help
Programming Exam Help
 
Examples -partII
Examples -partIIExamples -partII
Examples -partII
Kedar Bhandari
 
Linux/Unix Commands
Linux/Unix CommandsLinux/Unix Commands
Linux/Unix Commands
Nikita Kesharwani
 
Beginning with vi text editor
Beginning with vi text editorBeginning with vi text editor
Beginning with vi text editor
Jose Pla
 
Linux Shell Scripts and Shell Commands✌️
Linux Shell Scripts and Shell Commands✌️Linux Shell Scripts and Shell Commands✌️
Linux Shell Scripts and Shell Commands✌️
Nazmul Hyder
 
32 shell-programming
32 shell-programming32 shell-programming
32 shell-programming
kayalkarnan
 

Semelhante a unix3.docx (20)

Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administration
 
Unix lab
Unix labUnix lab
Unix lab
 
III MCS python lab (1).pdf
III MCS python lab (1).pdfIII MCS python lab (1).pdf
III MCS python lab (1).pdf
 
lec4.docx
lec4.docxlec4.docx
lec4.docx
 
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptx
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptxLab 4 -Linux Files, Directories and Basic Commands Part-2.pptx
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptx
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1
 
Bozorgmeh os lab
Bozorgmeh os labBozorgmeh os lab
Bozorgmeh os lab
 
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfAssignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
 
Unix lab manual
Unix lab manualUnix lab manual
Unix lab manual
 
RedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative worksRedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative works
 
University of North Texas 2 The sed Stream Editor .docx
University of North Texas 2 The sed Stream Editor .docxUniversity of North Texas 2 The sed Stream Editor .docx
University of North Texas 2 The sed Stream Editor .docx
 
SL-2.pptx
SL-2.pptxSL-2.pptx
SL-2.pptx
 
Intermediate code generation1
Intermediate code generation1Intermediate code generation1
Intermediate code generation1
 
ANSHUL RANA - PROGRAM FILE.pptx
ANSHUL RANA - PROGRAM FILE.pptxANSHUL RANA - PROGRAM FILE.pptx
ANSHUL RANA - PROGRAM FILE.pptx
 
C Exam Help
C Exam Help C Exam Help
C Exam Help
 
Examples -partII
Examples -partIIExamples -partII
Examples -partII
 
Linux/Unix Commands
Linux/Unix CommandsLinux/Unix Commands
Linux/Unix Commands
 
Beginning with vi text editor
Beginning with vi text editorBeginning with vi text editor
Beginning with vi text editor
 
Linux Shell Scripts and Shell Commands✌️
Linux Shell Scripts and Shell Commands✌️Linux Shell Scripts and Shell Commands✌️
Linux Shell Scripts and Shell Commands✌️
 
32 shell-programming
32 shell-programming32 shell-programming
32 shell-programming
 

Último

Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...
➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...
➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
FinalFinalSelf-PortraiturePowerPoint.pptx
FinalFinalSelf-PortraiturePowerPoint.pptxFinalFinalSelf-PortraiturePowerPoint.pptx
FinalFinalSelf-PortraiturePowerPoint.pptx
abbieharman
 
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
 
NOTICE WRITING 1.pptx.pdfwefesddsdfcsdcd
NOTICE WRITING 1.pptx.pdfwefesddsdfcsdcdNOTICE WRITING 1.pptx.pdfwefesddsdfcsdcd
NOTICE WRITING 1.pptx.pdfwefesddsdfcsdcd
SUHAANI1
 
FinalLessonPlanResponding.docxnknknknknknk
FinalLessonPlanResponding.docxnknknknknknkFinalLessonPlanResponding.docxnknknknknknk
FinalLessonPlanResponding.docxnknknknknknk
abbieharman
 
哪里购买(ucr毕业证书)美国加州大学河滨分校毕业证研究生文凭证书原版一模一样
哪里购买(ucr毕业证书)美国加州大学河滨分校毕业证研究生文凭证书原版一模一样哪里购买(ucr毕业证书)美国加州大学河滨分校毕业证研究生文凭证书原版一模一样
哪里购买(ucr毕业证书)美国加州大学河滨分校毕业证研究生文凭证书原版一模一样
a0pr7yf1
 
storyboard: Victor and Verlin discussing about top hat
storyboard: Victor and Verlin discussing about top hatstoryboard: Victor and Verlin discussing about top hat
storyboard: Victor and Verlin discussing about top hat
LyneSun
 
ARNAUVALERY RECORD STORE SCAVENGER HUNT.
ARNAUVALERY RECORD STORE SCAVENGER HUNT.ARNAUVALERY RECORD STORE SCAVENGER HUNT.
ARNAUVALERY RECORD STORE SCAVENGER HUNT.
ValeryArnau
 
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
Portfolio of my work as my passion and skills
Portfolio of my work as my passion and skillsPortfolio of my work as my passion and skills
Portfolio of my work as my passion and skills
waljorylypil626
 
❼❷⓿❺❻❷❽❷❼❽ Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...
❼❷⓿❺❻❷❽❷❼❽  Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...❼❷⓿❺❻❷❽❷❼❽  Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...
❼❷⓿❺❻❷❽❷❼❽ Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
 
➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
VTV FULL SCRIPT ------------------------
VTV FULL SCRIPT ------------------------VTV FULL SCRIPT ------------------------
VTV FULL SCRIPT ------------------------
ssathiyanishanth8
 
Tanjore Painting: Rich Heritage and Intricate Craftsmanship | Cottage9
Tanjore Painting: Rich Heritage and Intricate Craftsmanship | Cottage9Tanjore Painting: Rich Heritage and Intricate Craftsmanship | Cottage9
Tanjore Painting: Rich Heritage and Intricate Craftsmanship | Cottage9
Cottage9 Enterprises
 
Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka Dpboss
Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka DpbossMatka Guessing Satta Matta Matka Kalyan Chart Indian Matka Dpboss
Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka Dpboss
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
My storyboard for a sword fight scene with lightsabers
My storyboard for a sword fight scene with lightsabersMy storyboard for a sword fight scene with lightsabers
My storyboard for a sword fight scene with lightsabers
AlejandroGuarnGutirr
 
Colour Theory for Painting - Fine Artist.pdf
Colour Theory for Painting - Fine Artist.pdfColour Theory for Painting - Fine Artist.pdf
Colour Theory for Painting - Fine Artist.pdf
Ketan Naik
 
Cherries 32 collection of colorful paintings
Cherries 32 collection of colorful paintingsCherries 32 collection of colorful paintings
Cherries 32 collection of colorful paintings
sandamichaela *
 

Último (20)

Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
 
➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka
 
➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...
➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...
➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...
 
FinalFinalSelf-PortraiturePowerPoint.pptx
FinalFinalSelf-PortraiturePowerPoint.pptxFinalFinalSelf-PortraiturePowerPoint.pptx
FinalFinalSelf-PortraiturePowerPoint.pptx
 
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
 
NOTICE WRITING 1.pptx.pdfwefesddsdfcsdcd
NOTICE WRITING 1.pptx.pdfwefesddsdfcsdcdNOTICE WRITING 1.pptx.pdfwefesddsdfcsdcd
NOTICE WRITING 1.pptx.pdfwefesddsdfcsdcd
 
FinalLessonPlanResponding.docxnknknknknknk
FinalLessonPlanResponding.docxnknknknknknkFinalLessonPlanResponding.docxnknknknknknk
FinalLessonPlanResponding.docxnknknknknknk
 
哪里购买(ucr毕业证书)美国加州大学河滨分校毕业证研究生文凭证书原版一模一样
哪里购买(ucr毕业证书)美国加州大学河滨分校毕业证研究生文凭证书原版一模一样哪里购买(ucr毕业证书)美国加州大学河滨分校毕业证研究生文凭证书原版一模一样
哪里购买(ucr毕业证书)美国加州大学河滨分校毕业证研究生文凭证书原版一模一样
 
storyboard: Victor and Verlin discussing about top hat
storyboard: Victor and Verlin discussing about top hatstoryboard: Victor and Verlin discussing about top hat
storyboard: Victor and Verlin discussing about top hat
 
ARNAUVALERY RECORD STORE SCAVENGER HUNT.
ARNAUVALERY RECORD STORE SCAVENGER HUNT.ARNAUVALERY RECORD STORE SCAVENGER HUNT.
ARNAUVALERY RECORD STORE SCAVENGER HUNT.
 
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
 
Portfolio of my work as my passion and skills
Portfolio of my work as my passion and skillsPortfolio of my work as my passion and skills
Portfolio of my work as my passion and skills
 
❼❷⓿❺❻❷❽❷❼❽ Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...
❼❷⓿❺❻❷❽❷❼❽  Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...❼❷⓿❺❻❷❽❷❼❽  Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...
❼❷⓿❺❻❷❽❷❼❽ Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...
 
➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Kalyan Matka Satta Matka Dpboss Matka Guessing Indian Matka
 
VTV FULL SCRIPT ------------------------
VTV FULL SCRIPT ------------------------VTV FULL SCRIPT ------------------------
VTV FULL SCRIPT ------------------------
 
Tanjore Painting: Rich Heritage and Intricate Craftsmanship | Cottage9
Tanjore Painting: Rich Heritage and Intricate Craftsmanship | Cottage9Tanjore Painting: Rich Heritage and Intricate Craftsmanship | Cottage9
Tanjore Painting: Rich Heritage and Intricate Craftsmanship | Cottage9
 
Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka Dpboss
Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka DpbossMatka Guessing Satta Matta Matka Kalyan Chart Indian Matka Dpboss
Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka Dpboss
 
My storyboard for a sword fight scene with lightsabers
My storyboard for a sword fight scene with lightsabersMy storyboard for a sword fight scene with lightsabers
My storyboard for a sword fight scene with lightsabers
 
Colour Theory for Painting - Fine Artist.pdf
Colour Theory for Painting - Fine Artist.pdfColour Theory for Painting - Fine Artist.pdf
Colour Theory for Painting - Fine Artist.pdf
 
Cherries 32 collection of colorful paintings
Cherries 32 collection of colorful paintingsCherries 32 collection of colorful paintings
Cherries 32 collection of colorful paintings
 

unix3.docx

  • 1. Enrollment No:-20020201337 Subject:-Unix 1 | P a g e 1. Write a command to delete all special character from the file x1 $ sed ‘s/[#$@*%]//g’ d 2. To extract all username and their home directory from /etc/passwd file $ grep -oP '^[^:]+|.*:K[^:]+(?=:[^:]+)' /etc/passwd | perl -pe 's/n/ : / if $.%2' 3. . Count frequency of users who are logged-in from more than one terminal. $ who | wc-l 4. Delete all leading and trailing spaces in all line of file f1.
  • 2. Enrollment No:-20020201337 Subject:-Unix 2 | P a g e $ sed 's/^[ t]*//' d 5. Display string in uppercase. $ awk '{print toupper($0)}' d 6. Write a command to locate lines that begin and end with a dot(.) ans containing anything between them $ grep "^..*.$" d $ sed -n '/^..*.$/p' d 7. Write a command to remove duplicate lines form a file $ sed -n 's/unix/linux/p' d 8. Replace the word UNIX with Linux in between 5th to 10th lines including both. $ sed '5,10 s/unix/linux/' d
  • 3. Enrollment No:-20020201337 Subject:-Unix 3 | P a g e 9. Remove all leading space from a file x1. $ sed -ne 's/^[ t]*//p' d 10. To display lines of file f1 this contains pattern as user1 or user2 or user3 $ grep -e 'user1' -e 'user2' -e 'user3' d 11. . Display a line of file f1 which contains exact 8 characters $ grep '^.{8}$' d
  • 4. Enrollment No:-20020201337 Subject:-Unix 4 | P a g e 12. Count all empty lines (consist of only new line character) of file f2 $ grep -c '^$' d 10. To display lines of file f1 this contains pattern as user1 or user2 or user3 $ grep -e 'user1' -e 'user2' -e 'user3' d 11. . Display a line of file f1 which contains exact 8 characters $ grep '^.{8}$' d
  • 5. Enrollment No:-20020201337 Subject:-Unix 5 | P a g e 12. Count all empty lines (consist of only new line character) of file f2 $ grep -c '^$' d 17. Write awk script to display lines whose last word id UNIX of file x1 $ awk '/unix$/{print}' d
  • 6. Enrollment No:-20020201337 Subject:-Unix 6 | P a g e 17. Write awk script to display lines whose last word id UNIX of file x1 $ awk '/unix$/{print}' d
  • 7. Enrollment No:-20020201337 Subject:-Unix 7 | P a g e a. Find Greatest No. b. Palindrome No. BEGIN{ print"main menu" ; print"1.factorial of number" ; print"2.Greater number" ; print"3.palindrome of number" ; print "Enter ur choice" ; getline ch<"-" ; print ch ; if(ch==1) { print "enter the number" ; getline tmp<"-" ; c=1 ; while(tmp != 0) { c=c*tmp ; tmp-- ; } print c ; } if(ch==2) { print "enter first number" ; getline a1<"-" ; print "enter second number" ; getline a2<"-" ; print "enter third number" ;
  • 8. Enrollment No:-20020201337 Subject:-Unix 8 | P a g e getline a3<"-" ; if(a1>a2 && a1>a3) print "first number is greater " ; if(a2>a1 && a2>a3) print "second number is greater " ; if(a3>a1 && a3>a2) print "third number is greater " ; } if(ch==3) { print "enter the number" ; getline tmp<"-" ; a. Find Greatest No. b. Palindrome No. BEGIN{ print"main menu" ; print"1.factorial of number" ; print"2.Greater number" ; print"3.palindrome of number" ; print "Enter ur choice" ; getline ch<"-" ; print ch ; if(ch==1) { print "enter the number" ; getline tmp<"-" ; c=1 ; while(tmp != 0) { c=c*tmp ; tmp-- ; } print c ; } if(ch==2) { print "enter first number" ; getline a1<"-" ; print "enter second number" ; getline a2<"-" ; print "enter third number" ;
  • 9. Enrollment No:-20020201337 Subject:-Unix 9 | P a g e getline a3<"-" ; if(a1>a2 && a1>a3) print "first number is greater " ; if(a2>a1 && a2>a3) print "second number is greater " ; if(a3>a1 && a3>a2) print "third number is greater " ; } if(ch==3) { print "enter the number" ; getline tmp<"-" ;