Questions Related to PRODUCTION SUPPORT {UNIX,ORACLE(SQL,PL/SQL)}
(UNIX)
How do you rate yourself in Unix?
………………………………………..
What are the commands you mostly used in production support?
Ans: ls, cp,rm,cut, mv,head,tail,grep,sed,find,awk,ssh etc.
3.what is the difference between Hard Link and Softlink?
Basis for comparison Hard link Soft link
Basic A file can be accessed through many different names known as hard links. A file can be accessed through different references pointing to that file is known as a soft link.
Link validation, when the original file is deleted Still valid and file can be accessed. Invalid, file can’t be accessed
Command used for creation ln ln -s
inode number Same Different
Can be linked To its own partition. To any other file system even networked.
Memory consumption Less More
Relative Path Not applicable Allowed
4.What is inode?
Ans: an inode is a data structure comprised of metadata about the file such as file creation date, file authorizations, owner of the file and more.
5.What to check the load average ?
Ans: using uptime or top command
6.How do you can check the last logged in users ,with all information.
Ans: using last command
7.How to see the current host Ip address?
Ans:using hostname –i
8.How to change access time of file to current time?
Ans: touch –a filename
9.How do you can copy one directory to another?
Ans: cp –R d1 d2
10.How to delete both file and directories(empty and non-empty)
Ans :using command rm –rf
11.How to move content of one file to another ?
Ans:using mv –f F1 F2(forcefully overwrite fi into f2 ,then f1 contents deleted)
How to move to previous working directory?
Ans: using cd – or cd $OLDPWD
How to check the disk usage?
Ans: Using du command (options –h(human readable format),-k(KB),-m(MB),-b(byte))
14.How to check the disk free space
Ans: using df command
15.how to see the RAM size?
Ans:using du or df or free or top command.
16.How to check the server is active or not?
Ans :using ping ipaddress or ping servername
17.whatt is the default umask value?
Ans:022
What is the file default permission value?
Ans:644,total permission 666
19.what is the directory default permission value?
Ans:755,total permission value 777
20.How to create a new process?
Ans:using fork command
21.what are the process state or types of process?
Ans: Runnable, hold, Zombic,Orphan, stop
22.how to check all process belongs to a particular user?
Ans:using top –u “username” command
23.How do you can do the process search ?
Ans: using ps command,(ps –a shows all current process running)
24.How to display last 20 lines of a file?
Ans:using tail -20 filename
25.How to display first 15 lines of a file?
Ans: using head -15 filename
26.How to print all lines of a file except last five lines?
Ans:using head –n -5 filename
How to print all lines of a file except first 14 lines
Ans:Using tail –n+14 filename
28.How to print first and second column of a file?
Ans: cut –d “ “ –f1, 2 filename
How to print contents from 3rd columns onwards to last?
Ans :cut –d “ “ –f3- filename
How to display two files contents columnwise?
Ans: paste file1 file2
31.How to delete duplicate lines of a file?
Ans:sort file|uniq >file
32.How to view the duplicate values present in a file?
Ans:uniq –d filename
33.How to display two lines above/before a given pattern?
Ans:grep -B2 “pattern” filename
34.How to count the number of time a pattern present in a file?
Ans:grep –c “pattern” filename
35.Show all filenames which contains a particular pattern?
Ans:grep –l “pattern” *
36.How to check the no. of times the pattern “ERRORCODE” present in a file ?
Ans :grep –c “ERRORCODE” filename
37.How to delete blank lines of a file?
Ans: grep –v “^$” filename
38.How to show the lines of a file whose last word matches with the pattern “B007”
Ans : grep “B007$” filename
39.How to delete first line of a file?
Ans: Sed 1d filename
40.How to delete the line present previous to the last line?
Ans: tac filename | sed 2d | tac
41.How to substitute the word ERROR with the word WARNING in every occurance of a file?
Ans:sed ‘s/ERROR/WARNING/g’ filename
42.How to print last line of a file?
Ans: sed –n ‘$p’ Filename
43.How to print line from 10 to 15 of a file
Ans:sed –n ’10,15p’ filename
44.How to insert a blank line in the 2nd line of a file?
Ans: sed ‘2i\’ filename
45.How to kill a process ?what is the difffrence kill-9 and kill -15
Ans:kill -9 is forcibly kill process and kill-15 kills gracefully
46.How to know the command successfully executed or not?
Ans:echo $?,if result is zero then successful else not
47.How to see the current shell pid?
Ans:echo $$
48.How to check the current shell ?
Ans:echo $SHELL
49.How to create a tar file
Ans:tar –cvf filename a.txt b.txt c.txt
50.How to extract a existing tar file?
Ans:tar –xvf tarfilename
51.How to zip a tar file?
Ans:zip a.tar
52.How to connect from one server to another?
Ans:ssh servername@ipaddress
53.How do we can transfer files from one server to another?
Ans :ftp ipaddress,then it will ask for username and password to connect.
54.What is the difference between ftp and sftp?
Ans:sftp is more secure as it is encrypted ,again no loss of data.
55.How to copy file from local machine to remote machine?
Ans:scp /home/xyz.txt user@s2: /home/abc/
56.How to see the contents of a zip file
Ans:zcat xyz.gz
57.How to search in a zip file
Ans:using zgrep command
58.how to check the cpu utilization?
Ans :using top command
How to run a command in background ?
Ans: command &
60.How to schedule a job?
Ans :using crontab
61.What are the fields present in crontab?
Ans: minute Hour dayofmonth monthofyear dayofweek jobname
62.how to display files modified within 10 days?
Ans: find . –type f –mtime -10 –print
63.Show all files which is accessed before 60 minutes?
Ans:find . –type f –amin +60 –print
64.Show all files whose size is more than 20 mb?
Ans: find . –type f –size +20M
65.Show all files which are created within 2 hours?
Ans: find . -type f-cmin -120 –print
66.Display all files having permission 644
Ans: find . –type f –perm 644 –print
67.Display all files which are modified within 60 minutes or access before 60 min?
Ans:find . –type f –mmin -60 –o –amin+60 –print
68.List all process under a single parent process id(PPID) 7685
Ans:ps –f - - PPID 7685
69.how to display all process with full format listing?
Ans: ps –ef
70.How to list out the process having java in its command execution ?
Ans:ps –f –C java or ps –aux | grep “java”
70.What is the difference between Ps command and top command?
The top program provides a dynamic real-time view of a running system. It can display system summary information as well as a list of processes or threads currently being managed by the Linux kernel. ps gives a snapshot of the current processes. To know overall process list, owner of the process in the given system you use ps
71.How to see the memory percentage used by process ?
Ans:ps –aux (4th column) or top (10th column)
72.How to remove first two character of a file?
Ans:sed ‘s/..//’ filename
73.How to check the network status?
Ans: netstat –s (for tcp netstat –st and for udp netstat –su)
74.How to display the last column of a file?
Ans:awk ‘{print $NF}’ filename
75.How to display 1st and 3rd column of a space delimited file?
Ans:awk –F “ “ ‘{print $1 $3}’ filename
76.Find top 5 cpu utilization of process
Ans: ps –aux | sort –nk3 | tail -5 | tac
Questions Related to PRODUCTION SUPPORT {UNIX,ORACLE(SQL,PL/SQL)} (UNIX)
4.What is inode? Ans: an inode is a data structure comprised of metadata about the file such as file creation date, file authorizations, owner of the file and more. 5.What to check the load average ? Ans: using uptime or top command 6.How do you can check the last logged in users ,with all information. Ans: using last command 7.How to see the current host Ip address? Ans:using hostname –i 8.How to change access time of file to current time? Ans: touch –a filename 9.How do you can copy one directory to another? Ans: cp –R d1 d2 10.How to delete both file and directories(empty and non-empty) Ans :using command rm –rf 11.How to move content of one file to another ? Ans:using mv –f F1 F2(forcefully overwrite fi into f2 ,then f1 contents deleted)
51.How to zip a tar file? Ans:zip a.tar 52.How to connect from one server to another? Ans:ssh servername@ipaddress 53.How do we can transfer files from one server to another? Ans :ftp ipaddress,then it will ask for username and password to connect. 54.What is the difference between ftp and sftp? Ans:sftp is more secure as it is encrypted ,again no loss of data. 55.How to copy file from local machine to remote machine? Ans:scp /home/xyz.txt user@s2: /home/abc/ 56.How to see the contents of a zip file Ans:zcat xyz.gz 57.How to search in a zip file Ans:using zgrep command 58.how to check the cpu utilization? Ans :using top command
70.What is the difference between Ps command and top command? The top program provides a dynamic real-time view of a running system. It can display system summary information as well as a list of processes or threads currently being managed by the Linux kernel. ps gives a snapshot of the current processes. To know overall process list, owner of the process in the given system you use ps 71.How to see the memory percentage used by process ? Ans:ps –aux (4th column) or top (10th column) 72.How to remove first two character of a file? Ans:sed ‘s/..//’ filename 73.How to check the network status? Ans: netstat –s (for tcp netstat –st and for udp netstat –su) 74.How to display the last column of a file? Ans:awk ‘{print $NF}’ filename 75.How to display 1st and 3rd column of a space delimited file? Ans:awk –F “ “ ‘{print $1 $3}’ filename 76.Find top 5 cpu utilization of process Ans: ps –aux | sort –nk3 | tail -5 | tac