Simulado Il - LPI

60 Questions

Settings
Please wait...
History Quizzes & Trivia

.


Questions and Answers
  • 1. 
    How can commands such as moving the cursor or copying lines into the buffer be issued multiple times or applie In the vi editor, how can commands such as moving the cursor or copying lines into thebuffer be issued multiple times or applied to multiple rows?
    • A. 

      By using the command :repeat followed by the number and the command.

    • B. 

      By specifying the number right in front of a command such as 4l or 2yj.

    • C. 

      By selecting all affected lines using the shift and cursor keys before applying the command.

    • D. 

      By issuing a command such as :set repetition=4 which repeats every subsequent command 4 times.

  • 2. 
    Which of the following files, located in the user home directory, is used to store the Bash history? Which of the following files, located in the user home directory, is used to store the Bashhistory?
    • A. 

      .history_bash

    • B. 

      .bash_history

    • C. 

      .bash_histfile

    • D. 

      .bashrc_history

    • E. 

      .history

  • 3. 
    Which file the user history is stored when exiting a Bash process? Which Bash environment variable defines in which file the user history is stored whenexiting a Bash process? (Specify ONLY the variable name.)
    • A. 

      Atenção sem mais alternativas para a questão

    • B. 

      HISTFILE

    • C. 

      Option 3

    • D. 

      Option 4

  • 4. 
    Which of the following commands displays the contents of a gzip compressed tar archive? Which of the following commands displays the contents of a gzip compressed tar archive?
    • A. 

      Gzip archive.tgz | tar xvf –

    • B. 

      Tar ztf archive.tgz

    • C. 

      Gzip -d archive.tgz | tar tvf –

    • D. 

      Tar cf archive.tgz

  • 5. 
    Which grep command will print only the lines that do not end with a / in the file foo? Which grep command will print only the lines that do not end with a / in the file foo?
    • A. 

      Grep ‘/#’ foo

    • B. 

      Grep -v ‘/$’ foo

    • C. 

      Grep ‘/$’ foo

    • D. 

      Grep -v ‘/#’ foo

  • 6. 
    Which of the following commands is used to change options and positional parameters for a running Bash? Which of the following commands is used to change options and positional parameters for arunning Bash?
    • A. 

      Envsetup

    • B. 

      History

    • C. 

      Set

    • D. 

      Bashconf

    • E. 

      Setsh

  • 7. 
    Which of the following commands replaces each occurrence of ‘bob’ in the file letter with ‘B Which of the following commands replaces each occurrence of ‘bob’ in the file letter with‘Bob’ and writes the result to the file newletter?
    • A. 

      Sed ‘s/bob/Bob/g’ letter > newletter

    • B. 

      Sed ‘s/bob, Bob/’ letter > newletter

    • C. 

      Sed ‘s/bob/Bob’ letter > newletter

    • D. 

      Sed ‘/bob/Bob’ letter > newletter

    • E. 

      Sed s/bob/Bob/ letter < newletter

  • 8. 
    Which of the following commands directly executes the instruction from the file /usr/local/bin/runme.sh withou From a Bash shell, which of the following commands directly executes the instruction fromthe file /usr/local/bin/runme.sh without starting a subshell? (Please select TWO answers.)
    • A. 

      Source /usr/local/bin/runme.sh

    • B. 

      . /usr/local/bin/runme.sh

    • C. 

      /bin/bash /usr/local/bin/runme.sh

    • D. 

      /usr/local/bin/runme.sh

    • E. 

      Run /usr/local/bin/runme.sh

  • 9. 
    Which of the following statements is correct? Regarding the command: nice -5 /usr/bin/prog Which of the following statements is correct?
    • A. 

      /usr/bin/prog is executed with a nice level of -5.

    • B. 

      /usr/bin/prog is executed with a nice level of 5.

    • C. 

      /usr/bin/prog is executed with a priority of -5.

    • D. 

      /usr/bin/prog is executed with a priority of 5.

  • 10. 
    Which shell command is used to continue background execution of a suspended command? Which shell command is used to continue background execution of a suspendedcommand?
    • A. 

      Exec

    • B. 

      Cont

    • C. 

      Bg

    • D. 

      &

    • E. 

      :&

  • 11. 
    Which of the following shell redirections will write standard output and standard error output to a file named Which of the following shell redirections will write standard output and standard error outputto a file named filename?
    • A. 

      2>&1 >filename

    • B. 

      >filename 2>&1

    • C. 

      1>&2>filename

    • D. 

      >>filename

    • E. 

      1&2>filename

  • 12. 
    Which of the following commands will copy the current line into the vi buffer? In the vi editor, which of the following commands will copy the current line into the vi buffer? 
    • A. 

      C

    • B. 

      Cc

    • C. 

      Lc

    • D. 

      Yy

    • E. 

      Ly

  • 13. 
    Which of the following sequences in the vi editor saves the opened document and exits the editor? Which of the following sequences in the vi editor saves the opened document and exits theeditor? (Choose TWO correct answers.)
    • A. 

      Esc :wq!

    • B. 

      Ctrl XX

    • C. 

      Ctrl :w!

    • D. 

      Esc ZZ

    • E. 

      Esc zz

  • 14. 
    Which nice level is set for the resulting process? When starting a program with the nice command without any additional parameters, whichnice level is set for the resulting process?
    • A. 

      0

    • B. 

      10

    • C. 

      20

    • D. 

      -10

  • 15. 
    Which of the following commands will reduce all consecutive spaces down to a single space? Which of the following commands will reduce all consecutive spaces down to a singlespace?
    • A. 

      Tr -c ‘ ‘ < a.txt > b.txt

    • B. 

      Tr -s ‘ ‘ < a.txt > b.txt

    • C. 

      Tr -d ‘ ‘ < a.txt > b.txt

    • D. 

      Tr ‘\s’ ‘ ‘ < a.txt > b.txt

    • E. 

      Tr -r ‘ ‘ ‘\n’ < a.txt > b.txt

  • 16. 
     Which character, added to the end of a command, runs that command in the background as a child process of the Which character, added to the end of a command, runs that command in the background asa child process of the current shell?
    • A. 

      #

    • B. 

      !

    • C. 

      +

    • D. 

      &

    • E. 

      %

  • 17. 
    Which of the following commands will print the last 10 lines of a text file to the standard output? Which of the following commands will print the last 10 lines of a text file to the standardoutput?
    • A. 

      Tail -n 10 filename

    • B. 

      Head -n 10 filename

    • C. 

      Cat -n 10 filename

    • D. 

      Dump -n 10 filename

  • 18. 
    Which of the following commands prints a list of usernames (first column) and their primary group (fourth colu Which of the following commands prints a list of usernames (first column) and their primarygroup (fourth column) from the /etc/passwd file?
    • A. 

      Fmt -f 1,4 /etc/passwd

    • B. 

      Split -c 1,4 /etc/passwd

    • C. 

      Cut -d : -f 1,4 /etc/passwd

    • D. 

      Paste -f 1,4 /etc/passwd

  • 19. 
    Which of the following signals is sent to a process when the key combination CTRL+C is pressed on the keyb Which of the following signals is sent to a process when the key combination CTRL+C is pressed on the keyboard?
    • A. 

      SIGINT

    • B. 

      SIGSTOP

    • C. 

      SIGTERM

    • D. 

      SIGKILL

  • 20. 
    Which of the following are valid stream redirection operators within Bash? Which of the following are valid stream redirection operators within Bash? (Choose THREEcorrect answers.)
    • A. 

      %>

    • B. 

    • C. 

    • D. 

      >

    • E. 

      >>>

  • 21. 
    What happens after issuing the command vi without any additional parameters? What happens after issuing the command vi without any additional parameters?
    • A. 

      Vi starts and loads the last file used and moves the cursor to the position where vi was when it last exited.

    • B. 

      Vi starts and requires the user to explicitly either create a new or load an existing file

    • C. 

      Vi exits with an error message as it cannot be invoked without a file name to operate on.

    • D. 

      Vi starts in command mode and opens a new empty file.

    • E. 

      Vi starts and opens a new file which is filled with the content of the vi buffer if the buffer contains text.

  • 22. 
    Which of the following command sets the Bash variable named TEST with the content FOO? Which of the following command sets the Bash variable named TEST with the contentFOO?
    • A. 

      Set TEST=”FOO”

    • B. 

      TEST=”FOO”

    • C. 

      TEST = “FOO”

    • D. 

      Var TEST=”FOO”

  • 23. 
    Which a Bash shell searches for executable commands? Which variable defines the directories in which a Bash shell searches for executablecommands?
    • A. 

      BASHEXEC

    • B. 

      BASHRC

    • C. 

      PATH

    • D. 

      EXECPATH

    • E. 

      PATHRC

  • 24. 
    Which contains information about all common file types? Which of the following commands determines the type of a file by using a definitiondatabase file which contains information about all common file types?
    • A. 

      Magic

    • B. 

      Hash

    • C. 

      Pmagic

    • D. 

      Type

    • E. 

      File

  • 25. 
     Which command is used in a Linux environment to create a new directory? Which command is used in a Linux environment to create a new directory? (Specify ONLYthe command without any path or parameters.)
    • A. 

      Mkdir, /usr/bin/mkdir

    • B. 

      Atenção sem mais alternativas

    • C. 

      Option 3

    • D. 

      Option 4

  • 26. 
    Which are also owned by the user root? Which of the following commands prints all files and directories within the /tmp directory orits subdirectories which are also owned by the user root? (Choose TWO correct answers.)
    • A. 

      Find /tmp -uid root -print

    • B. 

      Find -path /tmp -user root –print

    • C. 

      Find /tmp -user root

    • D. 

      Find /tmp -user root -print

    • E. 

      Find -path /tmp -uid root

  • 27. 
    Why is /tmp/file empty afterwards? When running the command sed -e “s/a/b/” /tmp/file >/tmp/file While /tmp/file contains data,why is /tmp/file empty afterwards?
    • A. 

      The file order is incorrect. The destination file must be mentioned before the command to ensure redirection.

    • B. 

      The command sed did not match anything in that file therefore the output is empty.

    • C. 

      When the shell establishes the redirection it overwrites the target file before the redirected command starts and opens it for reading.

    • D. 

      Redirection for shell commands do not work using the > character. It only works using the | character instead.

  • 28. 
    Which of the following output is created? When given the following command line. echo “foo bar” | tee bar | cat Which of the followingoutput is created?
    • A. 

      Cat

    • B. 

      Foo bar

    • C. 

      Tee bar

    • D. 

      Bar

    • E. 

      Foo

  • 29. 
    Which of the following commands can be used to determine how long the system has been running? Which of the following commands can be used to determine how long the system has beenrunning? (Choose TWO correct answers.)
    • A. 

      Top

    • B. 

      Uname -u

    • C. 

      Uptime

    • D. 

      Up

    • E. 

      Time –up

  • 30. 
    Which of the following are valid stream redirection operators within Bash? Which of the following are valid stream redirection operators within Bash? (Choose THREEcorrect answers.)
    • A. 

      %>

    • B. 

    • C. 

    • D. 

      >

    • E. 

      >>>

  • 31. 
    Which of the following describes the resulting situation? After successfully creating a hard link called bar to the ordinary file foo, foo is deleted fromthe filesystem. Which of the following describes the resulting situation?
    • A. 

      The user is prompted whether bar should be removed, too.

    • B. 

      Both foo and bar would remain accessible.

    • C. 

      Foo would be removed. bar would still exist but would be unusable.

    • D. 

      Foo and bar would both be removed.

    • E. 

      Foo would be removed while bar would remain accessible.

  • 32. 
    How can the former path of the data be kept intact in order to avoid reconfiguration of existing applications? After moving data to a new filesystem, how can the former path of the data be kept intact inorder to avoid reconfiguration of existing applications? (Choose TWO correct answers.)
    • A. 

      By creating an ACL redirection from the old to the new path of the data.

    • B. 

      By mounting the new filesystem on the original path of the data.

    • C. 

      By running the command touch on the old path.

    • D. 

      By creating a symbolic link from the old to the new path of the data.

    • E. 

      By creating a hard link from the old to the new path of the data.

  • 33. 
    Which of the following commands changes the ownership of file.txt to the user dan and the group staff?seenagapeSeptember 29, 2015Which of the following commands changes the ownership of file.txt to the user dan and thegroup staff?
    • A. 

      Chown dan/staff file.txt

    • B. 

      Chown dan:staff file.txt

    • C. 

      Chown -u dan -g staff file.txt

    • D. 

      Chown dan -g staff file.txt

  • 34. 
    Which of the following commands makes /bin/foo executable by everyone but writable only by its owner?seenagapeSeptember 29, 2015Which of the following commands makes /bin/foo executable by everyone but writable onlyby its owner?
    • A. 

      Chmod o+rwx,a+rx /bin/foo

    • B. 

      Chmod 577 /bin/foo

    • C. 

      Chmod u=rwx,go=rx /bin/foo

    • D. 

      Chmod 775 /bin/foo

  • 35. 
    Which of the following commands can be used to search for the executable file foo when it has been placed in aseenagapeSeptember 29, 2015Which of the following commands can be used to search for the executable file foo when ithas been placed in a directory not included in $PATH?
    • A. 

      Whereis

    • B. 

      Apropos

    • C. 

      Which

    • D. 

      Find

    • E. 

      Query

  • 36. 
    What does the command mount -a do?seenagapeSeptember 29, 2015What does the command mount -a do?
    • A. 

      It ensures that all file systems listed in /etc/fstab are mounted regardless of their options.

    • B. 

      It ensures that all file systems listed with the option auto in /etc/fstab are mounted.

    • C. 

      It opens an editor with root privileges and loads /etc/fstab for editing.

    • D. 

      It ensures that all file systems listed with the option noauto in /etc/fstab are mounted.

    • E. 

      It shows all mounted file systems that have been automatically mounted.

  • 37. 
    Which of the following settings for umask ensures that new files have the default permissions -rw-r– seenagapeSeptember 29, 2015Which of the following settings for umask ensures that new files have the defaultpermissions -rw-r– — ?
    • A. 

      0017

    • B. 

      0640

    • C. 

      0038

    • D. 

      0027

  • 38. 
    Which of the following is the device file name for the second partition on the only SCSI drive?seenagapeSeptember 29, 2015Which of the following is the device file name for the second partition on the only SCSIdrive?
    • A. 

      /dev/hda1

    • B. 

      /dev/sda2

    • C. 

      /dev/sd0a2

    • D. 

      /dev/sd1p2

  • 39. 
    Which of the following commands could be used?seenagapeSeptember 29, 2015In order to display all currently mounted filesystems, which of the following commands couldbe used? (Choose TWO correct answers.)
    • A. 

      Free

    • B. 

      Cat /proc/filesystems

    • C. 

      Cat /proc/self/mounts

    • D. 

      Lsmounts

    • E. 

      Mount

  • 40. 
    Which of the following commands can be used to locate programs and their corresponding man pages and configuraseenagapeSeptember 29, 2015Which of the following commands can be used to locate programs and their correspondingman pages and configuration files?
    • A. 

      Dirname

    • B. 

      Which

    • C. 

      Base name

    • D. 

      Query

    • E. 

      Where is

  • 41. 
    Which of the following commands changes the number of days before the ext3 filesystem on /dev/sda1 has to runseenagapeSeptember 29, 2015Which of the following commands changes the number of days before the ext3 filesystemon /dev/sda1 has to run through a full filesystem check while booting?
    • A. 

      Tune2fs -d 200 /dev/sda1

    • B. 

      Tune2fs -c 200 /dev/sda1

    • C. 

      Tune2fs -i 200 /dev/sda1

    • D. 

      Tune2fs -n 200 /dev/sda1

    • E. 

      Tune2fs –days 200 /dev/sda1

  • 42. 
    Which type of filesystem is created by mkfs when it is executed with the block device name only and without anseenagapeSeptember 29, 2015Which type of filesystem is created by mkfs when it is executed with the block device nameonly and without any additional parameters?
    • A. 

      Ext3

    • B. 

      VFAT

    • C. 

      Ext4

    • D. 

      Ext2

    • E. 

      XFS

  • 43. 
    How many fields are in a syntactically correct line of /etc/fstab?seenagapeSeptember 29, 2015How many fields are in a syntactically correct line of /etc/fstab?
    • A. 

      3

    • B. 

      4

    • C. 

      5

    • D. 

      6

    • E. 

      7

  • 44. 
    Which command is used to create and initialize the files used to store quota information?seenagapeSeptember 29, 2015Which command is used to create and initialize the files used to store quota information?(Specify ONLY the command without any path or parameters.)
    • A. 

      Quotacheck

    • B. 

      Atenção sem outras alternativas para questão

    • C. 

      Option 3

    • D. 

      Option 4

  • 45. 
    Which of the following file permissions belong to a symbolic link?seenagapeSeptember 29, 2015Which of the following file permissions belong to a symbolic link?
    • A. 

      -rwxrwxrwx

    • B. 

      +rwxrwxrwx

    • C. 

      Lrwxrwxrwx

    • D. 

      Srwxrwxrwx

  • 46. 
    What could be the reason for this?seenagapeSeptember 29, 2015Creating a hard link to an ordinary file returns an error. What could be the reason for this?
    • A. 

      The source file is a shell script.

    • B. 

      The source file is already a hard link.

    • C. 

      The source file is hidden.

    • D. 

      The source file is read-only.

    • E. 

      The source and the target are on different filesystems.

  • 47. 
    Which of the following commands creates an ext3 filesystem on /dev/sdb1?seenagapeSeptember 29, 2015Which of the following commands creates an ext3 filesystem on /dev/sdb1? (Choose TWOcorrect answers.)
    • A. 

      /sbin/mke2fs -j /dev/sdb1

    • B. 

      /sbin/mkfs -t ext3 /dev/sdb1

    • C. 

      /sbin/mkfs -c ext3 /dev/sdb1

    • D. 

      /sbin/mke3fs -j /dev/sdb1

  • 48. 
    Which of the following commands will change the quota for a specific user?seenagapeSeptember 29, 2015Which of the following commands will change the quota for a specific user?
    • A. 

      Repquota

    • B. 

      Quota -e

    • C. 

      Edquota

    • D. 

      Quota

  • 49. 
    Which utility would be used to change how often a filesystem check is performed on an ext2 filesystem withseenagapeSeptember 29, 2015Which utility would be used to change how often a filesystem check is performed on an ext2 filesystem without losing any data stored on that filesystem?
    • A. 

      Fixe2fs

    • B. 

      Mod2fs

    • C. 

      Fsck

    • D. 

      Tune2fs

    • E. 

      Mke2fs

  • 50. 
    Which of the following Linux filesystems preallocates a fixed number of inodes at the filesystem’s make/seenagapeSeptember 29, 2015Which of the following Linux filesystems preallocates a fixed number of inodes at thefilesystem’s make/creation time and does NOT generate them as needed? (Choose TWOcorrect answers.)
    • A. 

      Procfs

    • B. 

      XFS

    • C. 

      Ext2

    • D. 

      Ext3

    • E. 

      JFS

  • 51. 
    What is the purpose of the Filesystem Hierarchy Standard?seenagapeSeptember 29, 2015What is the purpose of the Filesystem Hierarchy Standard?
    • A. 

      It is a security model used to ensure files are organized according to their permissions and accessibility.

    • B. 

      It provides unified tools to create, maintain and manage multiple filesystems in a common way.

    • C. 

      It defines a common internal structure of inodes for all compliant filesystems.

    • D. 

      It is a distribution neutral description of locations of files and directories.

  • 52. 
    Which umask value will result in the default access permissions of 600 (rw——-) for files and 700 (seenagapeSeptember 29, 2015Which umask value will result in the default access permissions of 600 (rw——-) for filesand 700 (rwx——) for directories? (Specify only the numerical umask value.)
    • A. 

      0077, 077

    • B. 

      Atenção sem alternativas para esta questão

    • C. 

      Option 3

    • D. 

      Option 4

  • 53. 
    What other options may be used to identify the intended partition?seenagapeSeptember 29, 2015Instead of supplying an explicit device in /etc/fstab for mounting, what other options may beused to identify the intended partition? (Choose TWO correct answers.)
    • A. 

      UUID

    • B. 

      FIND

    • C. 

      ID

    • D. 

      LABEL

    • E. 

      NAME

  • 54. 
    What is a common reason for this message?seenagapeSeptember 29, 2015After running the command umount /mnt, the following error message is displayed: umount:/mnt: device is busy. What is a common reason for this message?
    • A. 

      The kernel thinks that a process is about to open a file in /mnt for reading.

    • B. 

      The files in /mnt have been scanned and added to the locate database.

    • C. 

      The kernel has not finished flushing disk writes to the mounted device.

    • D. 

      A user has a file open in the /mnt directory.

    • E. 

      Another file system still contains a symlink to a file inside /mnt.

  • 55. 
    What does the command mount -a do?seenagapeSeptember 29, 2015What does the command mount -a do?
    • A. 

      It mounts all available filesystems onto the current directory.

    • B. 

      It shows all mounted filesystems

    • C. 

      It mounts all user mountable filesystems for the current user.

    • D. 

      It mounts all filesystems listed in /etc/fstab which have the option auto set.

    • E. 

      It mounts all filesystems listed in /etc/fstab which have the option no auto set.

  • 56. 
    Which of the following commands set the sticky bit for the directory /tmp?seenagapeSeptember 29, 2015Which of the following commands set the sticky bit for the directory /tmp? (Choose TWOcorrect answers.)
    • A. 

      Chmod +s /tmp

    • B. 

      Chmod +t /tmp

    • C. 

      Chmod 1775 /tmp

    • D. 

      Chmod 4775 /tmp

    • E. 

      Chmod 2775 /tmp

  • 57. 
    Which of the following commands can be used to display the inode number of a given file?seenagapeSeptember 29, 2015Which of the following commands can be used to display the inode number of a given file?
    • A. 

      Ls

    • B. 

      Ln

    • C. 

      Inode

    • D. 

      Cp

  • 58. 
    Which of the following commands shows the definition of a given shell command?seenagapeSeptember 29, 2015Which of the following commands shows the definition of a given shell command?
    • A. 

      Where

    • B. 

      Stat

    • C. 

      Type

    • D. 

      Case

  • 59. 
    What do the permissions -rwSr-xr-x mean for a binary file when it is executed as a command?seenagapeSeptember 29, 2015What do the permissions -rwSr-xr-x mean for a binary file when it is executed as acommand?
    • A. 

      The command is SetUID and it will be executed with the effective rights of the owner.

    • B. 

      The command will be executed with the effective rights of the group instead of the owner.

    • C. 

      The execute flag is not set for the owner. Therefore the SetUID flag is ignored.

    • D. 

      The command will be executed with the effective rights of the owner and group.

  • 60. 
    Which of the following pieces of information of an existing file is changed when a hard link pointing to thatseenagapeSeptember 29, 2015Which of the following pieces of information of an existing file is changed when a hard linkpointing to that file is created?
    • A. 

      Permissions

    • B. 

      File size

    • C. 

      Modify timestamp

    • D. 

      Link count

    • E. 

      Inode number