linux Flashcards

1
Q

in Linux

A

don´t leave spaces

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

wiew hiden files

A

ls -la

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

version python # works the sam,e for windows

A

python3 –version
sudo –version

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

ping

A

-ping -c 4 www.google.com => count 4
-ping www.google.com => infinite

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

how to do the TRAZA

A

windows: tracert www.google.com
linux: traceroute www.google.com

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

delete all

A

rm -r *

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

how to delete package

A

sudo apt remove apache2 apache2-utils
sudo apt autoremove

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

why dont open the terminal

A

change the language

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

when the keyboard is not supported

A

configuration => teclado => change language (espanish // peru // latioamerica)

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

whoami

A

who is the user

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

user no esta en el archivo sudoers

A

su | nano /etc/sudoers
root ALL=(ALL:ALL) ALL
yeferson ALL=(ALL:ALL) ALL

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

apt

A

advanced packege tool

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

ufw : ubuntu firewall
sudo ufw enable

A

the firewall is turn on

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

install apache server

A

sudo apt update
sudo apt install apache2
sudo ufw allow ‘Apache’
cd /var/www/html

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

how do i know if i have a package intalled ??

A

which

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

create and open FILE

A

mkdir one && cd one

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

GREP in ALL FILES

A

grep orange *

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

dont show the word #remove the entire line

A

grep -v orangen fruits.txt #delete all line

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

GREP count

A

grep -n orange fruits.txt

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

where the passwords are stored ??
where the sudosers are stored ??

A

/etc/passwd
/etc/sudoers

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

where index.hmlt is stored ??

A

/var/www/html

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

how to replace ONLY a LETTER ?? # the file must exist

A

tr // translate
THE SAME
tr a A > fruits.txt // tr a-z A-Z > fruits.txt #DONT USE
cat fruits.txt | tr a A

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

Replace Word

A

sed ‘s/one/two/g’ fruits.txt
#s= sustitucion #g=global

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

see the amount of memory

A

free # you can see in KBytes

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

count

A

cat fruits.txt | nl

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

reset

A

reboot
sudo shutdown now

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

GENERAR SCRIPT EN UN SERVIDOR
QUE TIPO DE FORMATO ES CUANDO SE DESCARGA a filie of linux

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

diference between: | ||

// do
&& true // true

A

|| => true // not false

=> redirigir la salida de un comando

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

cut -c 1 #character
cut -c 1-3

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

history

A

history 5 # the last five
!! # the last command
!40 # the history number40

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

alias

A

alias one=’ls | nl’
=> one

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

variables

A

windows

linux
eleven=”mole is a small spot on a skin” # don leave spaces

=> echo $skin

twelve=’my aunt doesnt money on anything fun’

=> echo %twelve%

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

variable PATH

A

echo $PATH

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

very important

A

ls -ld directory

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

chmode => change mode

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

example chmode -r

example chmode -w
mkdir penguin
=> drwx yeferson
chmod u-w
=> dr-x yeferson
cd penguin # do only one line xd
touch one
=> NO TE VA DEJAR
=========================================
mkdir penguin
=> drwx yeferson
chmod u-r
=> d-wx yeferson
cd penguin # do only one line xd
ls => NO TE VA DEJAR

=========================================
# example chmode -x
mkdir penguin
=> drwx yeferson
chmod u-x
=> drw- yeferson
cd penguin => NO TE VA DEJAR a the carpet

A
38
Q

chmod hard :)
chmmode ugo-xrw

A
39
Q

mkdir; is the same in linux y windows

A
40
Q

echo {1..10}
mkdir archivo{1..10}

A
41
Q

phisical hardware=> hypervisor => mv

que es un servidor proxy
que es un servidor ssh

yeferson
yeferon123

yefeson100
THEbestisyettocome123!”#

RHEL => RED HAD ENTERPRISE LINUX

A

hypersvisor: creates and run virtual machines

42
Q

telnet

A

sudo apt install telnet
sudo ufw enable
sudo ufw allow 23

43
Q

watch de version LINUX

A

lsb -a

Linux Standard Base

44
Q

in wireshark

A

you can save and open documents

search the line
follow=> http

45
Q

/var/log

A

se almacenan la mayoría de los archivos de registro (logs) generados por el sistema operativo, los servicios y las aplicaciones

46
Q

/var/log/syslog => main files

A

/var/log/syslog => a los más antiguos por syslog.1, syslog.2

47
Q

/var/log => contein FILE LOGS

A
48
Q

journalct <=> /var/log // are a little same

journalct > /var/log

A

JOURNALCTL is tidier than /var/log

49
Q

journalct

A

journalctl
journalctl -k // kernel
journalctl -f // you can view in real time

50
Q

enter => sudo

A

su
sudo -i

51
Q

man => manual

A
52
Q

nmap

A

nmap localhost

nmap -sU // UDP Scan
nmap -A // all // tracert // os

