On Thu, Feb 21, 2008 at 6:19 PM, dinesh jadhav
<din_jadhav2003@ yahoo.co. in> wrote:

Hi.

I don't have access to a unix box at the moment, so I might be wrong
with the scripts.

> 1.
> How do you take a single line of input from the user in a shell script?

read variable_name

> 2.
> Write a script to convert all DOS style backslashes to UNIX style slashes in
> a list of files.

sed 's#\#/#'g
put that in a for loop that with ls.

> 3.
> Write a regular expression (or sed script) to replace all occurrences of the
> letter 'f', followed by any number of characters, followed by the letter
> 'a', followed by one or more numeric characters, followed by the letter 'n',
> and replace what's found with the string "UNIX".

>>sed '/f*a[0-9]n/ UNIX/g'

sed 's/f*a[0-9]n/UNIX/g'

> 4.
> Write a script to list all the differences between two directories.

[ -e /dir1/$file ] && [ ! -e /dir2/$file ] && echo "$file exists in
the first dir only."
> 5.
> Write a program in any language you choose, to reverse a file.

tac file_name (heheh that was easy)

> 6.
> What are the fields of the password file?

dont remember

> 7.
> What does a plus at the beginning of a line in the password file signify?

The user authenticates via NIS.

> 8.
> Using the man pages, find the correct ioctl to send console output to an
> arbitrary pty.

apropos ioctl
man some_number ioctl

> 9.
> What is an MX record?

Mail exchange record...tells an MUA which host to forward a domain's mails to.
> 10.
> What is the prom command on a Sun that shows the SCSI devices?

prom? I know prtconf does it.
> 11.
> What is the factory default SCSI target for /dev/sd0?

/dev/sd0 on Linux??

> 12.
> Where is that value controlled?

??

> 13.
> What happens to a child process that dies and has no parent process to wait
> for it and what's bad about this?

Zombie. Hogs memory.
http://www-1.ibm.com/support/docview.wss?rs=0&uid=swg21085739

> 14.
> What's wrong with sendmail? What would you fix?

Whats right with it? Its an open relay by default.

> 15.
> What command do you run to check file system consistency?

fsck -a[y]

> 16.
> What's wrong with running shutdown on a network?

You lose your session if ssh/telnet is not configured to start at boot.

> 17.
> What can be wrong with setuid scripts?

executes with user's permissions.

> 18.
> What value does spawn return?

man spawn

> 19.
> Write a script to send mail from three other machines on the network to root
> at the machine you're on. Use a 'here doc', but include in the mail message
> the name of the machine the mail is sent from and the disk utilization
> statistics on each machine?

