Modulo 3 - Tools of the Trade: Linux and SQL Flashcards

1
Q

Qual o comando que permite realizar o calculo de expressões aritméticas no bash shell ?

A

O comando expr (arg1) + (arg2)
Separado por espaços e pode realizar soma, subtração, divisão e multiplicação

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Qual é o tipo de shell padrão utlizado pelo Linux ?

A

Bourne-Again Shell (bash)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Por que o KALI LINUX é tão utilizado na área de cybersergurança ?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Como funciona o packet manager ?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Para o que serve o FHS (Filesystem Hierarchy Standard) ?

A

The FHS is important because it defines how directories, directory contents, and other storage is organized in the operating system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The FHS is a hierarchical system, and just like with a tree, everything grows and branches out from the root

A

The FHS is important because it defines how directories, directory contents, and other storage is organized in the operating system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Oque o comando ls -l faz ?

A

Mostra as seguintes caracteristicas:
Se é um diretorio (d) ou um arquivo (-)
E quais são as perimissões de 3 em 3 do usuario, grupo e outros
Podendo ser Read(r), Write (w) e Execute (x)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Oque o comando ls -a faz ?

A

Mostra arquivos e pastas que estão como hidden

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Oque o comando chmod u-w,g=r,o+r faz ?

A

Modifica as atuais permissoes para as seguintes
user perde a permissao de escrever
grupo pode apenas ler agora
other ganhou a permissao de leitura

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Como utilizar o comando grep ?

A

grep (string a ser buscada) (arquivo)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

oque faz o comando touch ? touch texto.txt

A

touch permite que arquivos sejam criados. Nesse caso, cria um arquivo texto.txt na pasta atual

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Quais são os seis tipos de comandos que podem criar ou modificar arquivos e pastas

A
  1. The mkdir command creates a new directory
  2. rmdir removes or deletes a directory
  3. The touch command creates a new file,
  4. rm command removes or deletes a file
  5. mv command moves a file or directory to new location
  6. cp copies a file or directory into a new location.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Comando pwd

A

Mostra o diretório atual

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

oque faz o nano blocodetexto.txt ?

A

abre o arquivo blocodetexto.txt em um editor de texto que permite edição

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Write a SQL query to retrieve records for employees who are not in the ‘Information Technology’ department.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Write a SQL query to retrieve records for employees in the ‘Finance’ or the ‘Sales’ department. on the employees table

A

select * from employees where department = “Sales” or department = “ Finance”;

15
Q

Write a SQL query to retrieve this information from the employees table. Select all columns and include filters on the department and office columns to return only the needed records. On the employees table

A

select * from employees where department = ‘Marketing’ and office like ‘East-%’;

16
Q

O que o comando select * from employees where not department = ‘Information Technology’; faz ?

A

Mostra todas as colunas da tabela employees pois está com select *
e mostra todos os usuarios fora do departamento de TI

17
Q

mysql> SELECT username, office, OS
FROM employees
INNER JOIN machines ON employees.employee_id = machines.employee_id;

A

Caso os dados em employees.employee_id e machines.employee_id
forem iguais, as colunas de machines e de employees serao anexadas

18
Q

Descreva oque esse codigo: SELECT * FROM machines INNER JOIN employees ON machines.device_id = employees.device_id; da como output baseado nas tabelas employees e machines

19
Q

SELECT *
FROM (tabela_1)
(type_of_join) JOIN (tabela_2) ON tabela_1.(coluna) = tabela_2.(coluna);

20
Q

ORDER BY (coluna) ASC/DESC

A

organiza a coluna desejada na ordem desejada

21
Q

Se voce quiser deixar um grupo, usuario ou outro com apenas as permissões do input do chmod, desconsiderando as permissões antes de usar comando

A

Deve usar
chmod u=r -> ficaria apenas com read
chmod g=rw ->
chmod o=x