Saturday, June 13, 2009

Linux Interview Question - Part 2

Linux Interview Question - Part 2


Q -1 > How do you list the Files in an Unix Directory while also showing hidden Files ?
A -1 > ls - ltra

Q -2 > How do you execute a Unix command in the background ?
A -2 > " &"

Q -3 > What unix command will control the default file permission when file are created ?
A -3 > umask

Q -4 > Explain the read , write and execute permissions on a unix directory ?
A -4 > Read allows you to see and list the directory contents . Write allows you to create, edit and delete files and subdirectory in the directory. Execute gives you the permissions to the run programs or shell from the directory.

Q -5 > What is the difference between a soft link and hard link ?
A -5 > A symbolic ( soft ) linked file and the targeted file can be located on the same or different file system while for a hard link they must be located on the same file system .

Q -6 > Give the command to display space usage on the unix file system ?
A -6 > df -lk

Q -7 > Explain iostat, vmstat and netstat reports ?
A -7 > vmstat reports on virtual memory statistics for processes, disk , tape I/O activity .

Q -8 > How would you change all occurrences of a value using vi ?
A -8 > %s/(old value )/(new value )/g

Q -9 > Give two unix kernel parameters that effect an Oracle install?
A -9 > SHMMAX and SHMMNI

Q -10 > How do you install Oracle software on Unix ?
A -10 > Set up disks, kernel parameters and run orainst.

Q -11 > What is the difference between pipe ( | ) and tee commands in unix ?
A -11 > PIPE : A pipe would allow you to direct output of one command

Monday, June 8, 2009

Linux Interview Question - Part 1

Linux Interview Question - Part 1



Q-1 > What would you type to send the last 20 lines of a text file to STDIN ?
a ) end -n 20 filename
b ) last -n 20 filename
c ) head -20 filename
d ) end -20 filename
e ) tail -20 filename
A-1 > e ) tail -20 filename

Q-2 > Which two commands can you use to delete directories ?
a ) rm
b ) rm -rf
c ) rmdir
d ) rd
e ) rd -rf
A-2 > b & c

Q-3 > Which command do you use to change runlevels ?
a ) initlevel
b ) runlevel
c ) level
d ) run
e ) init
A-3 > e . init

Q-4 > Which daemon controls the network service [ pop3 mail service ] ?
a ) inetd
b ) pop3d
c ) maild
d ) nntpd
e ) pmaild
A-4 > a . inetd { Pop3 mail service runs through the superdaemon }

Q-5 > What do you type to stop a hung process that resists the standard attempts to shut it down ?
a ) kill pid
b ) quit
c ) kill -9 pid
d ) exit
e ) ctrl + c
A-5 > a, c , e

Q-6 > Which of the following commands can you use to cleanly restart a linux box ?
a ) reboot
b ) init 6
c ) init 0
d ) shutdown -r
e ) shutdown -h
A-6 > a, b, d

Q-7 > What command would you use to create an empty file without opening it to edit it ?
a ) open
b ) vi
c ) pico
d ) touch
e ) edit
A-7 > d

Q-8 > Which shell do you assign to a pop3 mail - only account ?
a ) /bin/false
b ) /bin/bash
c ) /bin/sh
d ) /bin/pop
e ) /bin/pop3
A-8 > a

Q-9 > Which file do you edit to set up a printer ?
a ) /etc/printtab.conf
b ) /etc/print.conf
c ) /etc/lp.conf
d ) /etc/printtab
e ) /etc/printers
A-9 > d

Q-10 > Which of the following are X-based system configuration tools available ?
a ) COAS
b ) kConf
c ) linuxconf
d ) Yast
e ) Gnoconf.
A-10 > a,c,d

Q-11 > Which partitioning tool is available in all distributions ?
a ) Disk Druid
b ) Fdisk
c ) Partition Magic
d ) Fat 32
e ) System Commander
A-11 > b

Q-12 > Which partitions might you create on the mail server's hard drive other than the root, swap and boot partitions ?
a ) /var/spool
b ) /tmp
c ) /proc
d ) /bin
e ) /home
A-12 > a,b & e

Q-13 > What types of server is used to remotely assign IP addresses to machines during the installation process ?
a ) SMB
b ) NFS
c ) DHCP
d ) FTP
e ) HTTP
A-13 > c

Q-14 > Which package can you use to regulate which network traffic is allowed to enter a specific machine, but not to any other machine ?
a ) tcp_wrappers
b ) ipchains
c ) SOCKS 5
d ) TCP/IP
e ) ipfirewall
A-14 > a

Q-15 > Which package provides secure remote login sessions, such as secure telnet logins ?
a ) securetelnet
b ) ssh
c ) shadow
d ) ipchains
e ) Socks 5
A-15 > b

Q-16 > What happens to your ipchains settings when your reboot a machine ?
a ) They are automatically saved.
b ) They are automatically saved if you set them to be .
c ) They cannot be saved
d ) They cannot be automatically saved unless you do something like make an alias for the shutdown routine that ensures this happens
e ) You have to specifically type out the commands to save them each time.
A-16 > d

Q-17 > Which command works in almost all distributions to create a boot disk ?
a ) mkboot
b ) make bootdisk
c ) make boot
d ) mkbootdsk
e ) mkbootdisk
A-17 > e

Q-18 > Which password package should you install to ensure that the central password file couldn't be stolen easily ?
a ) PAM
b ) tcp_wrappers
c ) shadow
d ) securepass
e ) ssh
A-18 > c

Q-19 > What types of local file server can you use to provide the distribution installation materials to the new machine during a network install ?
a ) inetd
b ) FSSTND
c ) DNS
d ) NNTP
e ) NFS
A-19 > e

Q-20 > Where is a good place to store shell scripts that are for use by us ?
a ) ~/bin
b ) /bin
c ) /usr/bin
d ) /root
A-20 > a

Q-21 > Which of the following commands can be used to get information about a package?
a ) man
b ) list
c ) apropos
d ) info
e ) more
A-21 > a,c & d

Q-22 > What command allows you to set a processor intensive job to use less CPU time ?
a ) ps
b ) nice
c ) chps
d ) less
e ) more
A-22 > b

Q-23 > Which first level segment of the file system contains a majority of system and server configuration files within its subdirectories ?
a ) /var
b ) /etc
c ) /bin
d ) /sbin
e ) /lib
A-23 > b

Q-24 > Which file do you need to change to alter how the updatedb database is created ?
a ) /etc/which.conf
b ) /etc/conf.updatedb
c ) /etc/updatedb.conf
d ) /etc/conf.which
A-24 > c

Q-25 > You enter the command cat horse | tr 'x' 'X' What is the result ?
a ) File horse will be displayed on screen
b ) Any lines in the file horse containing 'x' or 'X' will be displayed
c ) All instance of 'x' will be changed to 'X' and the O/P is sent to screen
d ) Nothing
A-25 > c