Examen 101 - LPI Chapter 4,5: Managing Files (31 de 50)

Descripción

Se aprueba con 31 preguntas como minimo.
Carlos Alberto Jara Alva
Test por Carlos Alberto Jara Alva, actualizado hace más de 1 año
Carlos Alberto Jara Alva
Creado por Carlos Alberto Jara Alva hace casi 9 años
186
0

Resumen del Recurso

Pregunta 1

Pregunta
You type mkdir one/two/three and receive an error message that reads, in part, No such file or directory. What can you do to overcome this problem? (Select two.)
Respuesta
  • Add the --parents parameter to the mkdir command.
  • Issue three separate mkdir commands: mkdir one, then mkdir one/two, and then mkdir one/two/three.
  • Type touch /bin/mkdir to be sure the mkdir program file exists.
  • Type rmdir one to clear away the interfering base of the desired new directory tree.
  • Type mktree one/two/three instead of mkdir one/two/three.

Pregunta 2

Pregunta
Typing ls -ld wonderjaye reveals a symbolic file mode of drwxr-xr-x. Which of the following are true? (Select two.)
Respuesta
  • wonderjaye is a symbolic link.
  • wonderjaye is an executable program.
  • wonderjaye is a directory.
  • wonderjaye has its SUID bit set.
  • wonderjaye may be read by all users of the system.

Pregunta 3

Pregunta
When should programs be configured SUID root?
Respuesta
  • At all times. This permission is required for executable programs.
  • Whenever a program should be able to access a device file.
  • Only when they require root privileges to do their job.
  • Never. This permission is a severe security risk
  • Whenever the program file is owned by the root user.

Pregunta 4

Pregunta
You see the usrquota and grpquota options in the /etc/fstab entry for a filesystem. What is the consequence of these entries?
Respuesta
  • Quota support will be available if it’s compiled into the kernel; it will be automatically activated when you mount the filesystem.
  • User quotas will be available, but the grpquota option is invalid and will be ignored.
  • Quota support will be disabled on the filesystem in question.
  • Nothing. These options are malformed and so will have no effect
  • Quota support will be available if it’s compiled into your kernel, but you must activate it with the quotaon command.

Pregunta 5

Pregunta
Which of the following commands can be used to summarize the quota information about all filesystems?
Respuesta
  • repquota
  • repquota -a
  • quotacheck
  • quotacheck –a
  • edquota -a

Pregunta 6

Pregunta
Which of the following file-location commands is likely to take the most time to find a file that may be located anywhere on the computer (assuming the operation succeeds)?
Respuesta
  • The find command.
  • The locate command.
  • The whereis command.
  • The type command.
  • They’re all equal in speed.

Pregunta 7

Pregunta
What can the type command do that whereis can’t?
Respuesta
  • Identify the command as being for x86 or x86-64 CPUs
  • Locate commands based on their intended purpose, not just by name
  • Identify a command as an alias, internal command, or external command
  • Assist in typing a command by finishing typing it for you
  • Identify a command as being a binary or a script

Pregunta 8

Pregunta
What can you conclude from the following interaction? $ which man /usr/bin/man
Respuesta
  • The only file called man on the computer is in /usr/bin.
  • The /usr/bin/man program was installed by system package tools.
  • The /usr/bin/man program will be run by any user who types man.
  • The first instance of the man program, in path search order, is in /usr/bin.
  • The user man owns the /usr/bin/man program file.

Pregunta 9

