You are on page 1of 2

Instructions to candidates

1. Support your answer with command syntax/examples wherever required


2. Total marks-40 Time alloted- 90 min

Set- A

1 Mark

 In shell scripting how do you identify whether the previous command executed successfully?
 What are the different types of shells available in UNIX?
 What is tee command in mysql?
 What is netstat command in unix.Explain with examples.
 Write a command to find out the free disk space on a debian system.
 What is the difference between $$ and $!

2 Marks

 Explain chmod and chown commands with their usage.


 How do you schedule a job to run at 3:45 am every morning?
 Using grep,list out only the empty lines in a file.Also print the count of those lines.
 There is a file Test.txt which contains words “Unix”.How will you replace all occurrence of
“Unix” to “Linux”.
 What are '-A', '-B' and '-C' options in grep ?
 Using ps command
◦ List currently running processes
◦ List processes owned by user Amit and Rahul.
◦ List all processes with the parent process id 7763

3 Marks

 Write a unix command to print just the 50th line of a file named “xyz.txt”
 Use the find command for the following
◦ List out all the PHP files (with extension .php)
◦ find and remove file with the name “test”
 Explain the scp command along with the syntax.
 Write a shell script to print 7 days of the week with the output as
Day 1: Monday
Day 2: Tuesday
Day 3: Wednesday
and so on..

5 Marks
 Write a shell script that upon invocation shows the time and date and lists all the logged-in
users.This information is then saved in a file.

 Consider the following apache's access.log file


69.175.xxx.yyy - - [13/Jul/2013:06:28:31 -0500] "GET /some/web/folder/somewebpage2 HTTP/1.0" 404 4212
"http://somesubdomain.example.org/some/web/folder/some_web_page1" "Mozilla/5.0 (Windows NT 6.1; WOW64)
AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1"

69.175.xxx.yyy - - [13/Jul/2013:06:28:35 -0500] "GET /some/web/folder/?do=register HTTP/1.0" 302 599


"http://somesubdomain.example.org/some/web/folder/somewebpage2" "Mozilla/5.0 (Windows NT 6.1; WOW64)
AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1"

69.175.xxx.yyy - - [13/Jul/2013:06:28:36 -0500] "GET /some/web/folder/somewebpage2 HTTP/1.0" 404 4212


"http://somesubdomain.example.org/some/web/folder/somewebpage2" "Mozilla/5.0 (Windows NT 6.1; WOW64)
AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1"

69.175.xxx.yyy - - [13/Jul/2013:06:28:41 -0500] "POST /some/web/folder/somewebpage2 HTTP/1.0" 200 2439


"http://somesubdomain.example.org/some/web/folder/somewebpage2" "Mozilla/5.0 (Windows NT 6.1; WOW64)
AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1"

94.123.xxx.yyy - - [13/Jul/2013:06:32:49 -0500] "GET /some/web/folder/some_web_page1 HTTP/1.1" 200 5121


"http://somesubdomain.example.org/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0"

94.123.xxx.yyy - - [13/Jul/2013:06:32:49 -0500] "GET /some/web/folder/?do=login HTTP/1.1" 302 599


"http://somesubdomain.example.org/some/web/folder/some_web_page1" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0)
Gecko/20100101 Firefox/5.0"

94.123.xxx.yyy - - [13/Jul/2013:06:32:50 -0500] "GET /some/web/folder/somewebpage2 HTTP/1.1" 404 4214


"http://somesubdomain.example.org/some/web/folder/some_web_page1" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0)
Gecko/20100101 Firefox/5.0"

94.123.xxx.yyy - - [13/Jul/2013:06:32:50 -0500] "GET /some/web/folder/?do=register HTTP/1.1" 302 599


"http://somesubdomain.example.org/some/web/folder/somewebpage2" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0)
Gecko/20100101 Firefox/5.0"

94.123.xxx.yyy - - [13/Jul/2013:06:32:50 -0500] "GET /some/web/folder/somewebpage2 HTTP/1.1" 404 4214


"http://somesubdomain.example.org/some/web/folder/somewebpage2" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0)
Gecko/20100101 Firefox/5.0"

94.123.xxx.yyy - - [13/Jul/2013:06:32:51 -0500] "POST /some/web/folder/somewebpage2 HTTP/1.1" 200 2530


"http://somesubdomain.example.org/some/web/folder/somewebpage2" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0)
Gecko/20100101 Firefox/5.0"

Using 'awk'
◦ Print the uri and the coressponding response code
◦ Count the number of 404s.

You might also like