LPI 101 - Comandos GNU/Linux 2- 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,534
| Attempts: 342 | Questions: 100
Please wait...
Question 1 / 100
0 %
0/100
Score 0/100
1. Quais comandos podem ser usados para paginar a saída de um resultado emitido por um determinado comando ? (Selecione 2 respostas).

Explanation

The commands "more" and "less" can be used to paginate the output of a command. These commands allow the user to view the output one page at a time, making it easier to read and navigate through large amounts of information. "More" displays one page of output at a time and waits for the user to press the Enter key to view the next page, while "less" provides similar functionality but also allows for backward scrolling and searching within the output.

Submit
Please wait...
About This Quiz
LPI 101 - Comandos GNU/Linux 2- Marcus Vinicius Braga Alcantara - Quiz

.

Tell us your name to personalize your report, certificate & get on the leaderboard!
2. Qual comando no modo de navegação do editor vi é usado para apagar toda uma linha ?
 

Explanation

The command "dd" in vi's navigation mode is used to delete an entire line.

Submit
3. Quais os dois comandos que exibirão o estado de processos em um sistema Linux?  Selecione uma opção.

Explanation

The correct answer is "ps e top". The "ps" command is used to display information about active processes in a Linux system, while the "top" command provides real-time monitoring of system processes, including CPU usage, memory usage, and more. These two commands are commonly used to check the state of processes in a Linux system.

Submit
4. Sobre o comando rmdir. Associe:
Submit
5. Qual comando é utilizado para criar um novo arquivo de texto vazio?

Explanation

The command "touch" is used to create a new empty text file.

Submit
6. Um processo com PID 1048 está atrapalhando seu sistema.  Como root, você entra com o seguinte comando: "kill 1048".  Contudo, você não obtém resultado.  O que você pode fazer para terminar o processo?  Selecione a opção correta:

Explanation

The correct answer is "kill -9 1048". The "-9" option in the kill command sends a SIGKILL signal to the process with the specified PID, forcing it to terminate immediately. This signal cannot be ignored or caught by the process, making it a surefire way to end a stubborn process.

Submit
7. Sobre o comando tail. Associe:
Submit
8. Para modificar a palavra "teste" pela palavra "testes" em um arquivo denominado arq1, podemos usar o comando _______ 's/teste/testes/g' arq1

Explanation

The correct answer is "sed". The sed command is used for text manipulation and stands for "stream editor". In this case, the command 's/teste/testes/g' is used to substitute the word "teste" with "testes" in the file named "arq1". The 's' indicates a substitution, the 'g' stands for global (replacing all occurrences), and the forward slashes are used to delimit the search and replacement strings.

Submit
9. Para modificar a palavra "teste" pela palavra "testes" em um arquivo denominado arq1, podemos usar o comando _______ 's/teste/testes/g' arq1

Explanation

The correct answer is "sed". Sed is a command-line utility for editing text files. In this context, the sed command is being used with the 's/teste/testes/g' pattern, which means to substitute all occurrences of the word "teste" with "testes" in the file named "arq1".

Submit
10. Qual dos comandos abaixo irá retornar o status de saída do comando anterior (1 ou 0)?

Explanation

The correct answer is "echo $?" because the "$?" is a special variable in Unix-like operating systems that holds the exit status of the previously executed command. By using the "echo" command with "$?", it will display the exit status (either 1 or 0) of the previous command.

Submit
11. Ao realizar o comando cat /etc/passwd | _____ [:lower:] [:upper:], todo o conteúdo do arquivo será mostrado em caixa alta.

Explanation

By using the "tr" command with the options [:lower:] [:upper:], all the content of the "/etc/passwd" file will be displayed in uppercase. The "tr" command is used for translating or deleting characters, and in this case, it is translating lowercase letters to uppercase letters.

Submit
12. O comando; "find -type -l" irá procurar quais tipos de arquivos ?

Explanation

The command "find -type -l" is used to search for symbolic links. The "-type -l" option specifies that only symbolic links should be searched for.

Submit
13. O comando expand -t N irá especificar o valor a ser substituído para o tamanho da tabulação.

Explanation

The given statement is true. The command "expand -t N" is used to specify the value to be substituted for the tab size. By using this command, the tab characters in a file can be replaced with spaces. The "N" in the command represents the desired tab size.

Submit
14. Qual dos seguintes comandos é equivalente a matar 1234?

Explanation

The correct answer is "kill -9 1234" or "kill -s SIGKILL 1234". This is because the "-9" option or "SIGKILL" signal is used to forcefully terminate a process. It is the most aggressive way to kill a process and cannot be ignored or handled by the process. Therefore, using this command will ensure that the process with ID 1234 is immediately terminated.

Submit
15. Quais dos comandos abaixo podem ser utilizados para visualizar o PID de um programa que acabamos de iniciar ? (Selecione 2 respostas).

Explanation

The commands "ps" and "top" can be used to view the PID of a program that has just been started. The "ps" command displays information about active processes, including their PIDs, while the "top" command provides a real-time overview of system processes, including their PIDs. Therefore, both commands can be used to identify the PID of a recently started program.