Pregunta
Which one of the following commands copies files with the .txt extension from /dir into /dir2, while preserving file attributes such as dates?
Respuesta
  • mv --copy /dir1/*.txt /dir2
  • mv /dir1/*.txt /dir2
  • cp -k /dir1/*.txt /dir2
  • cp -p /dir1/*.txt /dir2
  • cp -p /dir2 < /dir/*.txt

Pregunta 10

Pregunta
Which one of the following file globs matches "Linux" and "linux", but not "linux.com" and not "TurboLinux"?
Respuesta
  • [L/linux]
  • ?inux
  • \L\linux
  • [Ll]inux
  • [Ll]inux?

Pregunta 11

Pregunta
Which one of the following outcomes results from the following command? #chmod g+s /home/software
Respuesta
  • The SUID bit will be set for /home/software
  • The SGID bit will be set for /home/software, preventing access by those not a member of the software group.
  • The SGID bit will be set for /home/software, in order to keep group membership of the directory consistent for all files created.
  • The sticky bit will be set for /home/software
  • The sticky bit will be applied to all files in /home/software.

Pregunta 12

Pregunta
Which one of the following commands versosely extracts files from a tar archive on a magnetic tape device?
Respuesta
  • tar cvf /dev/st0
  • tar cvf /dev/ttyS0
  • tar xvf /dev/st0
  • tar xvf /dev/ttyS0
  • tar rvf /dev/st0

Pregunta 13

Pregunta
Which command can be used to quickly tell you if an executable command is in any directory defined in your $PATH environment variable?
Respuesta
  • find
  • locate
  • which
  • who
  • what

Pregunta 14

Pregunta
Which directory, according to he Filesystem Hierarchy Standard, is designed to hold essential system binaries?
Respuesta
  • /sbin
  • /bin
  • /usr/bin
  • /opt/bin
  • /usr/local/bin

Pregunta 15

Pregunta
According to the Filesystem Hierarchy Standard, what directory (or directories) must hold the system kernel? (Select two)
Respuesta
  • /boot
  • /
  • /opt
  • /sbin
  • /kernel

Pregunta 16

Pregunta
What command(s) can be used to copy data to and from raw devices, bypassing the filesystem? (Select two)
Respuesta
  • cp
  • tar
  • dd
  • mv
  • sed

Pregunta 17

Pregunta
A user accidentally created the subdirectory \dir in his home directory. Which of the following commands will remove that directory?
Respuesta
  • rmdir '~/\dir'
  • rmdir "~/\dir"
  • rmdir ~/'dir'
  • rmdir ~/\dir
  • rmdir ~/\\dir

Pregunta 18

Pregunta
Which of the following commands can be used to locate programs and their corresponding man pages and configuration files?
Respuesta
  • dirname
  • which
  • basename
  • query
  • whereis

Pregunta 19

Pregunta
In compliance with the FHS, in which of the directories are man pages found?
Respuesta
  • /usr/share/man
  • /opt/man
  • /usr/doc/
  • /var/pkg/man
  • /var/man

Pregunta 20

Pregunta
Which of the following commands displays the contents of a gzip compressed tar archive?
Respuesta
  • gzip archive.tgz | tar xvf -
  • tar ztf archive.tgz
  • gzip -d archive.tgz | tar tvf -
  • tar cf archive.tgz

Pregunta 21

Pregunta
Which of the following commands will send output from the program myapp to both standard output (stdout) and the file file1.log?
Respuesta
  • cat < myapp | cat > file1.log
  • myapp 0>&1 | cat > file1.log
  • myapp | cat > file1.log
  • myapp | tee file1.log
  • tee myapp file1.log

Pregunta 22

Pregunta
Which of the following commands will change the quota for a specific user?
Respuesta
  • edquota
  • repquota
  • quota -e
  • quota

Pregunta 23

Pregunta
Which of the following file permissions belong to a symbolic link?
Respuesta
  • -rwxrwxrwx
  • +rwxrwxrwx
  • lrwxrwxrwx
  • srwxrwxrwx

Pregunta 24

Pregunta
What is the output of the following command? #echo "Hello World" | tr -d aieou
Respuesta
  • Hello World
  • eoo
  • Hll Wrld
  • eoo Hll Wrld

Pregunta 25

Pregunta
In a nested directory structure, which find command line option would be used to restrict the command to searching down a particular number of subdirectories?
Respuesta
  • -dirmax
  • -maxdepth
  • -maxlevels
  • -n
  • -s

Pregunta 26

Pregunta
Which of the following commands will NOT update the modify timestamp on the file /tmp/myfile.txt?
Respuesta
  • file /tmp/myfile.txt
  • echo "Hello" >/tmp/myfile.txt
  • sed -ie "s/1/2/" /tmp/myfile.txt
  • echo -n "Hello" >>/tmp/myfile.txt
  • touch /tmp/myfile.txt

Pregunta 27

Pregunta
What does the ? symbol within regular expressions represent?
Respuesta
  • Match the preceding qualifier one or more times
  • Match the preceding qualifier zero or more times.
  • Match the preceding qualifier zero or one times.
  • Match a literal ? character.

Pregunta 28

Pregunta
Which of the following commands prints all files and directories within the /tmp directory or its subdirectories which are also owned by the user root? (Choose TWO correct answers.)
Respuesta
  • find /tmp -uid root -print
  • find -path /tmp -uid root
  • find /tmp -user root -print
  • find /tmp -user root
  • find -path /tmp -user root print

Pregunta 29

Pregunta
Which of the following commands changes the ownership of file.txt to the user dan and the group staff?
Respuesta
  • chown dan/staff file.txt
  • chown dan:staff file.txt
  • chown -u dan -g staff file.txt
  • chown dan -g staff file.txt

Pregunta 30

Pregunta
Which of the following commands makes /bin/foo executable by everyone but writable only by its owner?
Respuesta
  • chmod u=rwx,go=rx /bin/foo
  • chmod o+rwx,a+rx /bin/foo
  • chmod 577 /bin/foo
  • chmod 775 /bin/foo

Pregunta 31

Pregunta
Which of the following commands can be used to display the inode number of a given file?
Respuesta
  • inode
  • ls
  • ln
  • cp

Pregunta 32

Pregunta
Which of the following commands are common Linux commands for file management? (Choose three correct answers.)
Respuesta
  • copy
  • mv
  • move
  • cp
  • mkdir

Pregunta 33

Pregunta
Which of the following commands can be used to create a new file that is 100kB in size?
Respuesta
  • dd
  • file
  • mkfile
  • touch

Pregunta 34

Pregunta
In compliance with the FHS, in which of the following directories are documentation files found?
Respuesta
  • /usr/share/documentation
  • /usr/local/share/documentation
  • /var/share/doc
  • /usr/share/doc
  • /etc/share/doc

Pregunta 35

Pregunta
Which chown command will change the ownership to dave and the group to staff on a file named data.txt?
Respuesta
  • chown dave/staff data.txt
  • chown –u dave –g staff data.txt
  • chown --user dave --group staff data.txt
  • chown dave:staff data.txt

Pregunta 36

Pregunta
Which of the following is the GRUB 2 boot loader configuration file?
Respuesta
  • /dev/grub
  • The MBR
  • /boot/grub/grub.conf
  • /boot/grub/grub.cfg
  • /boot/grub/menu.lst

Pregunta 37

Pregunta
What program do you use to start or stop services when using the systemd initialization process?
Respuesta
  • journalctl
  • systemctl
  • init
  • service
  • systemd

Pregunta 38

Pregunta
What is an advantage of vi over graphical text editors?
Respuesta
  • vi is X based, so it is easier to use than other graphical text editors.
  • vi encodes text in EBCDIC, which is more flexible than Emacs’s ASCII.
  • vi’s mode-based operations permit it to handle non-English languages.
  • vi includes a built-in web browser and email client; Emacs doesn’t.
  • vi is smaller, so it can fit on compact emergency USB flash drive systems and embedded devices.

Pregunta 39

Pregunta
How do you exit vi’s insert mode to type command-mode commands?
Respuesta
  • Press the ~ key.
  • Press the Esc key.
  • Press Ctrl+X followed by Ctrl+C.
  • Press the F10 key.
  • Press the Shift+Insert key combination.

Pregunta 40

Pregunta
What line in /etc/inittab would indicate that your default runlevel is 5?
Respuesta
  • ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
  • id:5:initdefault:
  • si:5:sysinit:/etc/init.d/rcS
  • l5:5:wait:/etc/init.d/rc 5
  • 1:2345:respawn:/sbin/getty 38400 tty1
Mostrar resumen completo Ocultar resumen completo