Linux LPI 117-101 # 5 Of 9

57 Questions | Total Attempts: 141

SettingsSettingsSettings
Linux Quizzes & Trivia

Linux lpi testing


Questions and Answers
  • 1. 
    What switch is used with the useradd command to specify a user's initial group?
    • A. 

      -g

    • B. 

      -i

    • C. 

      -u

    • D. 

      -ig

  • 2. 
    What option is used with the useradd command to specify the user's user id?
    • A. 

      -u

    • B. 

      -s

    • C. 

      -ui

    • D. 

      -id

  • 3. 
    What option is used with the useradd command to specify the user's login shell?
    • A. 

      -s

    • B. 

      -l

    • C. 

      -u

    • D. 

      -sh

  • 4. 
    Which of the following can be used to change a user's home directory?
    • A. 

      Usermod -d

    • B. 

      Usermod -h

    • C. 

      Usermod -u

    • D. 

      Usermod -c

  • 5. 
    You had a contractor come into your company. You originally set his account to expireafter thirty days. You now need to change this. How can you do this?
    • A. 

      Usermod -e

    • B. 

      Usermod -a

    • C. 

      Usermod -x

    • D. 

      Usermod -d

  • 6. 
    You are logged in as user tux1, but now you want to switch users to tux2 with tux2'senvironment. How would you do this?
    • A. 

      Su tux2

    • B. 

      Su -e tux2

    • C. 

      Su - tux2

    • D. 

      Su -m tux2

    • E. 

      Su -f tux2

  • 7. 
    You logged in as user linux1, but now you want to switch users to linux2 with linux'senvironment. How would you do this?
    • A. 

      Su linux2

    • B. 

      Su -e linux2

    • C. 

      Su - linux2

    • D. 

      Su -m linux2

    • E. 

      Su -f linux2

  • 8. 
    Which of these commands would report how many total accounts (including specialaccounts) there are?
    • A. 

      Count /etc/passwd

    • B. 

      Nl /etc/passwd | head

    • C. 

      Wc --users /etc/passwd

    • D. 

      Wc --lines /etc/passwd

    • E. 

      Expand --lines /etc/passwd

  • 9. 
    What does the following command do?            cat '$TEST'
    • A. 

      Displays a bash syntax error message.

    • B. 

      Displays the contents of the file named $TEST if it exists.

    • C. 

      Waits for the user to enter text and then echos the text back.

    • D. 

      Displays the contents of the file named inside the back quotes.

    • E. 

      Displays the contents of the named by the environment variable TEST.

  • 10. 
      file1 and file2 are text files in your local directory.            file1 contains this:            allan            bart            ceasar            file2 contains this:            alicia            beatrice            Cecilia            What would the output of the following command be?            tac file1 file2
    • A. 

      Allan/ bart/ ceasar/ alicia/ beatrice/ cecilia

    • B. 

      Alicia/ beatrice/ cecilia/ allan/ bart/ ceasar

    • C. 

      Alicia/ beatrice/ cecilia/ ceasar/ bart/ allan

    • D. 

      Cecilia/ beatrice/ alicia/ ceasar/ bart/ allan

    • E. 

      Ceasar/ bart/ allan/ cecilia/ beatrice/ alicia

  • 11. 
    Which of the following would copy the file file1.txt to file2.txt?
    • A. 

      Cp file1.txt | file2.txt

    • B. 

      Cat file1.txt | file2.txt

    • C. 

      Cat file1.txt > file2.txt

    • D. 

      Copy file1.txt | file2.txt

    • E. 

      Cat | file1.txt | file2.txt

  • 12. 
    What command would help you identify the I/O address range being used by thenetwork card?
    • A. 

      Cat /proc/modules

    • B. 

      Cat /proc/devices

    • C. 

      Cat /proc/meminfo

    • D. 

      Cat /io/dma

    • E. 

      Cat /proc/ioports

  • 13. 
    Type the command will identify the io address range used by a NIC?
  • 14. 
     What is the result of the following command?# cat 'echo "$ Certkiller
    • A. 

      A syntax error

    • B. 

      The value of $ Certkiller

    • C. 

      Cat followed by the value of $ Certkiller

    • D. 

      Echo followed by the value of $ Certkiller

    • E. 

      Echo followed by $ Certkiller

  • 15. 
    To convert all uppercase letters in stream to lowercase, pipe the stream into which
    • A. 

      Tr A-Z a-z

    • B. 

      Tac A-Z a-z

    • C. 

      Sed /A-Z a-z

    • D. 

      Sed -tolower

    • E. 

      Conv [A-Z] [a-z]

  • 16. 
     Which of the following command would most likely be used to output a file inreverse? Choose TWO correct answers.
    • A. 

      Tac

    • B. 

      Pr

    • C. 

      Rev

    • D. 

      Sed

    • E. 

      Back

  • 17. 
    You have a file with the following contents:            A. allan            B. bart            C. ceasar            D. alicia            E. beatrice            F. ceciliaWhat single command could you use to list the file contents in reverse order? (Includeonly the command without options or arguments)
  • 18. 
    You have a file with the following contents:            A. allan            B. bart            C. ceasar            D. alicia            E. beatrice            F. CeciliaWhat single command could you use to list the file contents in reverse order? Pleaseinclude only the command without options or arguments.
  • 19. 
    What command will easily convert tabs in files to spaces?
    • A. 

      Convert

    • B. 

      Expand

    • C. 

      Tr

    • D. 

      Sed

    • E. 

      None of the above

  • 20. 
    Which of the following would do the same as the command cat < file1.txt > file2.txt?
    • A. 

      Cat < file1.txt file2.txt

    • B. 

      Cat file1.txt >file2.txt

    • C. 

      Cat

    • D. 

      Cat file 1.txt | file2.txt

    • E. 

      Cp file1.txt>file2.txt

  • 21. 
    Which of the commands will show you only the middle 10 lines of a 30 line text filenamed textfile?
    • A. 

      Head -n 11-20 textfile

    • B. 

      Head -n 20 textfile | tail

    • C. 

      Tail -n 11-20

    • D. 

      Cat textfile | pr -n 11-20

    • E. 

      Nl -n 11-30 textfile

  • 22. 
    What command will show the first 10 lines of a file by default?
    • A. 

      Head

    • B. 

      Cat

    • C. 

      Tac

    • D. 

      Nl

    • E. 

      Tail

  • 23. 
    What command will show the last 10 lines of a file by default?
    • A. 

      Tail

    • B. 

      Head

    • C. 

      Cat

    • D. 

      Prstat

    • E. 

      Ps

  • 24. 
    Your lead sysadmin has asked you to add a second NIC to a Linux machine.Which of the following commands would be best to determine which interrupts arecurrently in use on this machine?
    • A. 

      Cat /proc/ioports

    • B. 

      Cat /proc/interrupts

    • C. 

      Cat /proc/memoryinfo

    • D. 

      Which interrupts

    • E. 

      Tail /var/log/messages

  • 25. 
    Which of the following will copy file1.txt to file2.txt? Choose Two.
    • A. 

      Cat file1.txt > file2.txt

    • B. 

      Cat file1.txt | file2.txt

    • C. 

      Cp file1.txt > file2.txt

    • D. 

      Cp file1.txt file2.txt

    • E. 

      Cpio < file1.txt > file2.txt

Back to Top Back to top