Thelinuxstuff.blogspot.in 2012 07 Frequent Asked Linux Interview Question 13.Htm

download Thelinuxstuff.blogspot.in 2012 07 Frequent Asked Linux Interview Question 13.Htm

of 43

description

Thelinuxstuff.blogspot.in 2012 07 Frequent Asked Linux Interview Question 13.Htm

Transcript of Thelinuxstuff.blogspot.in 2012 07 Frequent Asked Linux Interview Question 13.Htm

  • Linux Tips:

    Image f ile should be copied with the command dd.Installation client server command in text mode linux askmethod/usr/bin/setup command to change settings in mouse, network, printer,keyboard, f irewall.etcredhat-conf ig-network- command to change setting in networkconf iguration.redhat-conf ig-services- command to see sevices.ls X* to show all f iles starting with X.xclock display localhost:0.0 command to display localhost clockxeyes display localhost:0.0- geometry 100*100-0+0 &kcontrol & command to change the desktop graphic changeSwitchdesk kde or Switchdesk gnome to switch desktopgnome to show all gnome resultsgnome-search-tool to search any f ilels /usr/bin : more show all command in rescue mode.ls /usr/sbinf disk l command to show all hard drive.redhat-conf ig-userscat /etc/groupusermod -G project X perry here we adding perry the groupquotacheck avcm command to check how much diskspace using

    2013 (4) 2012 (215)

    December (13) November (27) October (18) September (15) August (23) July (62)

    Installat ion steps Open-shif tclient tools

    Gett ing Deeper Into PerlCisco Router BasicsHow to Update Linux

    Workstat ions and Operat ing

    Blog Archive

    PDFmyURL.com

  • edquota useredquota tuseradd D to see user def ault conf igurationuname r command to see kernel versionscat /proc/cpuinf o Command to show processorls /tmp/ker* command to show kernel versioncat /etc/grub.conf command to show conf iguration f ileuname r to see kernel versionless /etc/httpd/conf /httpd.conf command f or apache web server.dig- dig is a way to conversion of hostname to ip address and same inopposite way.There are a number of shells including bash, ksh, sh, zsh and csh. Theyare all very similar in f eatures, but dif f er in semantics and scriptinglanguages. The most common (f rom my experience) is bash which is heavyin f eatures and included with almost all distributions.

    Linux Interview Questions

    Question:

    What command is used to remove the password assigned to a group? -

    Answer: gpasswd -r

    The gpasswd command is used to change the password assigned to a group. Usethe -r option to remove the password f rom the group.

    passwd -d

    Workstat ions and Operat ingSys...

    Linux System Resource &Performance Monitoring

    Linux f ile permissionsHow to upgrade to OS X

    Mountain LionOverview of Macintosh OS's &

    ModelsHow to take Thunderbird

    backup on MAC OSlinux interview quest ions and

    answers for experien...Linux interview quest ionsCert if icat ion in Linux, RHCE /

    RHCSAInstall Adobe (Acrobat PDF)

    Reader on Fedora, Cent...How to install Safari 5 on

    Ubuntu 11.04Bash Script RealTime ExamplesLinux Real Time Issues 4Learn The DD Command

    RevisedOracle TipsUseful Linux CommandsDennis Ritchie passed away at

    PDFmyURL.com

  • Question:

    What is the minimum number of partit ions you need to install Linux? What commandcan you use to review boot messages?

    USR.OPT, ROOT, BOOT, SWAP,

    Question:

    Which f ile def ines all users on your system? Choose one: a. /etc/passwd b./etc/users c. /etc/password d. /etc/user.conf

    Answer: a

    The /etc/passwd f ile contains all the inf ormation on users who may log into yoursystem. If a user account is not contained in this f ile, then the

    Describe the boot process of your f avorite Linux in as much detail as you can.

    Answer: Booting process : f irst BIOS loads the boot loaders, then boot loadersloads the kernel , then kernel mount the f ile systems and drivers installation willtakes place and in it will be loaded.

    Question:

    What is kernel updation?

    Answers: kernel updation is a process to upgrade the kernel f ile with a new or latestversion of kernel & use of them as a def ault kernel.

    Question:

    What command can you use to review boot messages?

    70 on October 12, 20...Top Linux Interview Quest ion &

    AnswerShell Script Interview Quest ion

    and Answers part 1...Advantages of RHEL6 over

    RHEL5Frequent asked Linux Interview

    Quest ion & AnswerMySQL Server TuningLinux for you Admin Tips:1Install Wine on Cent OS 5Selinux in LinuxBack Up (And Restore) LVM

    Part it ions With LVM Snap...Installing PowerDNS (With

    MySQL Backend) And Power...OpenVPN Server On CentOS

    5.2Install Adobe Flash / Reader &

    Air in Ubuntu 12.04...Install RED5 Server on Centos

    5.3Unix/Linux System Admin

    Interview Quest ions And An...Unix/Linux System Admin

    Interview Quest ions And A... PDFmyURL.com

  • Answer: dmesg

    Question:

    The dmesg command displays the system messages contained in the kernel ringbuf f er. By using this command immediately af ter booting your computer, you will seethe boot messages.

    1. What command you execute to display the last f ive commands you have entered?

    2. Which partit ions might you creates on mail server HDDs other than the root, swapand boot partit ions?

    3. Which partit ioning tool is available in all distributions?

    4. Which two commands can you use to delete directories?

    5. Which f ile def ines all users on your system?

    Answers:

    1. history|tail -5

    2. /var

    3. f disk, parted

    4. rm, rmdir

    5. /etc/passwd

    Question:

    What is dif f erence between user right and user permission?

    Unix/Linux System AdminInterview Quest ions And A...

    Unix/Linux System AdminInterview Quest ions And A...

    Unix/Linux System AdminInterview Quest ions And A...

    Unix/Linux System AdminInterview Quest ions And A...

    Unix/Linux System AdminInterview Quest ions And ...

    Unix/Linux System AdminInterview Quest ions And A...

    unix/linux System AdminInterview Quest ions And An...

    unix/linux System AdminInterview Quest ions And A...

    Step by Step Oracle 11g R2Software Installat ion &...

    Shell Script ing InterviewQuest ions And Answers pa...

    NFS Server Interview Quest ionsAnd Answers for lin...

    FTP Server Interview Quest ionsAnd Answers for Li...

    DNS Server Interview Quest ionsAnd Answers for Lin...

    SAMBA Server InterviewQuest ions And Answers for ...

    PDFmyURL.com

  • Answer: user rights is that user is authorized to use password. If hispassword/f ile/dir is expired he is not able to login

    Answer

    user permission: permission is user is permitted to use f ile/directory. that isauthentication

    If he is authentication f or particular f ile or not.

    Question:

    What is contained in the directory /proc? Choose one: a. System inf ormation b.Administrative procedures c. Boot procedures d. Documentation on your system

    Answer: a

    The /proc directory is a virtual f ilesystem that contains system inf ormation.

    Question:

    You are installing Linux into a computer with two IDE hard drives. You plan on dividingeach hard drive into two partit ions. What are the names of the partit ions? Chooseone: a. hda1, hda2, hda3, hda4

    b. hda1, hda2, hdb1, hdb2

    c. sda1, sda2, sdb1, sdb2

    d. sda1, sda2, sda3, sda4

    Answer: b

    Sendmail Server InterviewQuest ions And Answers fo...

    Ldap Server InterviewQuest ions And Answers forli...

    Squid Server InterviewQuest ions And Answers forL...

    Apache Server InterviewQuest ions and Answers for ...

    Beginner's Introduct ion to PerlMount ing CentOS5 LVM Disk

    using Ubuntu12.04Install Google Chrome on

    CentOS / RHEL 5Upgrade to CentOS 6.2 f rom

    CentOS 6.1 / CentOS 6.0...Netbeans Ide installat ion Steps

    in Centos 6How To Install XAMPP On

    Windows [Step By Step Guid...Installing XAMPP on WindowsHow to install an HP printer on

    UbuntuConf igure linux printer server

    step by step guide ...

    June (18)

    PDFmyURL.com

  • Question:

    The f irst letter of the partit ion names ref ers to the controller type: h f or ide and sf or SCSI. The third letter ref ers to which disk: a f or f irst, b f or second, etc., andthe number ref ers to which partit ion: 1 f or f irst, 2 f or second, etc.

    In order to improve your systems security you decide to implement shadowpasswords. What command should you use?

    Answer: pwconv

    The pwconv command creates the f ile /etc/shadow and changes all passwords to xin the /etc/passwd f ile.

    /etc/passwd f ile already exists there.

    So, give passwords by passwd

    Question:

    You wish to print the f ile vacations with 60 lines to a page. Which of the f ollowingcommands will accomplish this? Choose one: a. pr - l60 vacations | lpr b. pr - fvacations | lpr c. pr -m vacations | lpr d. pr - l vacations | lpr

    Answer: a

    The def ault page length when using pr is 66 lines. The - l option is used to specif y adif f erent length.

    You want to print out a text f ile called vacations however the lines are of varyinglength. What text f ilter could you use to even out the length of the lines?

    Answer: f mt

    May (21) April (3) January (15)

    2011 (28)

    Subscribe To

    Posts Comments

    Total Pageviews

    2 5 1 4 7CALENDER

    PDFmyURL.com

  • The f mt text utility attempts to make all the lines the same length by joining orsplitt ing lines.

    Question:

    You have a technician who will come in af ter hours to install new hardware in yoursystem. You do not want to give him the root password, but he needs to be able toshutdown the system. How can you accomplish this? Choose one: a. you cannot dothis; only root can run the shutdown command. b. Add his username to the/etc/shutdown.conf f ile. c. Add his username to the /etc/shutdown.allow f ile. d. Givehim the root password and change it when you arrive the next morning.

    Answer: c

    Any user who is listed in the /etc/shutdown.allow f ile will be able to run the shutdowncommand without being root.

    Question:

    You locate a command in the /bin directory but do not know what it does. Whatcommand can you use to determine its purpose?

    Answer: whatis

    The whatis command displays a summary line f rom the man page f or the specif iedcommand.

    We can use man and inf o commands

    Question:

    What utility can you use to show a dynamic listing of running processes?

    Answer: top PDFmyURL.com

  • The top utility shows a listing of all running processes that is dynamically updated.

    top utility is used.

    but ps -ef command can also be used .

    Question:

    What command would you type to use the cpio to create a backup called backup.cpioof all the user s home directories? _____________

    Answer: f ind /home | cpio -o > backup.cpio

    The f ind command is used to create a list of the f iles and directories contained inhome. This list is then piped to the cpio utility as a list of f iles to include and theoutput is saved to a f ile called backup.cpio.

    Question:

    What f ile def ines the levels of messages written to system log f iles?

    Answer: kernel.h

    To determine the various levels of messages that are def ined on your system,examine the kernel.h f ile.

    You want to create a compressed backup of the users home directories. What utilityshould you use?

    Answer: tar

    You can use the z modif ier with tar to compress your archive at the same time ascreating it.

    PDFmyURL.com

  • tar -zcvf f ilename.tgz f ile1 f ile2

    This command is used to take a compress backup

    Question:

    You routinely compress old log f iles. You now need to examine a log f rom twomonths ago. In order to view its contents without f irst having to decompress it, usethe _________ utility.

    Answer: zcat

    The zcat utility allows you to examine the contents of a compressed f ile much thesame way that cat displays a f ile.

    grep is pref f ered over zcat

    Question:

    You are covering f or another system administrator and one of the users asks youto restore a f ile f or him. You locate the correct tarf ile by checking the backup log butdo not know how the directory structure was stored. What command can you use todetermine this?

    Choose one:

    a. tar f x tarf ile dirname

    b. tar tvf tarf ile f ilename

    c. tar ctf tarf ile

    d. tar tvf tarf ile

    PDFmyURL.com

  • Answer: d

    The t switch will list the f iles contained in the tarf ile. Using the v modif ier will displaythe stored directory structure.

    Question:

    You suspect that you have two commands with the same name as the command isnot producing the expected results. What command can you use to determine thelocation of the command being run?

    Answer: which

    The which command searches your path until it f inds a command that matches thecommand you are looking f or and displays its f ull path

    Question:

    What account is created when you install Linux?

    Answer: root

    Whenever you install Linux, only one user account is created. This is the superuseraccount also known as root.

    Question:

    The top utility can be used to change the priority of a running process? Anotherutility that can also be used to change priority is ___________?

    Answer: nice

    Both the top and nice utilit ies provide the capability to change the priority of arunning process.

    PDFmyURL.com

  • nice can be used.

    For already existing process, renice is used.

    Question:

    Bob Armstrong, who has a username of boba, calls to tell you he f orgot hispassword. What command should you use to reset his command?

    Answer: passwd boba

    The passwd command is used to change your password. If you do not specif y ausername, your password will be changed.

    passwd -d boba

    This command however disables the existing passwd and boba can login and issuethe same command

    $passwd

    to set his password

    Question:

    What would you type to send the last 20 lines of a text f ile to STDIN?

    A) end -n 20 f ilename

    B) last -n 20 f ilename

    C) head -20 f ilename

    PDFmyURL.com

  • D) end -20 f ilename

    E) tail -20 f ilename

    Answer: E Use the command tail -20 f ilename to see the last 20 lines of a f ile. Theanswers f or a and d both point to an invalid command. The answer f or b points to avalid command. Typing this answer in with a valid f ile name will even give you someoutput. However, the last command tells you who is logged in, it does not actuallylist the contents of any f ile named in the command. The answer f or c, the headcommand, is used to look at the beginning of a f ile, not the end.

    Question:

    While logged on as a regular user, your boss calls up and wants you to create a newuser account immediately. How can you do this without f irst having to close yourwork, log of f and logon as root?

    Choose one:

    a. Issue the command rootlog.

    b. Issue the command su and type exit when f inished.

    c. Issue the command su and type logof f when f inished.

    d. Issue the command logon root and type exit when f inished.

    Answer: b

    You can use the su command to imitate any user including root. You will be promptedf or the password f or the root account. Once you have provided it you are logged inas root and can do any administrative duties.

    Question: PDFmyURL.com

  • In order to prevent a user f rom logging in, you can add a(n) ________at thebeginning of the password f ield.

    Answer: asterick

    If you add an asterick at the beginning of the password f ield in the /etc/passwd f ile,that user will not be able to log in.

    You can also use

    passwd - l with the username to lock his account.

    Question:

    You have a f ile called phone nos that is almost 4,000 lines long. What text f ilter canyou use to split it into f our pieces each 1,000 lines long?

    Answer: split

    The split text f ilter will divide f iles into equally sized pieces. The def ault length ofeach piece is 1,000 lines.

    Question:

    You have the /var directory on its own partit ion. You have run out of space. Whatshould you do?

    Choose one:

    a. Reconf igure your system to not write to the log f iles.

    b. Use f ips to enlarge the partit ion.

    PDFmyURL.com

  • c. Delete all the log f iles.

    d. Delete the partit ion and recreate it with a larger size.

    Answer: d

    The only way to enlarge a partit ion is to delete it and recreate it. You will then haveto restore the necessary f iles f rom backup.

    If we f eel that we may need to enlarge the partit ion in f uture then we can use LVMpartit ions

    LVM partit ions can be used to enlarge to reduce the partit ions

    LVM can be used with RAID too

    We can also redirect the log f iles path, so we can store log f iles on any otherpartit ion or on any other system

    Question:

    You changed /etc/lilo.conf to cause a boot: prompt to show, however, when yourestart your computer you still do not have a prompt. What should you do?

    Choose one:

    a. Rename your conf iguration f ile to /etc/lilo.conf .new.

    b. Install the conf iguration changes by issuing the command /sbin/lilo

    c. Install the conf iguration changes by issuing the command /sbin/lilo - t

    d. Install the conf iguration changes by issuing the command /sbin/lilo u

    PDFmyURL.com

  • Answer: b

    You have to reinstall LILO in order f or any conf iguration changes to take ef f ect. Thisis done by running /sbin/lilo without any options.

    INSTALL LILO RPM

    AND CHANGE THE DEFAULT OPTION TO

    1 FROM 0 IN GRUB FILE

    Question:

    What is dif f erence between AT and CRON?

    Answers:

    cron can be set only f or a particular t ime but at is used to schedule and execute.

    Question:

    Where are the startup scripts def ined?

    Choose one:

    a. /etc/initd

    b. /etc/scripts

    c. /etc/start

    d. /etc/inittab

    Answer: d PDFmyURL.com

  • The /etc/inittab def ines which start up scripts to run at each runlevel.

    inittab def ines the run level but not

    the startup scripts.

    In the dir. init.d there are dif f erent directorys according to run levels where we candef ine startup scripts.

    Question:

    Which f ile do you need to change to alter how the updatedb database is created?

    Choose one:

    a. /etc/which.conf

    b. /etc/conf .updatedb

    c. /etc/updatedb.conf

    d. /etc/conf .which

    Answer: c

    The /etc/updatedb.conf f ile is used to manage the creation of the updatedbdatabase.

    In Linux How to exclude ip f rom the given range please help me out

    Type system-conf ig-network and conf igure.

    Question: PDFmyURL.com

  • You wish to restore the f ile memo.ben which was backed up in the tarf ileMyBackup.tar. What command should you type?

    Answer: tar xf MyBackup.tar memo.ben

    This command uses the x switch to extract a f ile. Here the f ile memo.ben will berestored f rom the tarf ile MyBackup.tar.

    Question:

    Af ter creating a backup of the users home directories called backup.cpio you areasked to restore a f ile called memo.ben. What command should you type?

    Answer:

    cpio - if backup.cpio memo.ben

    The i tells cpio to extract, F specif ies the archive to examine and the f ile to extract ismemo.ben.

    Question:

    You have written a script called usrs to parse the passwd f ile and create a list ofusernames. You want to have this run at 5 am tomorrow so you can see the resultswhen you get to work. Which of the f ollowing commands will work?

    Choose one:

    a. at 5:00 wed usrs

    b. at 5:00 wed -b usrs

    c. at 5:00 wed - l usrs

    PDFmyURL.com

  • d. at 5:00 wed -d usrs

    Answer: a

    This command will run the script usrs at 5 am tomorrow (which in this case isWednesday).

    Question :

    What is the name and path of the main system log?

    Answer: /var/log/messages

    By def ault, the main system log is /var/log/messages.

    Question :

    What utility can you use to automate rotation of logs?

    Answer: logrotate

    The logrotate command can be used to automate the rotation of various logs.

    Question :

    The maximum size of the swap partit ion is _______ MB.

    Answer: 128

    Although the maximum size f or a swap partit ion is 128 MB, you can have multipleswap partit ions.

    Question :

    PDFmyURL.com

  • You are going to reboot your system but want to warn your users to log of f . Whichof the f ollowing commands will send a message to the users.

    Choose one:

    a. init

    b. halt

    c. reboot

    d. shutdown

    Answer: d

    The shutdown command will send a warning message to your users bef ore bringingthe system down. Neither the reboot or halt command send messages bef orestopping the system.

    Question :

    When looking at the /etc/passwd f ile, you notice that all the password f ields containx. What does this mean?

    Choose one:

    a. That the password is encrypted.

    b. That you are using shadow passwords.

    c. That all passwords are blank.

    d. That all passwords have expired.

    PDFmyURL.com

  • Answer: b

    The x indicates that passwords are stored in the /etc/shadow f ile rather than/etc/passwd.

    Question :

    What command should you use to check the number of f iles and disk space usedand each user s def ined quotas?

    Answer: repquota

    The repquota command is used to get a report on the status of the quotas youhave set including the amount of allocated space and amount of used space.

    Question :

    In order to run f sck on the root partit ion, the root partit ion must be mounted as___________.

    Answer: readonly

    You cannot run f sck on a partit ion that is mounted as read-write.

    Question :

    When you only back up one partit ion, this is called a ______ backup.

    Choose one

    a. Dif f erential

    b. Full

    PDFmyURL.com

  • c. Partial

    d. Copy

    Answer: c

    A partial backup is where you select only a portion of your f ile hierarchy or a singlepartit ion to back up. This is not dependent upon whether or not the f ile has changedsince the last backup.

    Question :

    What can you type at a command line to determine which shell you are using?

    Answer: echo $SHELL

    The name and path to the shell you are using is saved to the SHELL environmentvariable. You can then use the echo command to print out the value of any variableby preceding the variables name with $. Theref ore,

    Typing echo $SHELL will display the name of your shell.

    Question:

    Where is standard output usually directed?

    Answer: to the screen or display

    By def ault, your shell directs standard output to your screen or display.

    The Shells standard output is CONSOLE

    Question:

    PDFmyURL.com

  • You copy the administration directory to Georges home directory.

    -rw-rww- 1 root admin 7202 Sep 17 9:10 administration

    The only group that George is a member of users. He calls you to say he cannotlist the contents of the administration directory. Why cant he look at its contentssince it is in his home directory?

    Choose one:

    a. In order to view the contents of a directory, you must have read permission.George only has write permission.

    b. Only the owner of a directory can list its contents.

    c. George needs to change his def ault group to admin.

    d. George needs to make himself the owner of the administration directory.

    Answer: a

    George only has the permissions granted to others which in this case is write.Without the read permission on the directory, he will not be able to list its contents.

    Question :

    When you issue the command ls - l, the f irst character of the resulting displayrepresents the f iles ___________.

    Answer: type

    The f irst character of the permission block designates the type of f ile that is beingdisplayed.

    PDFmyURL.com

  • Question :

    You have entered the f ollowing cronjob. When will it run? 15 * * * 1,3,5 myscript

    Choose one:

    a. at 15 minutes af ter every hour on the 1st, 3rd and 5th of each month.

    b. at 1:15 am, 3:15 am, and 5:15 am every day

    c. at 3:00 pm on the 1st, 3rd, and 5th of each month

    d. at 15 minutes af ter every hour every Monday, Wednesday, and Friday

    Answer: d

    This would run at 15 minutes af ter the hour on every Monday, Wednesday, andFriday of every month no matter what the date

    Question :

    What command should you use to check your f ilesystem?

    Answer: f sck

    The f sck command is used to check the integrity of the f ilesystem on your disk.

    Question :

    What key combination can you press to suspend a running job and place it in thebackground?

    Answer: ctrl-z

    PDFmyURL.com

  • Using ctrl-z will suspend a job and put it in the background.

    Question :

    If you type the command cat dog &> cat what would you see on your display?Choose one:

    a. Any error messages only.b. The contents of the f ile dog.c. The contents of the f ile dog and any error messages.d. Nothing as all output is saved to the f ile cat.

    Answer: d

    When you use &> f or redirection, it redirects both the standard output and standarderror. The output would be saved to the f ile cat.

    Question :

    Which of the f ollowing commands can be used to get inf ormation about a package?[Choose all correct answers]

    A) manB) listC) aproposD) inf oE) more

    Answer(s): A, C, D The man command pulls up man pages, the inf o command pullsup texinf o pages which have replaced the man pages f or some packages, and theapropos command helps you to f ind related commands. Answers b and e are notmethods of getting inf ormation about a package

    Question :

    PDFmyURL.com

  • Can Linux Use More than 3 Serial Ports by Sharing Interrupts?

    Yes, but wont be able to use simultaneously two ordinary ports which share an interrupt (without some trickery). This is a limitation of the ISA Bus architecture.

    Question :

    Can Linux Use the Same Hard Drive as MS-DOS? OS/2? 386BSD? Win95?

    Yes. Linux supports many, many f ile systems, including the standard MS-DOSpartit ioning scheme, so it can share your disk with other operating systems.

    Linux supports all known versions of the Microsof t FAT and VFAT f ile systems,including those used by Windows 95, Windows 98, Windows NT, Windows 2000 andWindows ME through loadable kernel modules. In a correctly conf igured system, theyshould load automatically when the partit ions are mounted.

    Question :

    Which command do you use to change run levels?

    A) init levelB) runlevelC) levelD) runE) init

    Answer: E The command used to change runlevels is init. Answers a, c, and d pointto invalid commands. Answer b is a valid command, but does not set the currentrunlevel. The runlevel command displays the current runlevel, and the one that wasused directly bef ore entering this one.

    Question :

    PDFmyURL.com

  • Which of the f ollowing commands will show a list of the f iles in your homedirectory including hidden f iles and the contents of all subdirectories?Choose one:

    a. ls -c homeb. ls -aR /home/usernamec. ls -aF /home/usernamed. ls - l /home/username

    Answer: b

    The ls command is used to display a listing of f iles. The -a option will cause hiddenf iles to be displayed as well. The -R option causes ls to recurse down the directorytree. All of this starts at your home directory.

    Question :

    What f ile would you edit in your home directory to change which window manageryou want to use?

    Answer: B The ~/.xinitrc f ile allows you to set which window man-ager you want touse when logging in to X f rom that account. Answers a, d, and e are all invalid f iles.Answer c is the main X server conf iguration f ile.

    Question :

    Where is a good place to store shell scripts that are f or use by the author?

    A) ~/binB) /binC) /usr/binD) /root

    Answer: A It is best to keep scripts meant only f or your account under ~/bin. PDFmyURL.com

  • Answers b, c, d, and e are all valid locations, but not the best places to keep user-specif ic scripts.

    Question :

    What type of local f ile server can you use to provide the distribution installationmaterials to the new machine during a network installation?

    A) InetdB) FSSTNDC) DNSD) NNTPE) NFS

    Answer: E You can use an NFS server to provide the distribution installationmaterials to the machine on which you are perf orming the installation. Answers a, b,c, and d are all valid items but none of them are f ile servers. Inetd is thesuperdaemon which controls all intermittently used network services. The FSSTNDis the Linux File System Standard. DNS provides domain name resolution, and NNTPis the transf er protocol f or usenet news.

    Question :

    What would be displayed as the result of issuing the command ps ef ?Choose one

    a. A listing of the user s running processes f ormatted as a tree.b. A listing of the stopped processesc. A listing of all the running processes f ormatted as a tree

    d. A listing of all system processes f ormatted as a tree.

    Answer: a

    PDFmyURL.com

  • This would show the parent child relationship of all the user s processes.

    #ps ef

    (no dash between command and arguments)#ps -ef(There is a dash between command and arguments)

    Both have entirely dif f erent outputs

    The f irst one will display the output with current shells some global variableseg:USER,LOGNAME,HOME,PATH,MAIL,SHELL,SSH_CLIENT,SSH_CONNECTION,SSH_TTY,TERM,LS_COLORS,HOSTNAME,SHELL,HISTSIZE

    The second one;ps with option -e will display all processes in system and - fwill display f ull inf ormation about all running processes

    Question :

    You attempt to use shadow passwords but are unsuccessf ul. What characteristic ofthe /etc/passwd f ile may cause this?

    Choose one:a. The login command is missing.b. The username is too long.c. The password f ield is blank.d. The password f ield is pref aced by an asterick.

    Answer: c

    The password f ield must not be blank bef ore converting to shadow passwords.

    Question :

    PDFmyURL.com

  • Which f irst- level segment of the f ile system contains a majority of system andserver conf iguration f iles within its subdirectories?

    A) /varB) /etcC) /binD) /sbinE) /lib

    Answer: B The /etc portion of the f ile system contains a number of system anddaemon conf iguration f iles. Answers a, c, d, and e are valid f irst- level directories, butare incorrect. The /var directory contains items that change on a regular basis, suchas log f iles and print and mail spool directories. The /bin directory contains systembinaries, whereas the /sbin directory contains binaries that run with SUID privilegesor as a specif ic user. The /lib directory contains system libraries, both shared andnon-shared.

    Question :

    Where Is the Latest Kernel Version on the Internet?

    The easiest way to update your kernel is to get the update directly f rom thedistribution which you are running.

    If you need or want to conf igure and compile your own kernel, the web page athttp://www.kernel.org/ lists the current versions of the development and productionkernels.If you want to download the source code, FTP to f tp.xx.kernel.org, where xx is thetwo-letter Internet domain abbreviation of your country; e.g., us f or United States,ca f or Canada, or de f or Germany.Kernel versions 2.2.x are archived in the directorypub/linux/kernel/v2.2, as are patches f or the released versions. The kernel sourcecode is archived as a .tar.gz f ile, and as a .tar.bz2 f ile.Follow the instructions in any of the standard ref erences to compile the kernel, asyou would with any other custom kernel. The Documentation subdirectory contains

    PDFmyURL.com

  • inf ormation by the authors of various subsystems and drivers, and much of thatinf ormation is not documented elsewhere.

    Question :

    What is UserLabel Thread?

    Answers:

    User- level avoids the kernel and manages the tables itself . Of ten this is calledcooperative multitasking where the task def ines a set of routines that getswitched to by manipulating the stack pointer. Typically each thread gives-up theCPU by calling an explicit switch, sending a signal or doing an operation that involvesthe switcher. Also, a t imer signal can f orce switches. User threads typically canswitch f aster than kernel threads

    Question :

    Many f actors are taken into account when planning a backup strategy. The one mostimportant one is how of ten does the f ile ____________.

    Answer: change

    If a f ile is static and never changes, then you can back it up less f requently.However, if a f ile changes daily or hourly, then you will want to back it up moref requently to prevent the loss of data.

    Question :

    What is Kernel-Level Threads?

    Answers:

    Kernel- level threads of ten are implemented in the kernel using several tables (each PDFmyURL.com

  • task gets a table of threads). In this case, the kernel schedules each thread withinthe time slice of each process. There is a litt le more overhead with mode switchingf rom user->kernel-> user and loading of larger contexts, but init ial perf ormancemeasures indicate a negligible increase in t ime.

    kernel thread is a process that always in kernel mode , it only accesses kerneladdress spaces , managing kernel activit ies that need to managed on an ongoingbasis .(and not waiting f or an interrupt or system call)

    Question :

    There are seven f ields in the /etc/passwd f ile. Which of the f ollowing lists all thef ields in the correct order?

    Choose one:a. username, UID, GID, home directory, command, commentb. username, UID, GID, comment, home directory, commandc. UID, username, GID, home directory, comment, commandd. username, UID, group name, GID, home directory, comment

    Answer: b

    The seven f ields required f or each line in the /etc/passwd f ile are username, UID,GID, comment, home directory, command. Each of these f ields must be separated bya colon even if they are empty.

    Question :

    Which of the f ollowing commands will show a list of the f iles in your home directoryincluding hidden f iles and the contents of all subdirectories?

    Answers:

    The ls command is used to display a listing of f iles. The -a option will cause hidden

    PDFmyURL.com

  • f iles to be displayed as well. The -R option causes ls to recurse down the directorytree. All of this starts at your home directory.

    Question :

    You have a directory called /home/ben/memos and want to move it to/home/bob/memos so you issue the command mv /home/ben/memos /home/bob.What is the results of this action?Choose one:

    a. The f iles contained in /home/ben/memos are moved to the directory/home/bob/memos/memos.b. The f iles contained in /home/ben/memos are moved to the directory/home/bob/memos.c. The f iles contained in /home/ben/memos are moved to the directory /home/bob/.d. The command f ails since a directory called memos already exists in the targetdirectory.

    Answer: a

    When using the mv command to move a directory, if a directory of the same nameexists then a subdirectory is created f or the f iles to be moved.

    Question:

    Which two documents should you consult bef ore making any f inal purchasingrecommendations?

    Answer(s): A, B The distributions hardware compatibility listing and the generalLinux hardware compatibility listing. These two documents should be consultedbef ore purchasing any equipment f or a Linux box. The simplest way to get things setup is to use hardware covered in the distribution itself . However, if you needsomething that outside drivers are available f or, you will f ind that kind of inf ormationin the general hardware listing. Answers c, d, and e are all premature. Installation,

    PDFmyURL.com

  • use, and administration instructions are not necessary until you actually get to thepoint where the system is already installed, which is f ar af ter the equipment isprocured.

    Question:

    What is the minimum number of partit ions you need to install Linux?

    Answer: 2

    Linux can be installed on two partit ions, one as / which will contain all f iles and aswap partit ion.

    Only two partit ions / and /boot are required, because in

    systems which have suf f icient RAM you dont really need the/swap partit ion as we all know that the reason f or having the swap partit ion.

    Question:- What would be displayed as the result of issuing the command ps ef ? Choose one

    a. A listing of the user s running processes f ormatted as a tree.b. A listing of the stopped processesc. A listing of all the running processes f ormatted as a tree.d. A listing of all system processes f ormatted as a tree.

    Answer: a

    This would show the parent child relationship of all the user s processes.

    #ps ef

    (no dash between command and arguments)#ps -ef

    PDFmyURL.com

  • (There is a dash between command and arguments)

    Both have entirely dif f erent outputs

    The f irst one will display the output with current shells some global variableseg:USER,LOGNAME,HOME,PATH,MAIL,SHELL,SSH_CLIENT,SSH_CONNECTION,SSH_TTY,TERM,LS_COLORS,HOSTNAME,SHELL,HISTSIZE

    The second one;ps with option -e will display all processes in system and - fwill dispaly f ull inf ormation about all running processes

    Question:- What command should you type to see all the f iles with an extension ofmem listed in reverse alphabetical order in the /home/ben/memos directory.

    Answer: ls -r /home/ben/memos/*.mem

    The -c option used with ls results in the f iles being listed in chronological order. Youcan use wildcards with the ls command to specif y a pattern of f ile names.

    Question:- You want to enter a series of commands f rom the command-line. Whatwould be the quickest way to do this?

    Answers:

    Separate each command with a semi-colon (;) and press enter af ter the lastcommand.

    The semi-colon may be used to tell the shell that you are entering multiplecommands that should be executed serially. If these were commands that you wouldf requently want to run, then a script might be more ef f icient. However, to run thesecommands only once, enter the commands directly at the command line.

    Question :

    PDFmyURL.com

  • How to exclude ip address in dhcp ?

    my ranges are 192.168.1.2 192.168.1.20then how do i exclude dif f erent ips like 192.168.1.4 and 7 and 10 f rom the rangeplease help me out

    Answers:

    You will have to use multiple range statements

    range 192.168.1.2 192.168.1.20;range 192.168.1.23 192.168.1.30;The above will exclude 21 and 22

    Question:- When def ining a cronjob, there are f ive f ields used to specif y when thejob will run. What are these f ields and what is the correct order?

    Choose one:a. minute, hour, day of week, day of month, monthb. minute, hour, month, day of month, day of weekc. minute, hour, day of month, month, day of weekd. hour, minute, day of month, month, day of week

    Answer: c

    When creating a cronjob, the time f ields must be entered in the order of minute,hour, day of the month, month and day of the week.

    Question:

    You notice that your server load is exceptionally high during the hours of 10 am to 2noon. When investigating the cause, you suspect that it may be a cron jobscheduled by one of your users. What command can you use to determine if yoursuspicions are correct?

    PDFmyURL.com

  • Choose one:

    a. crontab -ub. crond -uc. crontab - ld. crond l

    Answer: c

    Using the crontab command with the - l option will display all scheduled cron jobs f orall users.

    Question:

    One of your users, Bob, has created a script to reindex his database. Now he has itscheduled to run every day at 10:30 am. What command should you use to deletethis job.

    Choose one:

    a. crontab -ru bobb. crontab -u bobc. crontab -du bob

    d. crontab - lu bob

    Answer: a

    As root, you can use crontab to manage any user s jobs. The -u option is used tospecif y which user s jobs you want to act on. The -r option tells crontab to deletethe job.

    Question: PDFmyURL.com

  • What is the name and path of the def ault conf iguration f ile used by the syslogddaemon?

    Answer: /etc/syslog.conf

    If no conf iguration f ile is specif ied when starting syslogd, then it will start up withthe conf iguration specif ied in the /etc/syslog.conf f ile.

    Question:- You have made changes to the /etc/syslog.conf f ile. Which of thef ollowing commands will cause these changes to be implemented without having toreboot your computer?

    Choose one:

    a. kill SIGHINT `cat /var/run/syslogd.pid`b. kill SIGHUP `cat /var/run/syslogd.pid`c. kill SIGHUP syslogdd. kill SIGHINT syslogd

    Answer: a

    When you use kill with the SIGHUP signal, it stops the daemon, rereads the/etc/syslog.conf f ile, and then starts the syslogd daemon. The last part of thecommand line extracts the PID f or syslogd.

    Question:

    You want to ensure that your system is not overloaded with users running multiplescheduled jobs. A policy has been established that only the system administratorscan create any scheduled jobs. It is your job to implement this policy. How are yougoing to do this?

    Choose one:

    PDFmyURL.com

  • a. creates an empty f ile called /etc/cron.denyb. create a f ile called /etc/cron.allow which contains the names of those allowed toschedule jobs.c. create a f ile called /etc/cron.deny containing all regular usernames.

    d. create two empty f iles called /etc/cron.allow and /etc/cron.deny

    Answer: b

    The crond daemon will examine the f ile /etc/cron.allow whenever a user attempts toinstall a cron job. If that user s name is not in the f ile, he will not be able to installthe cron job.

    Question:

    Which daemon must be running in order to have any scheduled jobs run asscheduled?

    a. crond

    b. atd

    c. atrun

    d. crontab

    Answer: a

    The crond daemon is responsible f or insuring that scheduled jobs run as scheduled.One of its job is to also use atrun to ensure that at jobs are run as well.

    Question:- As the system administrator you need to review Bobs cronjobs. What PDFmyURL.com

  • command would you use?

    a. crontab - lu bobb. crontab -u bobc. crontab - ld. cronq - lu bob

    Answer: a

    The - l option requests a list of jobs f rom crontab and the -u option is used tospecif y which user s jobs you want to see.

    Question:

    Which two utilit ies can you use to set up a job to run at a specif ied time?

    Choose one:

    a. at and crondb. atrun and crontabc. at and crontabd. atd and crond

    Answer: c

    You use the at command to schedule a job to run once. The crontab command isused to schedule recurring jobs.

    Question:

    You want to create a compressed backup of the users home directories so youissue the command gzip /home/* backup.gz but it f ails. The reason that it f ailed isthat gzip will only compress one _______ at a t ime.

    PDFmyURL.com

  • Answer: f ile

    The gzip utility cannot compress multiple f iles in a single operation.

    Question:

    In order to schedule a cronjob, the f irst task is to create a text f ile containing thejobs to be run along with the time they are to run. Which of the f ollowing commandswill run the script MyScript every day at 11:45 pm?

    Choose one:

    a. * 23 45 * * MyScriptb. 23 45 * * * MyScriptc. 45 23 * * * MyScriptd. * * * 23 45 MyScript

    Answer: c

    This line will run the MyScript script at 23:45 or 11:45 pm every day of every monthand every day of the week.

    Question:

    Several of your users have been scheduling large at jobs to run during peak loadtimes. How can you prevent anyone f rom scheduling an at job?

    Choose one:

    a. delete the f ile /etc/at.denyb. create an empty f ile called /etc/at.denyc. create two empty f iles: /etc/at.deny and /etc/at.allow f iled. create an empty f ile called /etc/at.allow

    PDFmyURL.com

  • Answer: a

    If there is not /etc/at.deny f ile, then only the superuser or root may schedule at jobs.

    Question:

    What is the dif f erence between grub and lilo ?

    Answer:

    LILO is the Linux Loader. GRUB is the Grand Unif ied Boot Loader. Both do the samejob. Each has advantages and disadvantages, but in a general sort of way LILO wasmost common in the past, but GRUB is most common now.LILO only loads linux and other boot loaders. and GRUB loads a large number ofOSs.

    LILO stores inf ormation regarding the location of the operating systems it can toload physically on the MBR. If you change your LILO conf ig f ile, you have to rewritethe LILO stage one boot loader to the MBR. Compared with GRUB, this is a muchmore risky option since a misconf igured MBR could leave the system unbootable.With GRUB, if the conf iguration f ile is conf igured incorrectly, it will simply def ault tothe GRUB command-line interf ace.

    * LILO has no interactive command interf ace, whereas GRUB does.

    * LILO does not support booting f rom a network, whereas GRUB does.

    * LILO stores inf ormation regarding the location of the operating systems it can toload physically on the MBR. If you change your LILO conf ig f ile, you have to rewritethe LILO stage one boot loader to the MBR. Compared with GRUB, this is a muchmore risky option since a misconf igured MBR could leave the system unbootable.With GRUB, if the conf iguration f ile is conf igured incorrectly, it will simply def ault tothe GRUB command-line interf ace.

    PDFmyURL.com

  • * LILO only loads linux and other boot loaders. and GRUB loads a large number ofOSs.

    * LILO works by loading itself into a space that will f it on the MBR. Grub has twostages (because it s too overcomplicated to work as well, err I mean as easily aslilo). It loads stage 1 of f the MBR (usually) and stage 2 out of /boot, along with it sconf ig.

    Question:

    What is dif f erence between RAID & LVM ?

    Answer:

    RAID is Redundant Array of Independent Disks. Think of it in simplest terms, withsay RAID and if you have RAID1 setup with two disks, they basically mirror oneanother.

    Disk 1 has 5 partit ions and Disk 2 has the same setup. If Disk 1 has a partit ionf ailure on say hda2, Disk 2 will pick up and take over.

    Its redundant array of disks f or better reliability. In more simply terms, both of thosedisks will mirror one another, so the data is in two locations instead of just one.

    LVM on the other hand is a way to spread data or partit ions across multiple disks orpartit ions, etc. Say you have two hard drives, each 80GB, you could with LVM make itlook and act like one big disk, instead of having two disks.

    RAID is designed f or system reliability. Other than RAID0 which is used to makemultiple disks appear as one big one, all RAID levels ensure that loss of a disk willnot lead to data loss or system crash.

    LVM is RAID0 in that you put together multiple disks into one or more volume groups.Then within each volume group you create logical volumes where you build your f ile

    PDFmyURL.com

  • systems. The real power of LVM is that if you have unallocated space in your volumegroup, then you can unmount a logical volume, extend it in size, extend the f ilesystem and then remount the logical volume. In the event, that you dont have f reespace in the volume group, you can add more disks to your system, use them toextend the volume groups size and then extend the logical volumes. If you dont useLVM and you need a f ilesystem to be bigger, then your only choice is to unmount thef ilesystem, back it up to tape, resize the partit ion, and then restore. Depending onthe sizes this could take quite awhile.

    LVM and RAID solve two dif f erent problems, and should be used to providemaximum reliability and maximum f lexibility.

    LVM is logical volume manager and is used to extend the logical volume if required. itcan be max to the size of disk or physical partit ion.