Submit
16. Você criou uma longa carta e depois percebeu que usou o nome "bob" muitas vezes, mas você esqueceu de capitalizá-lo em muitos casos. Qual comando iria substituir "bob" por "Bob" em todas as instâncias e gerar uma nova carta para impressão?

Explanation

The correct answer is "sed 's/bob/Bob/g' carta.txt > nova_carta.txt". This is because the sed command is used for text manipulation and the 's' option stands for substitute. The pattern 'bob' is being replaced with 'Bob' using the 'g' flag, which means globally (i.e., all instances of 'bob' in the file will be replaced). The output of the command is redirected to a new file called "nova_carta.txt".

Submit
17. Qual comando irá alterar a prioridade do processo em execução com o ID igual à 12345 para a maior prioridade?

Explanation

The correct answer is "/usr/bin/renice -20 12345". This command will change the priority of the process with the ID 12345 to the highest priority by setting the nice value to -20. The nice value is a way to adjust the priority of a process, with lower values indicating higher priority.

Submit
18. Qual comando irá imprimir uma lista de nomes de usuário (primeira coluna) e seu user id (uid, terceira coluna) correspondente no arquivo /etc/passwd ?

Explanation

The correct answer is "cut -d: -f 1,3 /etc/passwd". This command uses the "cut" utility to extract specific columns from the "/etc/passwd" file. The "-d:" option specifies that the fields in the file are separated by colons, and the "-f 1,3" option indicates that we want to extract the first and third fields (username and uid). This command will print a list of usernames and their corresponding user ids.

Submit
19. Qual o comando que força a saída do editor vi sem salvar as alterações feitas em determinado arquivo ?

Explanation

The correct answer is ":q!". This command is used in the vi editor to exit without saving any changes made to a specific file. The "q" stands for quit and the exclamation mark "!" forces the editor to exit without prompting for confirmation.

Submit
20. Qual o comando que podemos usar para recuperar a edição do arquivo /etc/resolv.conf conforme a figura abaixo ?

Explanation

The correct answer is "fg %2". The "fg" command is used to bring a background job to the foreground. The "%2" specifies the job number, in this case job number 2. So, "fg %2" will bring the job number 2 to the foreground, allowing the user to interact with it.

Submit
21. Qual comando pode ser utilizado para mostrar as linhas iniciais de um arquivo, onde por padrão as 10 primeiras linhas serão mostradas.

Explanation

The "head" command is used to display the first few lines of a file. By default, it shows the first 10 lines of the file.

Submit
22. Você precisa exibir todos os arquivos no diretório atual que começam com um "a" e final com um "v", independentemente do seu comprimento, ou a utilização de delimitadores. (Escolha a melhor resposta).

Explanation

The correct answer is "ls a*v" because it uses the wildcard character "*" to represent any number of characters between "a" and "v". This will match any file in the current directory that starts with "a" and ends with "v", regardless of the length or the use of delimiters.

Submit
23. O que acontece quando o caractere "&" é adicionado ao término de um comando?  Selecione a opção correta.

Explanation

Quando o caractere "&" é adicionado ao término de um comando, isso coloca o processo em segundo plano. Isso significa que o processo continuará sendo executado em segundo plano, permitindo que o usuário execute outros comandos na mesma linha de comando ou em outra janela do terminal.

Submit
24. Supondo que você possui dois arquivos, eles são: arq1.txt e arq2.txt. Como você faria para imprimir o conteúdo do arq1.txt ao final do conteúdo do arq2.txt sem sobrescrever o conteúdo do arq2.txt ? (Utilze o comando cat).

Explanation

The command "cat arq1.txt >> arq2.txt" is used to append the content of arq1.txt to the end of arq2.txt without overwriting the existing content in arq2.txt. The ">>" operator is used for appending, while the "cat" command is used to concatenate and display the contents of a file.

Submit
25. Que ferramenta você poderia usar para mudar a prioridade de um processo corrente?

Explanation

Renice é a resposta correta porque é uma ferramenta do sistema operacional Linux que permite ao usuário alterar a prioridade de um processo em execução. Ao usar o comando "renice", o usuário pode ajustar a prioridade de um processo para torná-lo mais ou menos prioritário em relação a outros processos em execução no sistema. Isso pode ser útil para equilibrar a carga do sistema, dando mais recursos a processos importantes ou reduzindo a prioridade de processos que estão consumindo muitos recursos.

Submit
26. Qual é o sinal padrão enviado pelo comando kill a um processo quando não é informado nenhum sinal como argumento ?

Explanation

Quando nenhum sinal é informado como argumento para o comando kill, o sinal padrão enviado ao processo é o SIGTERM. Esse sinal é usado para solicitar que o processo encerre sua execução de forma ordenada, permitindo que ele finalize suas tarefas e libere os recursos utilizados antes de encerrar.

Submit
27. Qual é o valor de prioridade padrão do comando nice? (Informe somente o valor).

Explanation

