Вы находитесь на странице: 1из 2

Unix

1. How would you check io statistics and information -> iostat -x

2. What is load average? It is the number of processes that are running or in uninterruptable
state. It can be seen by running commands like top or uptime

3. What does the free command do ? it shows the information about systems memory,
total, used, free, shared
4. In the output of free, there are a number of columns. If there is 1GB memory in the free
column, 3GB in the buffers column and 1GB in the cached column, what would happen if you
tried to start an application that needs 4GB memory ? The application will still work. It will
use the available swap space. The system will still work fine as long as theres no to much
paging.

5. How would you set permissions on a file so that the owner and members of the group that
owns the file can read and write to it, and everyone else can only read it ? -
> chmod 664 file.txt

6. How would you find the number of occurrences of the word foo in a file ? grep foo file.txt
| wc -w

Shell Scripting
1. How do you show the list of all arguments sent to a script ?
#!/bin/bash
echo $@

2. How do you check if a directory exists from a script ?


if [[ -d "${DIRECTORY}" && ! -L "${DIRECTORY}" ]] ; then
echo "Directory exists"
fi

3. What is the syntax for a for loop ?


for VARIABLE in 1 2 3 4 5 .. N
do
command1
command2
commandN
done

4. How do you get the result of a command into a variable ?

DIR=$(pwd)
Echo $DIR
Or
DIR=$(pwd)
Echo $DIR
while [ "$DIR" !="/" ]; do
cd ..
DIR=$(pwd)
Echo $DIR
done
General Scenario
1. What goes on behind the scenes after you type www.google.com/shopping into a browser
that is notbehind a proxy and press enter?

First, browser will check if the destination address is in the cache already or not. If it
exists, the information from the cache will be used. If it doesnt exist yet, DNS query
will be performed until the IP address will be found.

Second, Browser will open the TCP connection towards destination hosts and will use a
protocol called HTTP send the HTTP request.

Then the server will look for the requested data from its resource. Finally, the server
will send the HTTP response towards the client which will be seen from the browser.

2. A user complains that they cannot connect to an application that you run in a
browser. What things do you investigate?

First is to check if the service of apache(or the process name of web server that is being
used) is up, by running pidstat | grephttpd or ps ef | grep httpd.
Second is to check if the port 80 or 443 if secured connection is listening by
running netstat -an | grep :80(or 443 if secured)if it is listening make sure that the
firewall is configured to accept traffic going to this port.
Third is to check the logs from httpd (if the application is deployed in
Apache)/var/log/httpd/error_log to see if there is any error in loading the application.
Check if the drives that is intended for the application use is currently mounted. mount
-l

Вам также может понравиться