Assignment 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

ASSIGNMENT 2

Q1) Create a file with at least 10 records.

CODE

Q2) Search for lines containing “JIMS” in file.

CODE

Q3) Search text in multiple files.

CODE
Q4) Find JIMS, jims, Jims

CODE

Q5) Find “BCA” but only at the start of a line.

CODE

Q6) Find “JIMS” AND “jims” but only at the start of a line.

CODE

Q7) Find all lines in all files in the current dir with three numbers in a row

CODE
Q8) Find all lines in all files in the current dir with three numbers in a row

CODE

Q9) Repeat Q8) with case insensitive

CODE

Q10) Show line numbers and matching lines

CODE

Q11) Show all matches, five lines before and five lines after each match

CODE
Q12) Find lines not containing “JIMS”.

CODE

Q13) Search multiple patterns.

CODE
Q14) Find all the sub-directories in the current directory
(Use ls and grep command)

CODE

Q15) Perform archive commands (tar, gzip, gunzip)

CODE

You might also like