The default priority value for the "nice" command is 10.

Submit
28. O comando fmt, por padrão ajusta o texto de um arquivo com 75 caracteres por linha.

Explanation

The given statement is true. The fmt command, by default, adjusts the text of a file to have 75 characters per line. This means that if a line exceeds 75 characters, the fmt command will automatically break it into multiple lines to maintain the desired line length.

Submit
29. Qual comando mantém uma tarefa em execução mesmo após realizarmos um logoff do terminal onde o mesmo foi iniciado ?

Explanation

The correct answer is "nohup". The "nohup" command is used to run a command or script in the background and ensures that it continues running even after logging off from the terminal. It is often used to prevent a process from being terminated when the terminal session ends.

Submit
30. Qual o comando digitado no modo de navegação do editor vi adiciona uma linha abaixo do cursor e abre o modo de inserção ?

Explanation

The command "o" is used in vi editor's navigation mode to add a new line below the cursor and switch to the insert mode.

Submit
31. Qual é o valor de prioridade para qualquer processo iniciado no Sistema ?

Explanation

The value of priority for any process initiated in the system is 0.

Submit
32. No editor vi, qual dos seguintes comandos irá apagar a linha atual no cursor e as 16 linhas seguintes (17 Linhas no total) ?

Explanation

The command "17dd" in vi will delete the current line at the cursor and the 16 lines following it, resulting in a total of 17 lines being deleted.

Submit
33. Depois de executar a seguinte linha de comando; echo \"test king\ " | cat > myout.txt. Qual será o conteúdo do arquivo myout.txt ?

Explanation

The command "echo "test king" | cat > myout.txt" will redirect the output of the "echo" command, which is "test king", to the file "myout.txt". Therefore, the content of the file "myout.txt" will be "test king".

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

Explanation

The command "dd" is used to perform low-level copying in Linux. 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 specifying the block size and the number of blocks to copy. It is a powerful tool that can be used for various data manipulation tasks.

Submit
35. Supondo que você possui 2 arquivos de texto (arq1.txt e arq2.txt), onde o arq1.txt possui os seguintes nomes para cada linha do arquivo: fulano, beltrano e cicrano,  e no arq2.txt os seguintes domínios por linha no arquivo; hotmail.com, gmail.com e yahoo.com. Qual o comando completo que irá unir as linhas dos dois arquivos em uma única linha na saída padrão separadas pelo caractre "@" ?

Explanation

The correct answer is "paste -d "@" arq1.txt arq2.txt". The "paste" command is used to merge lines from two files side by side. The "-d" option is used to specify the delimiter character to separate the merged lines, which in this case is "@" as stated in the question. Therefore, the command "paste -d "@" arq1.txt arq2.txt" will join the lines from arq1.txt and arq2.txt into a single line with "@" as the delimiter.

Submit
36. Sobre o comando mkdir. Associe:
Submit
37. Qual é o valor do comando nice quando desejamos executar um novo processo com prioridade máxima ?

Explanation

The correct answer is -20. In the context of the command "nice" in Unix-like operating systems, the value -20 represents the highest priority. By setting the nice value to -20, we are indicating that we want to execute a new process with the highest priority, allowing it to utilize more system resources and CPU time compared to other processes.

Submit
38.  Observe a lista de tarefas em execução abaixo e responda. Qual o comando que torna possível encerrarmos o comando find em execução ?
 

Explanation

The correct answer is "kill %2". This command uses the "kill" command with the argument "%2" to terminate the second job running in the background. The "%" symbol is used to refer to a job number, and "2" specifies the second job. This command is used to stop the execution of the "find" command.

Submit
39. Qual dos seguintes comandos GNU seria o comando mais provável que você usaria para encontrar a média de carga do sistema?

Explanation

The command "top" is the most likely command that you would use to find the system's average load. "top" is a command-line tool that provides real-time information about system processes, including the load average. It displays a list of running processes and their resource usage, including the CPU load average. Therefore, using the "top" command would allow you to easily find the average load of the system.

Submit
40. Qual dos comandos abaixo utiliza a variável de ambiente PATH para buscar um programa fornecido como argumento ?

Explanation

The command "which" utilizes the PATH environment variable to search for a program provided as an argument. It helps in locating the executable file associated with a given command by searching through the directories listed in the PATH variable. This command is commonly used in Unix-like operating systems to determine the location of a command that will be executed when it is typed in the terminal.

Submit
41. Quais dos comandos abaixo podem ser usados para gravar e sair da execução do editor vi ? (Selecione 3 respostas).

Explanation

The given answer is correct because shift+ZZ, :x, and :wq are all valid commands in the vi editor that can be used to save and exit the execution. shift+ZZ saves the changes and exits the editor, :x saves the changes and exits the editor, and :wq saves the changes and exits the editor. :e is not a command for saving and exiting the editor.

Submit
42. O que o comando seguinte irá fazer ? cmd > file.out 2>&1

Explanation