53
Q

ps

A

sudo ps -Al
//A: todo are the same // ps -e
// l: long
// H: forest // identacion
// f: user

//x: como los procesos demonio (daemon) o los procesos en segundo plano.

// sudo ps -elf /the same/ sudo ps -Alf

54
Q

netstat

mas que nada para redes

A

netstat -a : all socket // listen // no listen
-t : TCP
-u: UDP
-n: instead NAME return NUMBER of dns
-p: show de PID
=======================
for windows is diferent
-a : all
-b : shows you the location of the executive

55
Q

diference between : NETSTAT && PS

A

PS: only process, don´t show PORTS
netstat: show process

56
Q

sudo ps -elf | grep 395

A

1 S root 395 1 0 80 0 - 1829 19:33 ? 00:00:00 nginx: master process /usr/bin/nginx

5 S http 396 395 0 80 0 - 1866 19:33 ? 00:00:00 nginx: worker process

0 S analyst 3789 1872 0 80 0 - 1190 19:53 pts/0 00:00:00 grep 395

Ya que grep 395 se utilizó para filtrar la salida ps, cuando se compiló la salida, grep 395 aún se estaba ejecutando y, por lo tanto, apareció en la lista.

57
Q

actualizar

A

en la GUI => Software Updater

58
Q

search precisely # buscarde manera precisa

A

ls -ldf ngi*

l: long
# d: directory
# f: file

59
Q

nano

A

nano -f
# f: continues showing what is written

60
Q

journalctl

A

shows you the entire record (record => registro)
space => next pages

###############
jounalctl -b: last boot

61
Q

exec => 2 comanndas at the same time

A

mkdir one && cd one

62
Q
A

ls -li
i => identificador de los archivos

63
Q

ln : links

A

ls one two => phiscins link

don’t allow directories
both change
when they are eliminated they continue to stay

 ls -li => should the same

=====================

ls -s one two => simbolick link

allow directories
both change
when they are eliminated they DONT continue to stay

64
Q

lsblk: listblock

A

show:
las particiones => the disks

65
Q

mount

A

archivos montados

mount #only work
mount | grep sd*

66
Q

/dev

A

acess to the hardware

/dev/sda1 => primer disco duro conectado

67
Q

Después del montaje,/home/analyst/second_drive se convierte en el punto de entrada alsistema de archivos que está físicamente almacenado en /dev/sdb1.

montar

what is ??

A

mkdir second_drive

sudo mount /dev/sdb1 ~/second_drive/

===============================
ahora si imprime

[analyst@secOps ~]$ mount | grep /dev/sd

/dev/sda1 on / type ext4 (rw,relatime)

/dev/sdb1 on /home/analyst/second_drive type ext4 (rw,relatime)

68
Q

sudo chmod 665 myFile.txt

A
69
Q

chown
se utiliza para cambiar la titularidad de un archivo o directorio

A
70
Q

Los directorios son diferentes de los archivos con el bit de ejecución definido (un archivo con el bit de ejecución definido es un script o programa ejecutable).

A
71
Q

Archivos de bloques (b)
=> para acceder a hardware físico como puntos de montaje para acceder a discos duros

Archivos de dispositivos de caracteres (c)

A

ls -l /dev/

crw-rw—- 1 root audio 253, 0 May 23 06:41 rtc0

brw-rw—- 1 root disk 8, 0 May 23 06:41 sda

72
Q

dpkg -l

Debian Package Manager
-l=> list

A
73
Q

wha

A

sudo apt install chkrootkit
sudo chkrootkit
sudo chkrootkit | grep -i worm

  • worm: gusano
74
Q

folder of the process

A

ls -l /proc

75
Q

lynis

A

sudo lynis –auditor cisco

76
Q

change password

A

sudo passwd Eric

77
Q

/etc/passwd
contains user account information but not passwords.

/etc/shadow
securely stores encrypted user passwords
(almacena las contraseñas cifradas de los usuarios de manera segura)

A
78
Q

how to login a other account

A

$ su Bob => password for Bob
$ sudo su Bob => password for Root

79
Q

pluma

A

text edit && replace

80
Q

echo -n

A

the line break doesn’t matter (\n)

81
Q

md5

A

in terminal

ftp hq.corp

ftp>dir
ftp> get NEclients.txt

dir # verify

echo -n ‘file-contenido’ | md5sum

82
Q

HMAC (Hash-based Message Authentication Code)

A

you give a password in this case: cisco123

OpenSSL dgst -sha256 -hmac cisco123 ingreso.txt

83
Q

HMAC > md5sum

A

Para producir un hash específico necesita el mensaje original y una clave secreta.

84
Q

to save information in the FTP server

A

ftp> put NEclients.txt

85
Q

library for cryptografia

A

OpenSSL

86
Q
A
87
Q
A
88
Q
A
89
Q
A
90
Q
A
91
Q
A
92
Q
A