LPI 101 - Comandos GNU/Linux 4- Marcus Vinicius Braga Alcantara

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Viniciusalcantar
V
Viniciusalcantar
Community Contributor
Quizzes Created: 11 | Total Attempts: 6,093
Questions: 66 | Attempts: 399

SettingsSettingsSettings
LPI 101 - Comandos GNU/Linux 4- Marcus Vinicius Braga Alcantara - Quiz

.


Questions and Answers
  • 1. 

    Que comando será executado, cmd1 seguido por cmd2, independentemente do status de saída cmd1?

    • A.

      cmd1 cmd2

    • B.

      cmd1 | cmd2

    • C.

      cmd1 ; cmd2

    • D.

      cmd1 || cmd2

    • E.

      cmd1 && cmd2

    Correct Answer
    C. cmd1 ; cmd2
    Explanation
    The correct answer is "cmd1 ; cmd2". The semicolon (;) is a command separator in the shell, which means that both cmd1 and cmd2 will be executed regardless of the exit status of cmd1. This allows for the sequential execution of multiple commands in the shell.

    Rate this question:

  • 2. 

    Você tem dois scripts, foo e bar. Você deseja que o bar seja executado somente se foo retornar uma saída com status igual a 0. Selecione a alternativa correta.

    • A.

      foo ; bar

    • B.

      foo || bar

    • C.

      foo && bar

    • D.

      foo % bar

    Correct Answer
    C. foo && bar
    Explanation
    The correct answer is "foo && bar". This is because the "&&" operator in shell scripting means "AND". So, the command "foo && bar" will execute the command "foo" first, and only if it returns a status of 0 (indicating success), the command "bar" will be executed.

    Rate this question:

  • 3. 

    Qual a variável de ambiente é usada para exibir remotamente em outra máquina uma sessão X sua?

    • A.

      DISPLAY

    • B.

      XSESSION

    • C.

      SCREEN

    • D.

      TTY

    Correct Answer
    A. DISPLAY
    Explanation
    The correct answer is DISPLAY. The DISPLAY variable is used to specify the remote machine and display number where X applications should be displayed. It is commonly used in Unix-like operating systems to enable X11 forwarding, allowing users to run graphical applications on a remote machine and have them displayed on their local machine.

    Rate this question:

  • 4. 

    Você quer executar uma série de comandos de uma só vez. Qual a maneira mais rápida de fazer isto?

    • A.

      Após digitar cada um dar um enter

    • B.

      Colocá-los em um script e executá-lo

    • C.

      Separar os comandos com ponto-e-vírgula (;) e pressionar enter

    • D.

      Separar o comando com barra (/) e pressionar enter

    Correct Answer
    C. Separar os comandos com ponto-e-vírgula (;) e pressionar enter
    Explanation
    Separating the commands with a semicolon (;) allows you to execute multiple commands in a single line, saving time and effort. By pressing enter after entering the commands, each command will be executed sequentially. This method is quicker than typing each command individually and pressing enter after each one or creating a script to execute the commands.

    Rate this question:

  • 5. 

    No bash shell, executar o comando !! tem o mesmo efeito de qual dos seguintes comandos?

    • A.

      Ctrl-N e Enter

    • B.

      Ctrl-P e Enter

    • C.

      Ctrl-U e Enter

    • D.

      !-2

    • E.

      !2

    Correct Answer
    B. Ctrl-P e Enter
    Explanation
    The command !! in the bash shell is used to execute the previous command. Similarly, Ctrl-P is a keyboard shortcut that is used to navigate to the previous command in the command history. Therefore, executing Ctrl-P and Enter will have the same effect as executing !!, which is to run the previous command.

    Rate this question:

  • 6. 

    O que é descrito pelas variáveis PS1 e PS2?

    • A.

      Postscript Level 1 e Level 2 capabilities

    • B.

      Aliases para "ps" and "ps uax"

    • C.

      Power Save Mode

    • D.

      Prompt normal e prompt estendido.

    • E.

      Link simbólico para um mouse

    Correct Answer
    D. Prompt normal e prompt estendido.
    Explanation
    As per the given options, the variables PS1 and PS2 are described as the normal prompt and extended prompt. This means that these variables control the appearance and behavior of the command prompt in a Unix-like operating system. The PS1 variable defines the prompt displayed when waiting for a new command, while the PS2 variable defines the prompt displayed when a command is continued onto the next line.

    Rate this question:

  • 7. 

    Depois de digitar um comando, você recebe uma mensagem de erro indicando sintaxe incorreta. Quem é o autor da mensagem?

    • A.

      Shell

    • B.

      Sistema Operacional

    • C.

      Comando ou Programa

    • D.

      Kernel

    Correct Answer
    C. Comando ou Programa
    Explanation
    The correct answer is "Comando ou Programa". When you type a command, it is the command or program itself that is responsible for checking the syntax and providing an error message if it is incorrect. The shell, operating system, and kernel are all components of the system that facilitate the execution of the command, but they are not directly responsible for generating the error message.

    Rate this question:

  • 8. 

    Você digitou o seguinte comando "ls -al /home/hadden". Quais teclas podem ser utilizadas para retirar o espaço entre a barra -/- e a palavra -hadden- sem redigitar o comando?

    • A.

      Ctrl-B, Del

    • B.

      Esc-b, Del

    • C.

      Esc-Del, Del

    • D.

      Ctrl-b, Del

    Correct Answer
    B. Esc-b, Del
    Explanation
    The answer is "Esc-b, Del". Pressing the Esc key followed by the b key will move the cursor back one word. Then, pressing the Del key will delete the space between the slash and the word "hadden" without having to retype the whole command.

    Rate this question:

  • 9. 

    Você está digitando uma linha de comando grande e complexa e você alcançou o fim da tela. Você quer continuar digitando, mas na linha abaixo. Quais as teclas que permitem isso?

    • A.

      Esc, /, Enter

    • B.

      /, Enter

    • C.

      Ctrl-d, enter

    • D.

      Esc, /, ctrl-d

    Correct Answer
    B. /, Enter
    Explanation
    The combination of the "/" key and the "Enter" key allows the user to continue typing on a new line below the current line.

    Rate this question:

  • 10. 

    Você fez telnet em vários servidores ao mesmo tempo. Durante o dia você se sente perdido em qual sessão está conectado. Qual o comando no seu .profile resolveria este problema deixando claro em qual o servidor você está conectado?

    • A.

      PS1="\h: \w>"

    • B.

      PS1="\s: \W>"

    • C.

      PS1="\!: \t>"

    • D.

      PS1="\a: \n>"

    Correct Answer
    A. PS1="\h: \w>"
    Explanation
    The correct answer is PS1="\h: \w>". This command sets the prompt in the .profile file to display the hostname (\h) and the current working directory (\w). This will help the user easily identify the server they are connected to.

    Rate this question:

  • 11. 

    Qual o programa que interpreta suas ações e comandos no sistema operacional?

    • A.

      Utility

    • B.

      Application

    • C.

      Shell

    • D.

      Command

    Correct Answer
    C. Shell
    Explanation
    A shell is a program that interprets user actions and commands in the operating system. It provides a command-line interface where users can interact with the system by typing commands. The shell takes these commands and executes them, allowing users to perform various tasks and control the system. Unlike utilities and applications, which are specific programs designed for particular functions, the shell acts as an intermediary between the user and the operating system, enabling them to access and manipulate system resources.

    Rate this question:

  • 12. 

    Utilizando os conceitos de expressões regulares, descreva um metacharacter.

    • A.

      Eles são caracteres de texto padrão, usados na expressão regular.

    • B.

      Eles são caracteres de controle especiais usados na expressão regular.

    • C.

      Eles são usados para exibir resultados depois de usar uma expressão regular.

    • D.

      Eles são usados pela shell para exibir gráficos.

    • E.

      Metacharacters não são usados em expressões regulares.

    Correct Answer
    B. Eles são caracteres de controle especiais usados na expressão regular.
    Explanation
    Metacharacters are special control characters used in regular expressions. They have special meaning and are used to define patterns and match specific characters or groups of characters in a string.

    Rate this question:

  • 13. 

    Qual das respostas seguintes cria uma variável de ambiente VAR1 que possa estar presente em um processo bash filho?

    • A.

      VAR1="fail" ; export VAR1

    • B.

      VAR1="fail" \ export VAR1

    • C.

      VAR1="fail"

    • D.

      et VAR1="fail" ; enable VAR1

    • E.

      export VAR1 \ VAR1="fail"

    Correct Answer
    A. VAR1="fail" ; export VAR1
    Explanation
    This answer correctly creates a variable VAR1 with the value "fail" and exports it so that it can be accessed by a child bash process.

    Rate this question:

  • 14. 

    Qual variável ambiental indica o caminho do seu diretório HOME?

    • A.

      BASH_ENV

    • B.

      HOME

    • C.

      BLENDERDIR

    • D.

      PWD

    Correct Answer
    B. HOME
    Explanation
    The variable "HOME" indicates the path to the user's home directory in the environment. This directory is typically the default location where the user's personal files and settings are stored.

    Rate this question:

  • 15. 

    Qual o comando você usaria para determinar qual o shell você está usando?

    • A.

      echo $MYSHEL

    • B.

      echo SHELL

    • C.

      shell

    • D.

      echo $SHELL

    Correct Answer
    D. echo $SHELL
    Explanation
    The correct answer is "echo $SHELL". This command will print the value of the SHELL environment variable, which typically contains the path to the current shell being used.

    Rate this question:

  • 16. 

    Como você pode ler os conteúdos da variável PATH no bash shell?

    • A.

      print PATH

    • B.

      print $PATH

    • C.

      echo PATH

    • D.

      echo $PATH

    • E.

      echo %PATH%

    Correct Answer
    D. echo $PATH
    Explanation
    To read the contents of the variable PATH in the bash shell, you can use the command "echo $PATH". The "echo" command is used to display the value of a variable, and the "$" symbol is used to access the value of a variable. Therefore, "echo $PATH" will display the contents of the PATH variable in the bash shell.

    Rate this question:

  • 17. 

    Qual variável de ambiente guarda a lista de diretórios que o shell usa para encontrar arquivos executáveis?

    Correct Answer
    PATH
    Explanation
    The correct answer is "PATH". The PATH environment variable stores a list of directories that the shell uses to search for executable files. When a command is entered in the shell, it checks each directory in the PATH variable in order to find the corresponding executable file. This allows users to run commands without specifying the full file path.

    Rate this question:

  • 18. 

    Qual comando embutido no shell bash é utilizado para visualizar o histórico de comandos?

    Correct Answer
    history
    Explanation
    The correct answer is "history." In the bash shell, the "history" command is used to view the command history. It displays a list of previously executed commands, along with their line numbers. This command is helpful for recalling and reusing past commands, saving time and effort.

    Rate this question:

  • 19. 

    A sua máquina Linux tem 2 monitores. Seu segundo monitor está configurado como a segunda tela da primeira apresentação. Se você quer que o programa "netscape" seja exibido em seu segundo monitor, Qual comando você deve usar antes de iniciar o Netscape?

    • A.

      export set display=:10; netscape

    • B.

      export set display=:10; netscape

    • C.

      export set DISPLAY=:0:0; netscape

    • D.

      export set DISPLAY=:0:1; netscape

    Correct Answer
    D. export set DISPLAY=:0:1; netscape
    Explanation
    The correct answer is "export set DISPLAY=:0:1; netscape". This command sets the display variable to ":0:1", which refers to the second monitor. By doing this, the program "netscape" will be displayed on the second monitor.

    Rate this question:

  • 20. 

    Você deseja repetir o comando de número 3 em seu histórico de comandos. Como você faria isso?

    • A.

      show 3

    • B.

      #3

    • C.

      !3

    • D.

      repeat 3

    Correct Answer
    C. !3
    Explanation
    To repeat the command number 3 in the command history, you would use "!3". This is a shorthand notation that allows you to quickly rerun a specific command without having to retype it.

    Rate this question:

  • 21. 

    Qual o arquivo que armazena o histórico de comandos do shell ?

    Correct Answer
    .bash_history
    Explanation
    The correct answer is ".bash_history". This file is responsible for storing the history of commands executed in the shell. It allows users to easily recall and reuse previously executed commands, making it a handy feature for productivity and troubleshooting purposes. By default, the .bash_history file is located in the user's home directory and can be accessed and edited using a text editor or the command line.

    Rate this question:

  • 22. 

    Suponha que você tenha executado o seguinte comando: cp /etc/passwd /home/myuser , utilizando o histórico de comandos, como você faria para copiar o arquivo /etc/group para o diretório /home/myuser apenas substituindo a ocorrência do argumento passado no comando anterior?

    • A.

      cp /etc/group ~

    • B.

      cp /etc/group /home/myuser

    • C.

      ^passwd^group

    • D.

      cp -r /etc/group .

    Correct Answer
    C. ^passwd^group
    Explanation
    The correct answer is "^passwd^group" because using the caret (^) symbol followed by the old and new strings, it allows you to replace the first occurrence of the old string with the new string in the previous command. In this case, it will replace "passwd" with "group" in the previous command "cp /etc/passwd /home/myuser".

    Rate this question:

  • 23. 

    Qual comando history (Com parâmetro) irá limpar todo o histórico de comandos ?

    Correct Answer
    history -c
    Explanation
    The command "history -c" is used to clear the entire command history. By running this command, all previously executed commands will be removed from the history file, effectively erasing the entire command history.

    Rate this question:

  • 24. 

    Qual dos seguintes comandos substitui o bootloader localizado em /dev/sda sem substituir a tabela de partição ou quaisquer dados que lhe segue ?

    • A.

      dd if=/dev/zero of=/dev/sda bs=512

    • B.

      dd if=/dev/zero of=/dev/sda bs=512 count=1

    • C.

      dd if=/dev/zero of=/dev/sda bs=440 count=1

    • D.

      dd if=/dev/zero of=/dev/sda bs=440

    Correct Answer
    C. dd if=/dev/zero of=/dev/sda bs=440 count=1
    Explanation
    The correct answer is "dd if=/dev/zero of=/dev/sda bs=440 count=1". This command uses the dd command to copy zeros from the /dev/zero device to the /dev/sda device. The "if" parameter specifies the input file as /dev/zero, and the "of" parameter specifies the output file as /dev/sda. The "bs" parameter specifies the block size as 440 bytes, and the "count" parameter specifies that only 1 block should be copied. This command replaces the bootloader located in /dev/sda without affecting the partition table or any data following it.

    Rate this question:

  • 25. 

    Qual dos seguintes comandos podem ser usados ​​para criar uma mídia de armazenamento USB de uma imagem de disco?

    • A.

      gdisk

    • B.

      fdisk

    • C.

      mount

    • D.

      dd

    • E.

      cc

    Correct Answer
    D. dd
    Explanation
    The command "dd" can be used to create a USB storage media from a disk image. "dd" is a command-line utility in Unix-like operating systems that is used to convert and copy files. In this case, it can be used to create a bootable USB drive by copying the disk image onto the USB drive bit by bit.

    Rate this question:

  • 26. 

    Em uma estrutura de diretório aninhada, qual opção de linha de comando seria usado para restringir o comando find para procurar por um determinado número de subdiretórios ?

    • A.

      -dirmax

    • B.

      -maxdepth

    • C.

      -maxlevels

    • D.

      -n

    • E.

      -s

    Correct Answer
    B. -maxdepth
    Explanation
    The correct answer is "-maxdepth". This option is used in the command "find" to restrict the search to a specific number of subdirectories. By specifying a number after "-maxdepth", the command will only search for files or directories within that number of levels deep from the starting directory.

    Rate this question:

  • 27. 

    Qual dos seguintes comandos mata o processo com o PID 123, mas permite "limpar" antes de sair?

    • A.

      kill -PIPE 123

    • B.

      kill -KILL 123

    • C.

      kill -STOP 123

    • D.

      kill -TERM 123

    Correct Answer
    D. kill -TERM 123
    Explanation
    The correct answer is "kill -TERM 123". The "-TERM" option sends a termination signal to the process with PID 123, allowing it to clean up any resources before exiting. The other options, "-PIPE", "-KILL", and "-STOP", send different signals that do not provide the process with the opportunity to clean up before termination.

    Rate this question:

  • 28. 

    Que sinal está ausente no comando a seguir; "killall -s _______ daemon" que é comumente utilizado para instruir um daemon reinicializar-se, incluindo a leitura de arquivos de configuração ?

    Correct Answer
    HUP
    SIGHUP
    1
    Explanation
    The correct answer is "HUP". In the command "killall -s HUP daemon", the "-s" option is used to specify the signal to send to the process. The signal "HUP" (Hang Up) is commonly used to instruct a daemon to restart itself, including reading configuration files. "SIGHUP" is the signal name for "HUP", and "1" is the signal number for "HUP".

    Rate this question:

  • 29. 

    Qual é o valor nice máximo que um usuário regular pode atribuir a um processo com o comando durante a execução de um novo processo ?

    • A.

      9

    • B.

      19

    • C.

      49

    • D.

      99

    Correct Answer
    B. 19
    Explanation
    A regular user can assign a maximum nice value of 19 to a process during the execution of a new process. The nice value is used in Unix-like operating systems to prioritize the execution of processes. A lower nice value indicates a higher priority for the process. Regular users typically have limited privileges and cannot assign extremely high priority to processes, hence the maximum value they can assign is 19.

    Rate this question:

  • 30. 

    Imediatamente após a exclusão de 3 linhas de texto no vi e movendo o cursor para uma linha diferente, qual comando irá inserir o conteúdo excluído abaixo da linha atual?

    • A.

      i (lowercase)

    • B.

      P (uppercase)

    • C.

      p (lowercase)

    • D.

      U (uppercase)

    • E.

      u (lowercase)

    Correct Answer
    C. p (lowercase)
    Explanation
    After deleting 3 lines of text in vi and moving the cursor to a different line, the "p" command (lowercase) will insert the deleted content below the current line.

    Rate this question:

  • 31. 

    Um usuário acidentalmente cria o subdiretório \dir no seu diretório home. Qual dos seguintes comandos irá remover esse diretório ?

    • A.

      rmdir '~/\dir'

    • B.

      rmdir "~/\dir"

    • C.

      rmdir ~/'dir'

    • D.

      rmdir ~/\dir

    • E.

      rmdir ~/\\dir

    Correct Answer
    E. rmdir ~/\\dir
    Explanation
    The correct answer is "rmdir ~/\\dir". This command will remove the subdirectory named "dir" from the user's home directory. The tilde (~) represents the user's home directory, and the backslash (\) is used to escape the special character, so that it is interpreted as part of the directory name.

    Rate this question:

  • 32. 

    Em conformidade com o FHS, em qual diretório as páginas de manuais (man pages) são encontradas?

    • A.

      /usr/share/man

    • B.

      /opt/man

    • C.

      /usr/doc/

    • D.

      /var/pkg/man

    • E.

      /var/man

    Correct Answer
    A. /usr/share/man
    Explanation
    According to the FHS (Filesystem Hierarchy Standard), the man pages are typically found in the "/usr/share/man" directory. This directory is commonly used to store the system's documentation, including the manual pages. It is a standard location for man pages in most Linux distributions. Other directories mentioned in the options, such as "/opt/man", "/usr/doc/", "/var/pkg/man", and "/var/man", are not the standard locations for man pages as per the FHS.

    Rate this question:

  • 33. 

    Qual dos seguintes comandos irá enviar a saída do programa myapp tanto para a saída padrão (stdout) e para o arquivo file1.log ?

    • A.

      cat < myapp | cat > file1.log

    • B.

      myapp 0>&1 | cat > file1.log

    • C.

      myapp | cat > file1.log

    • D.

      myapp | tee file1.log

    • E.

      tee myapp file1.log

    Correct Answer
    D. myapp | tee file1.log
    Explanation
    The command "myapp | tee file1.log" will send the output of the program "myapp" to both the standard output (stdout) and the file "file1.log".

    Rate this question:

  • 34. 

    Qual é o propósito do comando interno do bash chamado export ?

    • A.

      Ele permite que os discos sejam montados remotamente.

    • B.

      Ele é executado como um processo em um subnível .

    • C.

      Isso torna o histórico de comandos disponíveis para subshells.

    • D.

      Ele define as variáveis ​​de ambiente para aplicações.

    • E.

      Ele compartilha partições NFS para uso por outros sistemas na rede.

    Correct Answer
    D. Ele define as variáveis ​​de ambiente para aplicações.
    Explanation
    O comando interno do bash chamado export é usado para definir variáveis de ambiente para aplicações. Isso significa que as variáveis definidas com o comando export estarão disponíveis para todos os processos que são executados a partir do shell atual. Isso é útil para configurar variáveis de ambiente que são necessárias para que um programa ou script funcione corretamente.

    Rate this question:

  • 35. 

    Qual é o resultado da saída do comando a seguir; echo "Hello World" | tr -d aieou

    • A.

      Hello World

    • B.

      eoo

    • C.

      HllWrld

    • D.

      eoo HllWrld

    Correct Answer
    C. HllWrld
    Explanation
    The command "echo "Hello World" | tr -d aieou" is using the "tr" command to delete all occurrences of the letters "a", "i", "e", "o", and "u" from the input string "Hello World". Therefore, the resulting output is "HllWrld".

    Rate this question:

  • 36. 

    Qual dos seguintes comandos é usado para alterar as opções e os parâmetros posicionais para uma bash em execução?

    • A.

      bashconf

    • B.

      history

    • C.

      set

    • D.

      setsh

    • E.

      envsetup

    Correct Answer
    C. set
    Explanation
    The "set" command is used to alter the options and positional parameters for a running bash. It allows the user to change various settings and configurations within the bash environment.

    Rate this question:

  • 37. 

    A partir de um shell Bash, qual dos seguintes comandos executa diretamente as instruções do arquivo /usr/local/bin/runme.sh sem iniciar um subshell ? (Por favor, selecione duas respostas).

    • 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

    Correct Answer(s)
    A. source /usr/local/bin/runme.sh
    B. ./usr/local/bin/runme.sh
    Explanation
    The command "source /usr/local/bin/runme.sh" executes the instructions of the file "/usr/local/bin/runme.sh" without starting a subshell. The "source" command is used to read and execute commands from a file in the current shell environment. Similarly, the command "./usr/local/bin/runme.sh" also executes the instructions of the file "/usr/local/bin/runme.sh" without starting a subshell. The "./" prefix specifies that the file is in the current directory.

    Rate this question:

  • 38. 

    Em relação ao comando; nice -5 /usr/bin/prog

    • A.

      ​/usr/bin/prog é executado com nice lével -5.

    • B.

      /usr/bin/prog é executado com nice lével 5.

    • C.

      /usr/bin/prog é executado com prioridade -5.

    • D.

      /usr/bin/prog é executado com prioridade 5.

    Correct Answer
    B. /usr/bin/prog é executado com nice lével 5.
    Explanation
    The correct answer is "/usr/bin/prog é executado com nice level 5." In the given command "nice -5 /usr/bin/prog", the option "-5" represents the nice level, which is a value ranging from -20 to 19. A lower nice level value indicates a higher priority for the process. Therefore, a nice level of 5 means that the process "/usr/bin/prog" is executed with a higher priority.

    Rate this question:

  • 39. 

    No editor vi, qual dos seguintes comandos irá copiar a linha atual no buffer vi ?

    • A.

      c

    • B.

      cc

    • C.

      1c

    • D.

      yy

    • E.

      1y

    Correct Answer
    D. yy
    Explanation
    The command "yy" in vi will copy the current line into the vi buffer.

    Rate this question:

  • 40. 

    Qual dos seguintes comandos irá reduzir todos os espaços consecutivos para um único espaço?

    • A.

      tr '\s' ' ' < a.txt > b.txt

    • B.

      tr -c ' ' < a.txt > b.txt

    • C.

      tr -d ' ' < a.txt > b.txt

    • D.

      tr -r ' ' '\n' < a.txt > b.txt

    • E.

      tr -s ' ' < a.txt > b.txt

    Correct Answer
    A. tr '\s' ' ' < a.txt > b.txt
    Explanation
    The correct answer is "tr -s ' ' < a.txt > b.txt". This command uses the "tr" command to squeeze multiple consecutive spaces into a single space. The "-s" option tells "tr" to squeeze repeated characters, and the ' ' specifies the character to be squeezed, which in this case is a space. The command takes input from the file "a.txt" and redirects the output to the file "b.txt".

    Rate this question:

  • 41. 

    Qual dos seguintes sinais são enviados para um processo quando a combinação de teclas CTRL+C é pressionada no teclado?

    • A.

      SIGTERM

    • B.

      SIGINT

    • C.

      SIGSTOP

    • D.

      SIGKILL

    Correct Answer
    B. SIGINT
    Explanation
    When the combination of keys CTRL+C is pressed on the keyboard, the signal SIGINT is sent to a process. This signal is used to interrupt the process and request it to terminate gracefully. It allows the process to clean up resources and perform any necessary actions before exiting.

    Rate this question:

  • 42. 

    O que acontece após a emissão do comando vi sem quaisquer parâmetros adicionais ?

    • A.

      vi inicia e carrega o último arquivo usado e move o cursor para a posição onde atual de de quando o arquivo foi fechado.

    • B.

      vi inicia e exige que o usuário explicitamente crie um novo arquivo ou edite um existente.

    • C.

      vi sai com uma mensagem de erro, uma vez que não pode ser chamado sem um nome de arquivo para operar.

    • D.

      vi começa no modo de comando e abre um novo arquivo vazio.

    • E.

      vi inicia e abre um novo ficheiro, que é preenchido com o conteúdo da memória intermédia vi, se o buffer contém texto.

    Correct Answer
    D. vi começa no modo de comando e abre um novo arquivo vazio.
    Explanation
    After issuing the "vi" command without any additional parameters, it starts in command mode and opens a new empty file.

    Rate this question:

  • 43. 

    Qual dos seguintes comandos define uma variável chamada TEST com o conteúdo FOO ?

    • A.

      set TEST="FOO"

    • B.

      TEST = "FOO"

    • C.

      var TEST="FOO"

    • D.

      TEST="FOO"

    Correct Answer
    D. TEST="FOO"
    Explanation
    The correct answer is "TEST="FOO"". This is the correct command to define a variable called TEST with the content FOO. The other options either use incorrect syntax or do not follow the correct format for defining a variable.

    Rate this question:

  • 44. 

    Qual dos seguintes comandos determina o tipo de um arquivo usando um arquivo de banco de dados de definição que contém informações sobre todos os tipos de arquivos comuns ?

    • A.

      magic

    • B.

      type

    • C.

      file

    • D.

      pmagic

    • E.

      hash

    Correct Answer
    C. file
    Explanation
    O comando "file" determina o tipo de um arquivo usando um arquivo de banco de dados de definição que contém informações sobre todos os tipos de arquivos comuns.

    Rate this question:

  • 45. 

    Qual é a ação padrão do comando split em um arquivo de entrada ?

    • A.

      Ele vai quebrar o arquivo em novos arquivos de 1.024 bytes cada.

    • B.

      Ele vai quebrar o arquivo em novos arquivos de 1000 linhas.

    • C.

      Ele vai quebrar o arquivo em novos arquivos de 1.024 kilobytes.

    • D.

      Ele irá quebrar o ficheiro em novos ficheiros que não são mais do que 5 % da dimensão do ficheiro original.

    Correct Answer
    B. Ele vai quebrar o arquivo em novos arquivos de 1000 linhas.
    Explanation
    The correct answer is "Ele vai quebrar o arquivo em novos arquivos de 1000 linhas." This means that the split command will divide the file into new files, with each file containing 1000 lines.

    Rate this question:

  • 46. 

    Quando canalizando a saída do comando find para o comando xargs, que opção é útil para encontrar nomes de arquivos que possuem espaços entre eles ?

    • A.

      -rep-space

    • B.

      -print0

    • C.

      -nospace

    • D.

      -ignore-space

    Correct Answer
    B. -print0
    Explanation
    The option "-print0" is useful when channeling the output of the "find" command to the "xargs" command to find file names that have spaces between them. This option separates the file names with a null character instead of a space, allowing the "xargs" command to correctly interpret the file names with spaces.

    Rate this question:

  • 47. 

    Qual opção para o comando tee irá causar a saída para ser concatenado no fim do ficheiro de saída em vez de substituir o conteúdo do arquivo existente?

    • A.

      -a

    • B.

      -c

    • C.

      --no-clobber

    • D.

      continue

    Correct Answer
    A. -a
    Explanation
    The option "-a" for the tee command will cause the output to be appended to the end of the output file instead of replacing the content of the existing file.

    Rate this question:

  • 48. 

    O que é que o símbolo "?" significa na seguinte expressão regular grep; grep '^d[aei]\?d$' /usr/share/dict/words

    • A.

      Corresponde ao conjunto de caracteres anterior ([ aei ]) uma ou mais vezes.

    • B.

      Corresponde ao conjunto de caracteres anterior ([ aei ]) zero ou mais vezes.

    • C.

      Corresponde ao conjunto de caracteres anterior ([ aei ]) zero ou uma vez .

    • D.

      Combina um símbolo ? Literal.

    Correct Answer
    C. Corresponde ao conjunto de caracteres anterior ([ aei ]) zero ou uma vez .
    Explanation
    The symbol "?" in the given regular expression "grep 'd[aei]?d$' /usr/share/dict/words" means that the character immediately preceding it, which is the set of characters [aei], can occur zero or one time. In other words, it allows for the possibility of that character being present or not in the matched string.

    Rate this question:

  • 49. 

    Qual sinal é enviado para um processo em suspensão, a fim de ter que recomeçar a execução ?

    • A.

      CONT

    • B.

      EXEC

    • C.

      RESM

    • D.

      UNSP

    Correct Answer
    A. CONT
    Explanation
    The signal "CONT" is sent to a suspended process in order to restart its execution.

    Rate this question:

  • 50. 

    Qual comando vi irá alterar os modos para que o texto possa ser digitado, digitando no teclado?

    • A.

      e

    • B.

      i

    • C.

      t

    • D.

      w

    Correct Answer
    B. i
    Explanation
    The correct answer is "i". In vi, the "i" command is used to switch to insert mode, allowing the user to type and edit text using the keyboard.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 18, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 14, 2017
    Quiz Created by
    Viniciusalcantar
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.