The given command "cmd > file.out 2>&1" redirects both the standard output (stdout) and the standard error (stderr) of the command "cmd" to the file "file.out". This means that any output or error messages generated by "cmd" will be written to the "file.out" file.

Submit
43. Qual comando concatena registros de dois arquivos de texto baseado em índices comuns ? O comando funciona como um tipo de banco de dados primitivo, permitindo a montagem de novos arquivos de registros a partir de registros existentes em diferentes arquivos.

Explanation

The command "join" is used to concatenate records from two text files based on common indices. It acts as a primitive database, allowing the assembly of new record files from existing records in different files.

Submit
44. Sobre o comando rm. Associe:
Submit
45. Qual dos comandos a seguir é usado para pôr em segundo plano um programa que está prendendo o terminal de modo que ele continue processando ?

Explanation

The correct answer is "Ctrl-Z e então entrar com o comando bg". This combination of keys allows you to suspend a program that is running in the foreground and send it to the background, allowing it to continue processing while freeing up the terminal for other commands.

Submit
46. Sobre o comando touch. Associe:
Submit
47. Qual comando substitui espaços de tabulação (TABs) por espaços simples, mantendo a mesma distância aparente?

Explanation

The command "expand" can be used to replace tab spaces with single spaces while maintaining the same apparent distance.

Submit
48. Qual comando pode ser utilizado para formatar arquivos de texto ?

Explanation

O comando "fmt" pode ser utilizado para formatar arquivos de texto.

Submit
49. Supondo que gostaria de listar as 5 primeiras linhas do arquivo /etc/passwd utilizando o comando head. Qual seria o comando completo para realizar tal tarefa ?

Explanation

The given command "head -n 5 /etc/passwd" is the correct command to list the first 5 lines of the /etc/passwd file using the head command. The "head" command is used to display the beginning of a file, and the "-n" option specifies the number of lines to be displayed. So, in this case, it will display the first 5 lines of the /etc/passwd file.

Submit
50. Qual dos seguintes comandos sed irá substituir todas as ocorrências da string "foo" para "foobar" sem que o arquivo file1.txt seja alterado?

Explanation

The correct answer is "sed 's/foo/foobar/g' file1.txt". This command uses the sed utility to perform a search and replace operation in the file file1.txt. It searches for all occurrences of the string "foo" and replaces them with "foobar". The "g" flag is used to indicate that the replacement should be done globally, meaning all occurrences of "foo" will be replaced. This command does not alter the original file file1.txt.

Submit
51. O que faz o seguinte comando? cat \$TEST

Explanation

This command "cat $TEST" is used to display the contents of the file named $TEST, if it exists. The "cat" command is commonly used in Unix-like operating systems to concatenate and display the contents of files. In this case, the variable $TEST is being used to specify the file name, and if the file exists, its contents will be displayed.

Submit
52. Qual é o resultado do seguinte comando? cat 'echo" $testking

Explanation

The given command is cat 'echo" $testking. This command contains a syntax error because it is using both single quotes and double quotes in an incorrect way. The correct way to use quotes in this command would be either to use double quotes around the entire command or to escape the inner double quotes with a backslash. Since the command is incorrect, it will result in a syntax error.

Submit
53. Quais dos comandos torna possível alterar a prioridade de um processo em execução ? (Selecione 2 respostas).

Explanation

The correct answer is "renice" and "top". These two commands allow the user to change the priority of a running process. "renice" command is used to alter the priority of a process that is already running, while "top" command provides a dynamic real-time view of the running processes and allows the user to interactively change the priority of a process. Both commands are commonly used in Linux systems for process management and optimization.

Submit
54. Que comando irá mostrar-lhe os valores definidos pelo arquivo /etc/bashrc para todo o sistema ?

Explanation

The "set" command will display the values defined by the /etc/bashrc file for the entire system.

Submit
55. Qual o uso correto do comando find quando desejamos procurar em todo sistema por arquivos com o bit de execução SUID ativo ?

Explanation

The correct answer is "find / -perm +4000 -exec ls -ld {} \;". This command uses the "find" command to search the entire system ("/") for files with the SUID (Set User ID) bit set. The "-perm +4000" option specifies that the file's permissions should match the exact value of 4000, indicating that the SUID bit is active. The "-exec ls -ld {} \;" part of the command executes the "ls -ld" command on each found file, displaying detailed information about the file.

Submit
56. Que seqüência de teclas irá suspender o processo atual e voltará para um prompt shell?

Explanation

Pressing Ctrl-z will suspend the current process and return to a shell prompt. This is because Ctrl-z is the keyboard shortcut for sending the SIGSTOP signal to the current process, which suspends its execution.

Submit
57. Ao executar o comando ls > ls.txt

Explanation

Ao executar o comando "ls > ls.txt", o que acontece é que o comando "ls" é executado e o resultado é redirecionado para o arquivo "ls.txt". Se o arquivo "ls.txt" não existir, ele será criado. Se o arquivo já existir, o conteúdo anterior será apagado e substituído pelo resultado do comando "ls". Portanto, a resposta correta é que, caso não exista, o arquivo "ls.txt" será criado e o conteúdo anterior será apagado.

