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

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Viniciusalcantar
V
Viniciusalcantar
Community Contributor
Quizzes Created: 11 | Total Attempts: 7,124
| Attempts: 1,042
SettingsSettings
Please wait...
  • 1/100 Questões

    Qual comando pode ser usado para dividir um determinado arquivo em 4 partes iguais ?

    • Cat
    • Fmt
    • Split
    • Join
Please wait...
LPI 101 - Comandos GNU/Linux 1- Marcus Vinicius Braga Alcantara - Quiz


Quiz Preview

  • 2. 

    Qual comando abaixo irá exibir sua atual localização na estrutura de diretórios do sistema ?

    • ls .

    • pwconv

    • pwd

    • cd

    Correct Answer
    A. pwd
    Explanation
    The command "pwd" stands for "print working directory" and it is used to display the current location within the directory structure of the system. It is commonly used to verify the current directory before performing any operations or to identify the exact location of a file or directory.

    Rate this question:

  • 3. 

    Qual é o argumento que é valido tanto para os comandos cp, mv e rm que ativa o chamado “modo interativo” ?

    • -f

    • -r

    • -i

    • -p

    Correct Answer
    A. -i
    Explanation
    The argument "-i" is valid for the commands cp, mv, and rm because it activates the "interactive mode." This means that before performing any action, the command will prompt the user for confirmation, allowing them to decide whether to proceed or not. This is a useful feature as it helps prevent accidental overwriting or deletion of files.

    Rate this question:

  • 4. 

    Qual comando irá remover linhas duplicadas de um arquivo ordenado?

    • uniq

    • trim

    • filter

    • wc

    Correct Answer
    A. uniq
    Explanation
    The command "uniq" is used to remove duplicate lines from a sorted file. It compares adjacent lines and removes any duplicates, keeping only one occurrence of each line. This command is commonly used in combination with other commands to filter and manipulate data in a file.

    Rate this question:

  • 5. 

    Qual dos seguintes comandos você pode usar para renomear um arquivo no Linux?

    • rm

    • mv

    • new

    • M

    Correct Answer
    A. mv
    Explanation
    The correct answer is "mv" because the "mv" command in Linux is used to move or rename files and directories. By using the "mv" command followed by the current file name and the desired new file name, you can effectively rename the file. This command is commonly used in Linux systems for file management tasks.

    Rate this question:

  • 6. 

    Qual comando é usado para remover um diretório vazio ? (Especifique somente o comando)

    Correct Answer
    rmdir
    Explanation
    The command "rmdir" is used to remove a directory that is empty.

    Rate this question:

  • 7. 

    O comando apropos procura por programas e comandos através de uma descrição como argumento. É bastante útil quando precisa-se fazer algo sem saber que comando usar. Ex: apropos email

    • Verdadeiro

    • Falso

    Correct Answer
    A. Verdadeiro
    Explanation
    The given statement explains that the "apropos" command is used to search for programs and commands based on their description as an argument. It is particularly useful when you need to perform a task but are unsure which command to use. The example provided demonstrates the usage of the "apropos" command to search for commands related to email. Therefore, the correct answer is "Verdadeiro" (True).

    Rate this question:

  • 8. 

    Quais das opções abaixo podem retornar informações sobre programas/comandos em um sistema Linux ? (Selecione 3 respostas).

    • man

    • whatis

    • info

    • ls

    Correct Answer(s)
    A. man
    A. whatis
    A. info
    Explanation
    The options "man," "whatis," and "info" can return information about programs/commands in a Linux system. The "man" command displays the manual pages for a specific command, providing detailed explanations and usage examples. The "whatis" command provides a brief description of a command. The "info" command displays documentation in an Info format, which is a more comprehensive and structured version of a manual page.

    Rate this question:

  • 9. 

    Qual dos seguintes comandos seria mais provável ser usado para a saída de um arquivo em sentido inverso?

    • rev

    • tac

    • pr

    • back

    • sed

    Correct Answer
    A. tac
    Explanation
    The command "tac" is more likely to be used for reversing the output of a file. The "tac" command reads a file or standard input and writes its lines in reverse order to the standard output. This means that the last line of the file will be displayed first, followed by the second-to-last line, and so on. Therefore, "tac" is the correct answer for reversing the output of a file.

    Rate this question:

  • 10. 

    Qual o uso correto do comando mkdir para se criar a estrutura de diretórios dir/subdir1/subdir2 ?

    • mkdir -m dir/subdir1/subdir2

    • mkdir -p dir/subdir1/subdir2

    • mkdir -Z dir/subdir1/subdir2

    • mkdir dir/subdir1/subdir2

    Correct Answer
    A. mkdir -p dir/subdir1/subdir2
    Explanation
    The correct answer is "mkdir -p dir/subdir1/subdir2". The "-p" option is used to create parent directories if they do not exist. In this case, it will create the directory "dir" if it doesn't exist, then create the directory "subdir1" inside "dir" if it doesn't exist, and finally create the directory "subdir2" inside "subdir1" if it doesn't exist. This ensures that the entire directory structure "dir/subdir1/subdir2" is created.

    Rate this question:

  • 11. 

    Toda vez que você tenta deletar um arquivo usando o rm, o sistema pergunta por confirmação. Você sabe que este não é o comportamento padrão do rm. O que há de diferente para ele fazer isto?

    • Foi criado um alias do rm para rm -i.

    • A versão do rm está incorreta.

    • Este é o comportamento normal do comando.

    • Um link simbólico foi criado errado.

    Correct Answer
    A. Foi criado um alias do rm para rm -i.
    Explanation
    An alias was created for the rm command, replacing it with rm -i. This means that whenever the rm command is used, it is actually executing rm -i instead, which prompts for confirmation before deleting a file. This explains why the system asks for confirmation when trying to delete a file using rm.

    Rate this question:

  • 12. 

    Qual comando remove todos os subdiretórios em /tmp independentemente se eles são inexistentes ou estão em uso?

    • m -rf /tmp

    • del /tmp/*

    • delete /tmp/*,*

    • rm -Ra /tmp/*

    • rm -rf /tmp/*

    Correct Answer
    A. rm -rf /tmp/*
    Explanation
    The correct answer is "rm -rf /tmp/*". This command uses the "rm" command with the "-rf" options to forcefully and recursively remove all files and directories within the /tmp directory. The "-r" option ensures that directories are deleted recursively, and the "-f" option forces the deletion without prompting for confirmation. The "/tmp/*" specifies that all files and directories within the /tmp directory should be removed.

    Rate this question:

  • 13. 

    Qual dos seguintes comandos irá exibir as últimas 30 linhas de /var/log/bigd.log, bem como novos conteúdos como é anexado ao arquivo por outro processo ?

    • cat -r -n 30 /var/log/bigd.log

    • cut -30 -v /var/log/bigd.log

    • tail -f -n 30 /var/log/bigd.log

    • head -30 -e /var/log/bigd.log

    • tac -30 /var/log/bigd.log

    Correct Answer
    A. tail -f -n 30 /var/log/bigd.log
    Explanation
    The correct answer is "tail -f -n 30 /var/log/bigd.log". This command will display the last 30 lines of the /var/log/bigd.log file and continue to show any new content that is appended to the file by another process. The "-f" option allows for continuous monitoring of the file, while the "-n 30" option specifies to display the last 30 lines.

    Rate this question:

  • 14. 

    Qual dos comandos seguintes poderia ser usado para mudar todos os caracteres de maiúsculo para minúsculo no meio de um pipe?

    • grep

    • egrep

    • wc

    • tr

    • pr

    Correct Answer
    A. tr
    Explanation
    The command "tr" can be used to change all uppercase characters to lowercase within a pipe.

    Rate this question:

  • 15. 

    Qual das declarações seguintes descreve corretamente os símbolos > e >> no contexto bash shell?

    • > junta a saída padrão a um arquivo existente, e >> escreve a saída padrão a um arquivo novo.

    • > escreve a saída padrão a um arquivo novo, e >> junta a saída padrão a um arquivo existente.

    • > escreve o erro padrão a um arquivo novo, e >> junta erro padrão a um arquivo existente.

    • > pipes para um arquivo novo, e >> pipes para um arquivo existente.

    • > pipes para um arquivo existente e >> pipes para um arquivo novo.

    Correct Answer
    A. > escreve a saída padrão a um arquivo novo, e >> junta a saída padrão a um arquivo existente.
    Explanation
    The correct answer states that ">" writes the standard output to a new file, while ">>" appends the standard output to an existing file. This means that ">" is used to create a new file or overwrite an existing file with the standard output, while ">>" is used to add the standard output to the end of an existing file without overwriting its contents.

    Rate this question:

  • 16. 

    Qual comando exibirá as últimas linhas do arquivo texto arquivo1.txt ? Selecione a opção correta.

    • head -b arquivo1.txt

    • head --bottom arquivo1.txt

    • head -v arquivo1.txt

    • tail arquivo1.txt

    • tail -n 1 arquivo1.txt

    Correct Answer
    A. tail arquivo1.txt
    Explanation
    The correct answer is "tail arquivo1.txt". The "tail" command is used to display the last part of a file. In this case, it will display the last lines of the text file "arquivo1.txt".

    Rate this question:

  • 17. 

    Qual comando copiaria a árvore de diretório inteira, enquanto inclui todos os subdiretórios abaixo de /home/gpaula para /tmp?

    • cp /home/gpaula /tmp

    • cp -a //home/gpaula /tmp

    • cp -r /home/gpaula /tmp

    • xcp -s /home/gpaula /tmp

    • mv -cr /home/gpaula /tmp

    Correct Answer
    A. cp -r /home/gpaula /tmp
    Explanation
    The correct answer is "cp -r /home/gpaula /tmp". This command uses the "-r" option, which stands for "recursive", to copy the entire directory tree, including all subdirectories, from /home/gpaula to /tmp. This ensures that all files and directories within the specified directory are copied to the destination directory.

    Rate this question:

  • 18. 

    Qual o correto comando usado para copiar o diretório de origem /etc e seus subdiretórios para o diretório de destino /tmp/etcbkp preservando os atributos originais dos arquivos ?

    • cp -r /etc /tmp/etcbkp

    • cp -uvi /etc/* /tmp/etcbkp/

    • cp -pR /etc /tmp/etcbkp

    • cp -i /etc/* /tmp/etcbkp/

    Correct Answer
    A. cp -pR /etc /tmp/etcbkp
    Explanation
    The correct answer is "cp -pR /etc /tmp/etcbkp". This command copies the directory /etc and its subdirectories to the destination directory /tmp/etcbkp while preserving the original attributes of the files. The "-p" option preserves the file attributes, including timestamps and permissions, and the "-R" option recursively copies the directory and its subdirectories.

    Rate this question:

  • 19. 

    Qual é a variável de ambiente que indica a quantidade de linhas que podem ser mantidas no histórico de comandos do shell Bash ?

    • HISTLIMIT

    • HISTORY

    • HISTLINES

    • HISTSIZE

    Correct Answer
    A. HISTSIZE
    Explanation
    HISTSIZE is the correct answer because it is the environment variable that indicates the maximum number of lines that can be stored in the command history of the Bash shell. By setting this variable to a specific value, users can control the size of their command history and limit the number of lines that are saved.

    Rate this question:

  • 20. 

    O seguinte resultado: 40 58 1815 /tmp/arquivo.txt pertence a qual comando ?

    • nl /tmp/arquivo.txt

    • uniq -c /etc/passwd

    • cat -vET /tmp/arquivo.txt

    • wc /tmp/arquivo.txt

    Correct Answer
    A. wc /tmp/arquivo.txt
    Explanation
    The given result "40 58 1815" is the output of the "wc /tmp/arquivo.txt" command. The "wc" command is used to count the number of lines, words, and characters in a file. In this case, the numbers 40, 58, and 1815 represent the number of lines, words, and characters respectively in the file "/tmp/arquivo.txt".

    Rate this question:

  • 21. 

    Qual dos comandos a seguir copia arquivos com a extensão .txt de /dir1 para dentro do /dir2 e, ao mesmo tempo, preserva atributos de arquivo?

    • mv --copy /dir1/*.txt /dir2

    • mv /dir1/*.txt /dir2

    • cp -k /dir1/*.txt /dir2

    • cp -p /dir1/*.txt /dir2

    • cp -p /dir2 < /dir1/*.txt

    Correct Answer
    A. cp -p /dir1/*.txt /dir2
    Explanation
    The correct answer is "cp -p /dir1/*.txt /dir2". This command copies files with the .txt extension from /dir1 to /dir2 while preserving file attributes. The "-p" option in the cp command preserves the original file attributes such as permissions, timestamps, and ownership.

    Rate this question:

  • 22. 

    Qual comando pode ser utilizado para remover o valor de uma variável ?

    Correct Answer
    unset
    Explanation
    The correct answer is "unset". The unset command is used to remove the value of a variable in programming. It allows you to delete the value stored in a variable, making it empty or undefined. This can be useful when you want to free up memory or reset a variable to its initial state.

    Rate this question:

  • 23. 

    Qual comando built-in que pode ser usado para criar um atalho ou pseudonimo para um comando mais longo? Assumindo que o shell usado é um shell moderno como Bourne shell.

    • shortcut

    • ln

    • sudo

    • link

    • alias

    Correct Answer
    A. alias
    Explanation
    The correct answer is "alias". In a modern shell like Bourne shell, the "alias" command can be used to create a shortcut or pseudonym for a longer command. This allows the user to use a shorter and more convenient command to execute the longer command without having to type it out in its entirety every time.

    Rate this question:

  • 24. 

    Como você pode descrever o comando a seguir? tail -f /var/log/messages

    • Corta as últimas 10 linhas do arquivo /var/log/messages para STDOUT.

    • Muda o período de acesso para o arquivo /var/log/messages para agora.

    • Muda o tempo de modificação pelo arquivo /var/log/messages para agora.

    • Escreve os conteúdos do arquivo /var/log/messages em ordem invertida para STDOUT.

    • Exibe toda linha nova do arquivo /var/log/messages enquanto este arquivo está crescendo.

    Correct Answer
    A. Exibe toda linha nova do arquivo /var/log/messages enquanto este arquivo está crescendo.
    Explanation
    The given command "tail -f /var/log/messages" is used to continuously display the new lines added to the file /var/log/messages as the file is growing. The "-f" option stands for "follow" and it allows the command to keep monitoring the file for any new lines. This is useful for real-time monitoring of log files or any other files that are constantly being updated.

    Rate this question:

  • 25. 

    Qual o comando irá imprimir o número da linha antes do início de cada linha em um arquivo ?

    • ln

    • nl

    • tr

    • Numline

    Correct Answer
    A. nl
    Explanation
    The "nl" command is used to number lines in a file and can be used to print the line number before the start of each line in a file.

    Rate this question:

  • 26. 

    Qual dos comandos abaixo pode ser utilizado para imprimir o valor de uma variável ?

    • export

    • set

    • env

    • echo

    Correct Answer
    A. echo
    Explanation
    The command "echo" can be used to print the value of a variable.

    Rate this question:

  • 27. 

    Você precisa procurar em todos os diretórios para localizar um determinado arquivo. Como você fará isto e ainda continuar a chamar outros comandos?

    • find / -name filename &

    • find / -name filename

    • bg find / -name filename

    • &find / -name filename &

    Correct Answer
    A. find / -name filename &
    Explanation
    To locate a specific file in all directories and continue executing other commands, you can use the command "find / -name filename &". The "find" command is used to search for files and directories based on specified criteria. The "/" indicates that the search should start from the root directory. The "-name" option is used to specify the name of the file you are searching for. The "&" symbol at the end of the command allows the command to run in the background, so you can continue executing other commands while the search is ongoing.

    Rate this question:

  • 28. 

    Qual comando abaixo pode ser utilizado para tornar uma variável acessível através de um shell sub-sequente ?

    • set

    • env

    • export

    • echo

    Correct Answer
    A. export
    Explanation
    The "export" command can be used to make a variable accessible through a subsequent shell. This command allows the variable to be passed to any child processes or sub-shells that are created from the current shell. By using the "export" command, the variable becomes part of the environment and can be accessed by other processes or shells.

    Rate this question:

  • 29. 

    Qual afirmativa abaixo melhor descreve o programa xargs ?

    • Utiliza a saída de erros de um comando e redireciona tanto para um arquivo definido como para o terminal.

    • É um substituto do caracter pipe na união de dois comandos.

    • É utilizado em scripts de forma a controlar argumentos passados pela linha de comando.

    • Utiliza dados da saída padrão de um programa alimentando argumentos de um outro programa.

    Correct Answer
    A. Utiliza dados da saída padrão de um programa alimentando argumentos de um outro programa.
    Explanation
    The correct answer describes the program xargs as a tool that takes data from the standard output of one program and uses it as arguments for another program. This means that xargs can be used to pass the output of one command as input to another command, allowing for more complex and efficient command line operations.

    Rate this question:

  • 30. 

    Qual comando exibe por padrão apenas as linhas que não começam com # (símbolo) no arquivo foobar?

    • /bin/grep #$ foobar

    • /bin/grep -v #$ foobar

    • /bin/grep -v ^# foobar

    • /bin/grep ^# foobar

    Correct Answer
    A. /bin/grep -v ^# foobar
    Explanation
    The correct answer is "/bin/grep -v ^# foobar". The "-v" option in the grep command is used to invert the matching, meaning it will display lines that do not match the specified pattern. "^#" is a regular expression that matches lines starting with the "#" symbol. Therefore, the command will display only the lines that do not start with "#".

    Rate this question:

  • 31. 

    Qual parâmetro do comando uname pode ser utilizado para exibir a data de compilação do Sistema Operacional?

    • -r

    • -v

    • -n

    • -m

    Correct Answer
    A. -v
    Explanation
    The parameter "-v" can be used with the "uname" command to display the version and release information of the operating system. This information includes the date of compilation of the operating system.

    Rate this question:

  • 32. 

    Que comando pode exibir os conteúdos de um arquivo binário em uma forma de hexadecimal legível? Selecione a opção correta.

    • xd

    • hd

    • od

    • Xd

    • dump

    Correct Answer
    A. od
    Explanation
    O comando "od" pode exibir os conteúdos de um arquivo binário em uma forma de hexadecimal legível.

    Rate this question:

  • 33. 

    Qual é o comando que possui a função de redirecionar a saída padrão de um comando em terminal e simultaneamente a isto em um arquivo ? (Especifique somente o comando) 

    Correct Answer
    tee
    Explanation
    The command "tee" is used to redirect the standard output of a command in a terminal and simultaneously save it to a file.

    Rate this question:

  • 34. 

    Qual parâmetro do comando uname pode ser utilizado para exibir o hostname da máquina ?

    • -r

    • -n

    • -v

    • -s

    Correct Answer
    A. -n
    Explanation
    The correct answer is "-n". The "-n" parameter in the "uname" command is used to display the hostname of the machine.

    Rate this question:

  • 35. 

    No diretório home do usuário user1 foi digitado o seguinte: "ln file1 file2 ; rm file1" . O que acontece em seguida?

    • file2 seria acessado normalmente.

    • file2 ficaria inacessível.

    • Seria pedido confirmação da ação.

    • file1 e file2 ficariam inacessíveis.

    Correct Answer
    A. file2 seria acessado normalmente.
    Explanation
    Após os comandos "ln file1 file2 ; rm file1" serem digitados no diretório home do usuário user1, o arquivo file2 seria acessado normalmente. O comando "ln file1 file2" cria um link simbólico chamado file2 que aponta para o arquivo file1. Em seguida, o comando "rm file1" remove o arquivo file1, mas o link simbólico file2 ainda permanece apontando para o mesmo local de armazenamento. Portanto, o arquivo file2 ainda pode ser acessado normalmente.

    Rate this question:

  • 36. 

    Qual comando pode ser usado para formatar um arquivo para ser impresso ?

    • cat

    • expand

    • pr

    • nl

    Correct Answer
    A. pr
    Explanation
    O comando "pr" pode ser usado para formatar um arquivo para ser impresso. O "pr" é um utilitário de linha de comando que permite a formatação e a paginação de arquivos de texto para impressão. Ele pode ser usado para ajustar o layout do texto, adicionar cabeçalhos e rodapés, e controlar a formatação geral do documento antes de ser impresso.

    Rate this question:

  • 37. 

    Qual dos seguintes iria copiar o arquivo file1.txt para file2.txt ?

    • cat | file1.txt | file2.txt

    • copy file1.txt | file2.txt

    • cp file1.txt | file2.txt

    • cat file1.txt > file2.txt

    • cat file1.txt | file2.txt

    Correct Answer
    A. cat file1.txt > file2.txt
    Explanation
    The correct answer is "cat file1.txt > file2.txt". This command uses the "cat" command to read the contents of file1.txt and then redirects (>) the output to file2.txt, effectively copying the contents of file1.txt to file2.txt.

    Rate this question:

  • 38. 

    Qual dos comandos abaixo realiza cópia em baixo nível ?

    • cpio

    • od

    • dd

    • cpp

    Correct Answer
    A. dd
    Explanation
    The command "dd" is used to perform low-level copying in Unix-like operating systems. It is commonly used for tasks such as creating disk images, copying data between devices, and backing up data. The "dd" command allows for precise control over the copying process, including options for specifying block sizes, input and output file locations, and data conversion. It is a powerful tool that can be used for various data manipulation tasks at a low level.

    Rate this question:

  • 39. 

    Qual parâmetro do comando uname pode ser utilizado para exibir a versão do kernel ?

    • -m

    • -n

    • -s

    • -v

    • -r

    Correct Answer
    A. -r
    Explanation
    The parameter "-r" in the "uname" command can be used to display the version of the kernel.

    Rate this question:

  • 40. 

    Sabemos que é possível usar atalhos no estilo do emacs para listar o histórico a partir do shell bash. Qual atalho pode ser utilizado para avançar o cursor do prompt shell para o final da linha em uma linha de comando? 

    • Ctrl+a

    • Ctrl+b

    • Ctrl+e

    • Ctrl+f

    Correct Answer
    A. Ctrl+e
    Explanation
    Ctrl+e is the correct answer because it is the shortcut used to move the cursor to the end of the line in a command line. This shortcut is commonly used in the Emacs-style shortcuts for navigating the shell history in the bash shell. Ctrl+a is used to move the cursor to the beginning of the line, Ctrl+b is used to move the cursor backward, and Ctrl+f is used to move the cursor forward.

    Rate this question:

  • 41. 

    Você deseja pesquisar no arquivo myfile todas as ocorrências da string que contenham pelo menos cinco caracteres, onde o caracter de número 2 e 5 são ‘a’ e o caracter de número 3 não é ‘b’. Qual comando você usaria?

    • grep .[a].*.[a] myfile

    • grep .a[^b].a myfile

    • grep .a*^b..a myfile

    • grep a*^b*a myfile

    Correct Answer
    A. grep .a[^b].a myfile
    Explanation
    The correct answer is "grep .a[^b].a myfile". This command uses regular expressions to search for occurrences of the string that have at least five characters, where the second and fifth characters are 'a' and the third character is not 'b'. The '[^b]' part of the regular expression ensures that the third character is not 'b'.

    Rate this question:

  • 42. 

    Qual programa utiliza o arquivo /usr/share/file/magic para determinar o tipo de um arquivo informado como parâmetro ? (Informe somente o comando).

    Correct Answer
    file
    Explanation
    O programa "file" utiliza o arquivo /usr/share/file/magic para determinar o tipo de um arquivo informado como parâmetro. Ele analisa a estrutura interna do arquivo e fornece informações sobre o seu formato, como se é um arquivo de texto, imagem, áudio, etc.

    Rate this question:

  • 43. 

    Você ficou sem espaço no seu diretório home, ao vasculhar pelo que apagar você encontrou o arquivo .bash_history muito grande e o apagou. Dias depois o arquivo ficou grande novamente.  O que fazer para que este arquivo não cresça muito?

    • Alterar a variável HISTFILESIZE para um valor menor.

    • Alterar a variável HISTSIZE para um valor menor.

    • Alterar a variável NOHISTFILE como true

    • Alterar a variável HISTAPPEND como true

    Correct Answer
    A. Alterar a variável HISTFILESIZE para um valor menor.
    Explanation
    To prevent the .bash_history file from growing too large, you should change the value of the HISTFILESIZE variable to a smaller value. This variable determines the maximum number of lines that will be saved in the history file. By setting it to a lower value, the file will not be able to grow too large.

    Rate this question:

  • 44. 

    Qual a correta interpretação do comando seguinte ? test -f /etc/ldap.conf && mail -s 'Cliente LDAP' root < /etc/ldap.conf || /etc/init.d/slurpd stop

    • Se o arquivo /etc/ldap.conf existir ou não, root receberá uma cópia ou não do mesmo. Logo após o script /etc/init.d/slurpd será executado com o parâmetro stop.

    • Se o arquivo /etc/ldap.conf existir o script /etc/init.d/slurpd será executado com o parâmetro stop.

    • Se o arquivo /etc/ldap.conf não existir, o root receberá um e-mail de contéudo vazio.

    • Se o arquivo /etc/ldap.conf existir, o root receberá uma cópia do mesmo. Caso contrário, o script /etc/init.d/slurpd será executado com o parâmetro stop.

    Correct Answer
    A. Se o arquivo /etc/ldap.conf existir, o root receberá uma cópia do mesmo. Caso contrário, o script /etc/init.d/slurpd será executado com o parâmetro stop.
    Explanation
    If the file /etc/ldap.conf exists, the root user will receive a copy of the file. If the file does not exist, the script /etc/init.d/slurpd will be executed with the parameter stop.

    Rate this question:

  • 45. 

    Considerando o Shell Bash, inserindo "1>&2" após um comando de redirecionamento, qual será o resultado deste redirecionamento?

    • Envia a entrada padrão para o erro padrão.

    • Envia o erro padrão para a entrada padrão.

    • Envia a saída padrão para o erro padrão.

    • Envia o erro padrão para a saída padrão.

    • Envia a saída padrão para a entrada padrão.

    Correct Answer
    A. Envia a saída padrão para o erro padrão.
    Explanation
    In Bash Shell, when "&1>&2" is added after a redirection command, it redirects the standard output (stdout) to the standard error (stderr). This means that any output generated by the command will be sent to the error stream instead of the normal output stream.

    Rate this question:

  • 46. 

    Como você pode imprimir um arquivo inteiro para a saída padrão?

    • printfile

    • ls

    • cat

    • pr2stdout

    Correct Answer
    A. cat
    Explanation
    To print an entire file to the standard output, you can use the "cat" command. The "cat" command is commonly used to concatenate and display the contents of files. By providing the filename as an argument to the "cat" command, it will display the entire contents of the file on the standard output.

    Rate this question:

  • 47. 

    Qual o comando completo para obter ajuda sobre o comando ls ?

    Correct Answer
    ls --help
    Explanation
    The correct answer is "ls --help" because the "--help" option is used to obtain information and guidance on how to use the "ls" command. This option displays a list of available command line options, their descriptions, and usage examples. By typing "ls --help" in the command line, users can access this helpful documentation and get assistance on how to effectively utilize the "ls" command.

    Rate this question:

  • 48. 

    Qual comando man (Com parâmetro) irá retornar uma saída similar ao comando apropos ?

    • man -f

    • man -k

    • man -a

    • man -c

    Correct Answer
    A. man -k
    Explanation
    The correct answer is "man -k". The "man -k" command will return a similar output to the "apropos" command. The "apropos" command is used to search for commands based on keywords, and the "man -k" command performs a similar function by searching for manual pages that contain the specified keyword.

    Rate this question:

  • 49. 

    Qual comando abaixo exibe o contéudo do diretório /etc ?

    • /bin/ls -l /etc 1>/dev/null

    • /bin/ls -l /etc > /dev/null 2>&1

    • /bin/ls -l /etc >/dev/null

    • /bin/ls -l /etc >&1

    Correct Answer
    A. /bin/ls -l /etc >&1
    Explanation
    The command "/bin/ls -l /etc >&1" will display the content of the directory /etc. The "&>1" at the end redirects both the standard output and standard error to the file descriptor 1, which represents the standard output. This means that any output or error message generated by the command will be displayed on the console.

    Rate this question:

Quiz Review Timeline (Updated): Mar 22, 2023 +

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

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 09, 2016
    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.