Unix General Interview Preparation Guide
Elevate your Unix General interview readiness with our detailed compilation of 18 questions. These questions will test your expertise and readiness for any Unix General interview scenario. Ideal for candidates of all levels, this collection is a must-have for your study plan. Dont miss out on our free PDF download, containing all 18 questions to help you succeed in your Unix General interview. Its an invaluable tool for reinforcing your knowledge and building confidence.18 Unix General Questions and Answers:
1 :: Finding the presence of a word in a list of n files (pattern matching)?
sed -n '/matchingpattern/g' file1 file2...
2 :: Explain command to view process running?
use ps command "process status". I will use "ps -ef" to
list every process in detail.
list every process in detail.
3 :: Explain command to show the space allocation of files?
df -h----- it shows the space alocation for oracle dsata file.
olny for space alocation execute command ll -lrth.
olny for space alocation execute command ll -lrth.
4 :: Explain command to display different lines that are found when compare two files?
diff file1 file2
Above command will display all the lines which r diff in
file1 & file2 whereas, cmp will only display 1st occurance
of difference.
Above command will display all the lines which r diff in
file1 & file2 whereas, cmp will only display 1st occurance
of difference.
5 :: How to move a background job to forward?
./test.pl&
jobs -- get job id of the above process
[3] Running ./test.pl &
fg 3
jobs -- get job id of the above process
[3] Running ./test.pl &
fg 3
6 :: What is grep|sort give example?
grep stands as Globally Search for Regular Expression
and Print.
It is used for displaying the pattern matching lines from
requested file or files .
and Print.
It is used for displaying the pattern matching lines from
requested file or files .
7 :: Suppose i have one column with data smith
john
michale
the o/p should be smith,john, michale how we do in unix?
Suppose they are asking for displaying just one of the
columns in a directory, make a note of that column number
as it appears when we do a ls -lrt. Then we can use awk to
just display the one columns as o/p.
If column number is n, then do this:
ls -lrt | awk '{print $n}'
columns in a directory, make a note of that column number
as it appears when we do a ls -lrt. Then we can use awk to
just display the one columns as o/p.
If column number is n, then do this:
ls -lrt | awk '{print $n}'
8 :: What will be the result if we run the command #find /tmp -mtime -2 and #find /tmp -mtime +2?
find /tmp -mtime n where n can be +ve or -ve
+n says, file modified in last n days
-n says, file modified more than n days ago
ex. if today is 5th of a month
file1 has mtime 3rd
file2 has mtime 2nd
then find . -mtime 2 will report file1
then find . -mtime -2 will report file2 only
+n says, file modified in last n days
-n says, file modified more than n days ago
ex. if today is 5th of a month
file1 has mtime 3rd
file2 has mtime 2nd
then find . -mtime 2 will report file1
then find . -mtime -2 will report file2 only
9 :: What is the difference between NFS 3 and NFS 4? What are new features added in NFS4?
nfsv3 acces through udp protocol whereas nfsv4 acces through
TCP/IP protocol
TCP/IP protocol
10 :: How to use grep command to list find the records of a file containing 10 different strings?
grep 'word1|word2' <filename>