Submit
58. Você emitiu o comando "ls | grep .a[^b]a.". Quais arquivos são retornados pelo comando? (Escolha todas que se aplicam).

Explanation

The command "ls | grep .a[^b]a." searches for files that have a letter followed by "a" and another letter that is not "b" and then followed by "a" and any character. Among the given options, the files "ratas", "jacaw", and "saran" meet this criteria and will be returned by the command.

Submit
59. Sobre o comando uniq. Associe:
Submit
60. Qual das opções abaixo irá contar o número total de linhas com a palavra "testking" em /var/log/maillog ?

Explanation

The correct answer is "cat /var/log/maillog | grep 'testking' | wc -l". This command will display the contents of the maillog file, filter out the lines that contain the word 'testking' using the grep command, and then count the number of lines using the wc command with the -l option. This will give the total number of lines with the word 'testking' in the maillog file.

Submit
61. Qual a correta sequência de comandos para colocar uma tarefa em segundo plano ?

Explanation

The correct sequence of commands to put a task in the background is to first press CTRL+Z to suspend the task, and then use the bg command to resume it in the background. This allows the task to continue running while the user can still interact with the terminal. The other options listed are not the correct sequence of commands for this task.

Submit
62. Supondo que você possui um arquivo chamado myfile.txt, onde tal arquivo possui 4000 linhas. Como você faria para dividir o arquivo myfile.txt em 10 arquivos utilizando o comando split ?

Explanation

The correct answer is "split -l 400 myfile.txt split-myfile-". This command will divide the file "myfile.txt" into 10 separate files, each containing 400 lines. The output files will be named "split-myfile-aa", "split-myfile-ab", "split-myfile-ac", and so on.

Submit
63. Qual é a desvantagem de usar o comando kill -9 ?

Explanation

A desvantagem de usar o comando kill -9 é que o processo afetado é incapaz de limpar antes de sair. Isso significa que o processo não tem a oportunidade de liberar recursos, fechar arquivos abertos ou realizar outras tarefas de limpeza antes de ser encerrado abruptamente. Isso pode levar a problemas de memória, vazamentos de recursos ou corrupção de dados.

Submit
64. Qual comando pode ser utilizado para unir as linhas de dois arquivos utilizando um caractere delimitador na saída do resultado obtido?

Explanation

The "paste" command can be used to merge the lines of two files together using a delimiter character in the output result.

Submit
65. Qual o correto comando usado para que o conteúdo do arquivo foo.tar.bz2 seja mostrado ?

Explanation

The correct command to use in order to display the contents of the file foo.tar.bz2 is "tar tjf foo.tar.bz2".

Submit
66. No editor vi, você deseja salvar as mudanças no arquivo myfile com ":w!", mas o vi reclama que você não pode escrever no arquivo. Portanto, você precisa verificar as permissões de gravação no arquivo. Para fazer isso sem sair do vi, você digita:

Explanation

The correct answer is ":!ls -l myfile". This command allows you to check the permissions of the file "myfile" without exiting the vi editor. The "!ls -l" command is used to list the file details, including the permissions, and "myfile" is the name of the file you want to check.

Submit
67. Supondo que você possui um arquivo chamado myfile.txt, onde seu tamanho é de 1024 bytes. Como você faria para dividir este arquivo em parte menores de 256 bytes cada ?

Explanation

To divide the myfile.txt file into smaller parts of 256 bytes each, the correct command is "split -b 256 myfile.txt split-file.txt-". This command uses the "split" utility, with the "-b" option to specify the size of each part, followed by the name of the input file (myfile.txt), and the prefix for the output files (split-file.txt-). This command will create multiple output files, each containing 256 bytes of data from the original file.

Submit
68. Qual dos comandos abaixo poderia ser utilizado para visualizar os arquivos empacotados no "arquivos-pdf.tar" ?

Explanation

The command "tar -tf arquivos-pdf.tar" can be used to view the files packaged in the "arquivos-pdf.tar" file. The "-t" option lists the contents of the tar file, and the "-f" option specifies the file name.

Submit
69. Você digitou o comando; "cat MyFile | sort > DirList &" e o sistema respondeu com "[4] 3499".  O que isso significa?

Explanation

The correct answer is "O job é 4 e o PID do sort é 3499." This means that the job number is 4 and the process ID (PID) of the sort command is 3499.

Submit
70. Supondo que você possui 5 arquivos no formato pdf; (arq1.pdf...arq5.pdf) localizados no diretório "/home/mypdf", qual das alternativas abaixo poderia ser utilizada para empacotar todos os arquivos pdf em um arquivo chamado arquivos-pdf.tar ?

Explanation

The correct answer is "cd /home/mypdf ; tar -cf arquivos-pdf.tar *.pdf". This command changes the directory to /home/mypdf and creates a tar archive called arquivos-pdf.tar with all the pdf files in the directory. The -c flag is used to create the archive, and the -f flag specifies the name of the archive. The *.pdf specifies that all files with the .pdf extension should be included in the archive.

