Unix Interview questions part-3

Unix Interview questions part-3

Postby admin » Thu Jun 28, 2012 10:45 am

1. How do you find which processes are using a particular file?
By using lsof command in UNIX. It will list down PID of all the process which is using a particular file.
2. How do you find which remote hosts are connecting to your host on a particular port say 10123?
By using netstat command execute netstat -a | grep “port” and it will list the entire host which is connected to this host on port 10123.
4. What is ephemeral port in UNIX?
Ephemeral ports are port used by Operating system for client sockets. There is a specific range on which OS can open any port specified by ephemeral port range.
5. If one process is inserting data into your MySQL database? How will you check how many rows inserted into every second?
“watch” command in UNIX is repeatedly used to execute command provided with specified delay.
6. There is a file Unix_Test.txt which contains words Unix, how will you replace all Unix to UNIX?
by using SED command in UNIX for example you can execute sed s/Unix/UNIX/g fileName.
7. You have a tab separated file which contains Name, Address and Phone Number, list down all Phone Number without there name and Addresses?
you can either use AWK or CUT command here.
8. Your application home directory is full? How will you find which directory is taking how much space?
By using disk usage
(DU) command in Unix for example du –sh . | grep G will list down all
the directory which has GIGS in Size.
9. How do you find for how many days your Server is up?
By using uptime command in UNIX
10. You have an IP address in your network how will you find hostname and vice
By using
nslookup command in UNIX, you can read more about networking command in UNIX here.
Site Admin
Posts: 83
Joined: Sat Dec 03, 2011 2:10 pm

Return to UNIX | Linux

Who is online

Users browsing this forum: No registered users and 1 guest