mail [EMAIL PROTECTED] -s "Disk Utilization" << EOF
` df -kh'
EOF

> 20.
> Why can't root just cd to someone's home directory and run a program called
> a.out sitting there by typing "a.out", and why is this good?

path

> 21.
> What is the difference between UDP and TCP?

if TCP packet fails to reach, it is resent. Not UDP.

> 22.
> What is DNS?

domainname to ip resolution.

> 23.
> What does nslookup do?

some things less than what dig does.

> 24.
> How do you create a swapfile?

dd
swapon

> 25.
> How would you check the route table on a workstation/ server?

route -n

> 26.
> How do you find which ypmaster you are bound to?

dont remember

> 27.
> How do you fix a problem where a printer will cutoff anything over 1MB?

dont know.

> 28.
> What is the largest file system size in solaris? SunOS?

dont know. Is in TB.

> 29.
> What are the different RAID levels?

1 2 3 4 5, plus combinations.

> 30.
> Advantages/disadvan tages of script vs compiled program.

script: easy to debug, but runs slowly.

> 31.
> Name a replacement for PHP/Perl/MySQL/ Linux/Apache and show main
> differences.

PHP:ASP
Perl: Ruby, but no proper replacement actually.
MySQL: Oracle.
Linux: No replacement.
Apache: SunONE, MS IIS,.....

> 32.
> Why have you choosen such a combination of products?

Right and tight integration.

> 33.
> Differences between two last MySQL versions. Which one would you choose and
> when/why?

dont know. MySql has been taken over by Sun.

> 34.
> Main differences between Apache 1.x and 2.x. Why is 2.x not so popular?
> Which one would you choose and when/why?

> 35.
> Which Linux distros do you have experience with?

Most.

> 36.
> Which distro you prefer? Why?

Any.

> 37.
> Which tool would you use to update Debian / Slackware / RedHat / Mandrake /
> SuSE ?

apt,up2date, yast,
up2date no longer present in rhel use yum

> 38.
> You're asked to write an Apache module. What would you do?

Download it. ( :P)

> 39.
> Which tool do you prefer for Apache log reports?

webalizer.
or awstars

> 40.
> Your portfolio. (even a PHP guest book may work well)

How about a search software written in perl?

> 41.
> What does 'route' command do?

explained above.

> 42.
> Differences between ipchains and iptables.

stateless and stateful.

> 43.
> What's eth0, ppp0, wlan0, ttyS0, etc.

network and pseudo terminals.

> 44.
> What are different directories in / for?

for storing data. lol1

> 45.
> Partitioning scheme for new webserver. Why?

depends...have a big /www partition with RAID 5.

> 46.
> How do you list all files in a directory, including the hidden files?

ls -al
on suse, just ls -l as root.

> 47.
> How do you find out all processes that are currently running?

ps
ps waux

> 48.
> How do you find out the processes that are currently running or a particular
> user?

ps -el with the -u option or something ( i pipe it to grep user)
> 49.
> How do you kill a process?

killall -9

> 50.
> What would you use to view contents of the file?

cat, pg, more.

> 51.
> How can you gather statistics on a table?

Oracle table?

select * from dba_tablespaces
where table_name=' whatever'

use these views:
dba_segments, dba_extents, dba_free_space

> 52.
> What would you use to edit contents of the file?

vi or emacs.
nano or pico

> 53.
> What would you use to view contents of a large error log file?

more

> 54.
> How do you log in to a remote Linux box?

ssh

> 56.
> How do you get help on a Linux terminal?

man, woman, or just shout "HELP" !!

> 57.
> How do you list contents of a directory including all of its subdirectories,
> providing full details and sorted by modification time?

ls -lRt

> 58.
> How do you create a symbolic link to a file (give some reasons of doing so)?

ln -s file linkname

> 59
> What is a filesystem?

yawn!
http://www.pathname.com/fhs/

> 60.
> How do you get its usage (a filesystem)?

df -HT
df -kh

> 61.
> How do you check the sizes of all users� home directories (one command)?

du -sh /home/*

> 62.
> How do you check for processes started by user 'pat'?

fuser

> 63.
> How do you start a job on background?

&
bg

> 64.
> What utility would you use to replace a string '2001' for '2002' in a text
> file?

discussed above with sed.
> 65.
> What utility would you use to cut off the first column in a text file?

cat filename | cut -d" " -f1

> 66.
> How to copy file into directory?

cp

> 67.
> How to remove directory with files?

rm -fr

> 68.
> What is the difference between internal and external commands?

yawn!

> 69.
> List the three main parts of an operating system command:

dunno.
> 70.
> What is the difference between an argument and an option (or switch)?
dunnno.

> 71.
> What is the purpose of online help?

dunno
> 72.
> Name two forms of security.

dunno.
> 73.
> What command do you type to find help about the command who?

man who

> 74.
> What is the difference between home directory and working directory?

pwd and cd

Okay....bye. ..got some work...will answer the others on Sunday. Happy weekend!

Regards,

--
Nadeem M. Khan | Oracle Database Administrator | Fujitsu Services UAE
| +972-55-9165773

 


      Download prohibited? No problem. CHAT from any browser, without download. 
Go to http://in.messenger.yahoo.com/webmessengerpromo.php/

[Non-text portions of this message have been removed]

Reply via email to