Submit
71. Qual comando irá exibir em ordem inversa o conteúdo do arquivo file, além de numerar todas as linhas de tal arquivo ?

Explanation

The correct answer is "cat file | tac | nl". The command "tac" is used to reverse the order of lines in a file, and the command "nl" is used to add line numbers to the output. By piping the output of "cat file" into "tac" and then into "nl", the content of the file will be displayed in reverse order with line numbers.

Submit
72. Supondo que gostaria de listar os 30 primeiros caracteres do arquivo /etc/passwd utilizando o comando head. Qual seria o comando completo para realizar tal tarefa ?

Explanation

The given command "head -c 30 /etc/passwd" is the correct answer. The command "head" is used to display the first few lines of a file, and the option "-c" is used to specify the number of characters to display. Therefore, "head -c 30 /etc/passwd" will display the first 30 characters of the file /etc/passwd.

Submit
73. Utilizando o comando od. Como faria para exibir o conteúdo do arquivo myfile.txt no formato Hexadecimal ?

Explanation

The command "od -t x myfile.txt" is used to display the contents of the file "myfile.txt" in hexadecimal format. The "od" command is used to dump files in various formats, and the "-t x" option specifies that the output should be in hexadecimal format.

Submit
74. Quais dos comandos abaixo irá ocultar a ocorrência do caractere "s" no arquivo /etc/passwd ? (Selecione 2 respostas).

Explanation

The first command "cat /etc/passwd | tr -d s" will display the contents of the /etc/passwd file and then remove all occurrences of the letter "s". The second command "tr -d s

Submit
75. Que comando irá mostrar-lhe os valores definidos pelo arquivo /etc/profile para todo o sistema ?

Explanation

The "env" command will display the values set by the /etc/profile file for the entire system. This command is used to print the current environment variables. By running "env", you can see the environment variables that have been set, including those defined in the /etc/profile file.

Submit
76. Ao executar o comando: sed -i 's/$/;/' teste2.txt

Explanation

The given command "sed -i 's/$/;/' teste2.txt" uses the sed command to edit the file "teste2.txt" in-place (-i option). The 's/$/;/' part of the command is a sed substitution expression, where it searches for the end of each line ($) and replaces it with a semicolon (;). Therefore, the command will add a semicolon at the end of each line within the file "teste2.txt".

Submit
77. Qual é o nome e o caminho completo do arquivo que contém as variáveis ​​de ambiente e programas de inicialização?

Explanation

The correct answer is /etc/profile. This file contains the environment variables and initialization programs. It is located in the /etc directory.

Submit
78. Sobre o comando split. Associe:
Submit
79. Utilizando o comando od. Como faria para exibir o conteúdo do arquivo myfile.txt no formato octal ?

Explanation

The command "od -t o myfile.txt" is used to display the content of the file "myfile.txt" in octal format. The "od" command is a tool used to display file contents in different formats, and the "-t o" option specifies that the output should be in octal format. By running this command, the content of the "myfile.txt" file will be displayed in octal format.

Submit
80. Qual comando expand com opção irá substituir apenas as ocorrências em inicio de linha ?

Explanation

The command "expand -i" with the "-i" option will replace only the occurrences at the beginning of each line.

Submit
81. Sobre o comando wc. Associe:
Submit
82. Qual dos comandos abaixo irá mostrar-lhe apenas as 10 linhas intermediárias de um arquivo de texto com 30 linhas chamado textfile?

Explanation

The correct answer is "head -n 20 textfile | tail". This command uses the "head" command to display the first 20 lines of the textfile and then pipes the output to the "tail" command, which displays the last 10 lines of the output. Therefore, it will show only the 10 intermediate lines of the textfile.

Submit
83. Sobre o comando cp. Associe:
Submit
84. Supondo que você não possua nenhum editor de texto instalado no seu sistema, mesmo os editores padrões. Qual comando (Completo) pode ser utilizado para criar uma arquivo chamado; myfile.txt e logo em seguida inserir um texto qualquer neste arquivo ?

Explanation

cat > arquivo.txt e logo após a digitar o texto. finalize com Crtl+d

Submit
85. Um usuário precisa procurar um arquivo para as linhas que contenham o caractere asterisco (*). Qual dos comandos abaixo irá conseguir isso ? (Escolha todas que se aplicam).

Explanation

The correct answers are "grep \* textfile", "grep '*' textfile", and "grep "*" textfile". These commands will search for lines in the "textfile" that contain the asterisk character (*). The backslash (\) is used to escape the special meaning of the asterisk character in regular expressions. The single quotes ('') and double quotes ("") are used to treat the asterisk character as a literal character. The command "grep \ textfile" will search for lines that contain a space, not an asterisk. The command "grep "'*'" textfile" will search for lines that contain the literal string "*".

Submit
86. Suponha que possuo um arquivo chamado "texto.txt" que possui o total de 100 linhas. Qual comando poderia utilizar para definir a formatação deste arquivo para mostrar na saída padrão cada linha com largura de valor igual a 10 ?

