LX0-102 Pract

  1. Legacy program for sending files to printer queue is:

    C. lpr
  2. What entry can be added to syslog.conf to have all syslog msgs generated send to virtual console 12?

    C. *.* /dev/tty12
  3. On a system running the K Display Mgr, when is the /etc/kde4/kdm/Xreset script automatically executed?

    E. When a user's x session exits
  4. Which of the following SQL statements will select the fields name and address from the contacts table?

    C. SELECT name, address FROM contacts;
  5. Which command will print the exit value of the previous command to the screen in bash?

    D. echo $?
  6. Suppose that the cmd netstat -a hangs for a long time without producing output. You might suspect:

    C. a problem with DNS
  7. Which of the following lines would you find in the file /etc/resolv.conf?

    • D. domain mycompany.com
    • Don't confuse this with /etc/nsswitch.conf
  8. Which of the following looks like a correct entry in the /etc/hosts file?

    E. localhost.localdomain localhost
  9. When attempting to send a file to another user securely using GPG, which of the following actions must be done?

    E. Encrypt the file using their public key
  10. You need to pause the CUPS printer HPLaserjet4, and you want to cancel all print jobs with a message "Hello." Cmd to do this?

    • C. cupsdisable -c -r hello HPLaserjet4
    • -c is cancel
    • -r is to print a reason.
  11. What output will the following cmd sequence produce?
    echo '1 2 3 4 5 6' | while read a b c; do
    echo result: $c $b $a; done

    A. result: 3 4 5 6 2 1
  12. Your investigation of a system turns up a file that contains the line below:
    find /home -iname .rhosts -exec rm -f {} \;
    What's the purpose of this script?

    • B. To enhance system security
    • .rhosts file controls which machines trust other machines for access to your account. Bypasses need for a password.
  13. You need to print 12 copies of the document foo.txt. Which cmd would you use?

    D. cat foo.txt | lpr -#12
  14. What BASH env var will prevent you from overwriting a file with > or >>?

    E. set -o noclobber
  15. In the following cmd and its output:
    $ echo $$
    What is 12942?

    C. the process ID of the current shell
  16. We have bash script ~/myscript show below:
    shift echo $2
    We call this script:
    ~/myscript alpha beta gamma delta
    What will we see?

    B. gamma
  17. To test a shell script called mysript, the env var FOOBAR must be removed temporarily. How can this be done?

    C. env -u FOOBAR myscript
  18. Which of the following commands shows ONLY the user-id of Bob?

    • B. cat /etc/passwd | grep Bob | cut -d: -f3
    • c. grep Bob /etc/passwd | awk -F: '{ print $3 }'
    • For awk, -F specifies delimiter.
  19. Which cmd allows you to make a shell var visible to subshells?

    A. export VARIABLE
  20. On a system using shadowed passwords, the correct permissions for /etc/passwd are __ and the correct permissions for /etc/shadow are __.

    E. -rw-r--r--, -r--------
  21. Which of the following lines would you find in the file /etc/host.conf?

    • B. order hosts, bind
    • hosts refers to /etc/hosts and bind refers to DNS lookup.
  22. Which two services resolve Netbios names to IP addresses?

    • E. WINS
    • d. nmbd
  23. Which of the following will run a file named /myscript every 23 minutes past midnight every 2 hours?

    A. 23 0-23/2 * * * /myscript
  24. Which of the following lines would you expect to see in the file /etc/protocols?

    C. udp 17 UDP
  25. How can you verify the integrity of the /etc/passwd file?

    D. pwck
  26. User bob complains that he can't access his email. In which dir would you look to see if there's any deliverable mail for him?

    A. /var/spool/mail
  27. To avoid spammers using your mail server to relay their messages, you need to ______.

    C. Set up a ruleset for this in /etc/sendmail.cf
  28. One of your users has installed a commercial publishing program that works under X on a variety of Unix and Linux platforms. The user made a series of config changes regarding the initial window size, location and color. Now he is having difficulties undoing these changes and is asking for your help. In which file would you think you would most likely find the configuration settings you are seeking to change?

    A. ~/.Xdefaults
  29. Your machine's IP address used to function, but it's only got the localhost "lo" entry now. What three client-mode commands could you possibly use to get a new DHCP address?
    a. dhcpd
    b. ipconfig
    c. dhclient
    d. pump
    e. dhcpcd
    • c. dhclient
    • d. pump
    • e. dhcpcd
  30. What are the first two characters of an MD5 hashed password?

    D. $1
Card Set
LX0-102 Pract
Linux+ 2 of 2