Explanation

The command "fmt -w 10 texto.txt" can be used to set the formatting of the file "texto.txt" so that each line is displayed with a width of 10 characters on the standard output.

Submit
87. Qual parâmetro do comando paste irá unir as linhas de um arquivo em uma só linha ?

Explanation

The parameter "paste -s" in the command "paste" will join the lines of a file into a single line.

Submit
88. Sobre o comando more. Associe.
Submit
89. Qual o resultado do comando ps ef ?

Explanation

The correct answer is "Lista todos os processos em execução em forma de árvore". This is because the command "ps ef" lists all the running processes in a tree-like structure, showing the parent-child relationships between processes.

Submit
90. Qual o comando incorporado ao shell Bash que lista os processos iniciados por mim ? (Especifique somente o comando).

Explanation

The correct answer is "jobs". In the Bash shell, the "jobs" command is used to list the processes that were started by the current user. It provides information about the running and stopped background processes, including their job numbers and status. This command is useful for managing and monitoring the background tasks initiated by the user.

Submit
91. Utilizando o comando od. Como faria para exibir o conteúdo do arquivo myfile.txt no formato ASCII ?

Explanation

The command "od -t c myfile.txt" is used to display the content of the file "myfile.txt" in ASCII format. The "od" command is used to dump files in octal and other formats, and the "-t c" option specifies that the output should be in ASCII characters.

Submit
92. Qual comando pode ser executado no shell bash, para evitar sobrescrever um arquivo acidentalmente. Por exemplo, para impedi-lo de sobrescrever um arquivo usando o ">" redirecionador no shell atual .

Explanation

The command "set -o noclobber" can be executed in the bash shell to prevent accidentally overwriting a file. This command enables the "noclobber" option, which prevents the ">" redirection operator from overwriting an existing file in the current shell. This means that if you try to redirect output to a file using ">" and the file already exists, the shell will not overwrite it and will display an error message instead.

Submit
93. Sobre o comando cut. Associe.
Submit
94. Quais dos comandos abaixo podem arquivar toda uma estrutura de diretório em um único arquivo ?

Explanation

Both cpio and tar commands can archive an entire directory structure into a single file. The cpio command is used to copy files to and from archives, while the tar command is used to create, list, and extract files from tape archives. Both commands are commonly used in Linux and Unix systems for backup and archiving purposes.

Submit
95. Você deseja definir as suas opções de shell de forma que a saída de um redirecionamento não vai sobrescrever um arquivo existente. Digite o comando incluindo switches.

Explanation

The command "set -o noclobber" is used to prevent the output of a redirection from overwriting an existing file. When this option is enabled, if a redirection tries to create a file that already exists, it will fail and an error message will be displayed.

Submit
96. Qual o comando completo, utilizando o touch, irá alterar a data e hora da ultima modificação do arquivo touch.txt para 24/12/2016 às 23:59 ?

Explanation

The correct answer is "touch -m -t 201612242359 touch.txt". This command uses the touch command with the options -m (modify the timestamp) and -t (specify the timestamp). The timestamp given is 201612242359, which represents the date and time 24/12/2016 at 23:59. The command is applied to the file touch.txt, changing its last modification date and time to the specified value.

Submit
97. Sobre o comando sort. Associe:
Submit
98. Qual comando irá remover todos os arquivos nomeados de "core" nos diretórios pessoais dos usuários (/home), que possuam mais de 7 dias de idade, desde sua última modificação? (Digite o comando mais simples para fazer isso).

Explanation

The correct answer is "find /home -mtime +7 -name core -exec rm {} \;". This command uses the "find" command to search for files named "core" in the /home directory that are older than 7 days (-mtime +7). It then executes the "rm" command to remove those files.

Submit
99. Sobre o comando fmt. Associe:
Submit
100. Sobre o comando pr. Associe:
Submit
View My Results

Quiz Review Timeline (Updated): Jul 22, 2024 +

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

  • Current Version
  • Jul 22, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 13, 2017
    Quiz Created by
    Viniciusalcantar
Cancel
  • All
    All (100)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Quais comandos podem ser usados para paginar a saída de um...
Qual comando no modo de navegação do editor vi é usado...
Quais os dois comandos que exibirão o estado de processos em um...
Sobre o comando rmdir. Associe:
Qual comando é utilizado para criar um novo arquivo de texto...
Um processo com PID 1048 está atrapalhando seu sistema. ...
Sobre o comando tail. Associe:
Para modificar a palavra "teste" pela palavra "testes" em um arquivo...
Para modificar a palavra "teste" pela palavra "testes" em um arquivo...
Qual dos comandos abaixo irá retornar o status de saída...
Ao realizar o comando cat /etc/passwd | _____ [:lower:] [:upper:],...
O comando; "find -type -l" irá procurar...
O comando expand -t N irá especificar o valor a ser...
Qual dos seguintes comandos é equivalente a matar 1234?
Quais dos comandos abaixo podem ser utilizados para visualizar o PID...
Você criou uma longa carta e depois percebeu que usou o nome...
Qual comando irá alterar a prioridade do processo em...
Qual comando irá imprimir uma lista de nomes de usuário...
Qual o comando que força a saída do editor vi sem salvar as...
Qual o comando que podemos usar para recuperar a edição do...
Qual comando pode ser utilizado para mostrar as linhas iniciais de um...
Você precisa exibir todos os arquivos no diretório atual...
O que acontece quando o caractere "&" é...
Supondo que você possui dois arquivos, eles são: arq1.txt...
Que ferramenta você poderia usar para mudar a prioridade de um...
Qual é o sinal padrão enviado pelo comando kill a um...
Qual é o valor de prioridade padrão do comando nice?...
O comando fmt, por padrão ajusta o texto de um arquivo com 75...
Qual comando mantém uma tarefa em execução mesmo...
Qual o comando digitado no modo de navegação do editor vi...
Qual é o valor de prioridade para qualquer processo iniciado no...
No editor vi, qual dos seguintes comandos irá apagar a linha...
Depois de executar a seguinte linha de comando; echo \"test...
Qual dos comandos abaixo realiza cópia em baixo nível ?
Supondo que você possui 2 arquivos de texto (arq1.txt e...
Sobre o comando mkdir. Associe:
Qual é o valor do comando nice quando desejamos executar um...
 Observe a lista de tarefas em execução abaixo e...
Qual dos seguintes comandos GNU seria o comando mais provável...
Qual dos comandos abaixo utiliza a variável de ambiente PATH...
Quais dos comandos abaixo podem ser usados para gravar e sair da...
O que o comando seguinte irá fazer ? cmd > file.out...
Qual comando concatena registros de dois arquivos de texto baseado em...
Sobre o comando rm. Associe:
Qual dos comandos a seguir é usado para pôr em segundo...
Sobre o comando touch. Associe:
Qual comando substitui espaços de tabulação (TABs) por...
Qual comando pode ser utilizado para formatar arquivos de texto ?
Supondo que gostaria de listar as 5 primeiras linhas do arquivo...
Qual dos seguintes comandos sed irá substituir todas as...
O que faz o seguinte comando? cat \$TEST
Qual é o resultado do seguinte comando? cat...
Quais dos comandos torna possível alterar a prioridade de um...
Que comando irá mostrar-lhe os valores definidos pelo arquivo...
Qual o uso correto do comando find quando desejamos procurar em todo...
Que seqüência de teclas irá suspender o processo...
Ao executar o comando ls > ls.txt
Você emitiu o comando "ls | grep .a[^b]a.". Quais...
Sobre o comando uniq. Associe:
Qual das opções abaixo irá contar o número total...
Qual a correta sequência de comandos para colocar uma tarefa em...
Supondo que você possui um arquivo chamado myfile.txt, onde tal...
Qual é a desvantagem de usar o comando kill -9 ?
Qual comando pode ser utilizado para unir as linhas de dois arquivos...
Qual o correto comando usado para que o conteúdo do arquivo...
No editor vi, você deseja salvar as mudanças no arquivo myfile...
Supondo que você possui um arquivo chamado myfile.txt, onde seu...
Qual dos comandos abaixo poderia ser utilizado para visualizar os...
Você digitou o comando; "cat MyFile | sort >...
Supondo que você possui 5 arquivos no formato pdf;...
Qual comando irá exibir em ordem inversa o conteúdo do...
Supondo que gostaria de listar os 30 primeiros caracteres do arquivo...
Utilizando o comando od. Como faria para exibir o conteúdo do...
Quais dos comandos abaixo irá ocultar a ocorrência do...
Que comando irá mostrar-lhe os valores definidos pelo arquivo...
Ao executar o comando: sed -i 's/$/;/' teste2.txt
Qual é o nome e o caminho completo do arquivo que contém...
Sobre o comando split. Associe:
Utilizando o comando od. Como faria para exibir o conteúdo do...
Qual comando expand com opção irá substituir apenas as...
Sobre o comando wc. Associe:
Qual dos comandos abaixo irá mostrar-lhe apenas as 10 linhas...
Sobre o comando cp. Associe:
Supondo que você não possua nenhum editor de texto...
Um usuário precisa procurar um arquivo para as linhas que...
Suponha que possuo um arquivo...
Qual parâmetro do comando paste irá unir as linhas de um...
Sobre o comando more. Associe.
Qual o resultado do comando ps ef ?
Qual o comando incorporado ao shell Bash que lista os processos...
Utilizando o comando od. Como faria para exibir o conteúdo do...
Qual comando pode ser executado no shell bash, para evitar...
Sobre o comando cut. Associe.
Quais dos comandos abaixo podem arquivar toda uma estrutura de...
Você deseja definir as suas opções de shell de forma que...
Qual o comando completo, utilizando o touch, irá alterar a data...
Sobre o comando sort. Associe:
Qual comando irá remover todos os arquivos nomeados de...
Sobre o comando fmt. Associe:
Sobre o comando pr. Associe:
Alert!

Advertisement