Linux Fundementals Flashcards

1
Q

When was linux released ?

A

1991

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

To output simple text we use ?

A

Echo

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

To check name of machine we use ?

A

whoami

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

Command to find a file on linux ?

A

find -name file_name
find -name *.format_type

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

What shell operators are there ? And what does each do ?

A
  1. & - run cmd in the background, can also use CTRL + Z for scripts.
  2. && - combine multiple commands
  3. >
    • redirect output
  4. > >
    • redirect output without overwriting
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Commands that we use regularly ?

A

Touch - create file
mkdir - create folder
cp - copy
mv - move
rm - remove
file - determine type

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

How do we check what permissions files in a directory have ?

A

ls -l

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

Switching to another user in linux command ?

A

su username
su -l username

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

What are the 4 common directories ? What do they do ?

A

/etc - stores system files that OS uses, also stores “shadow” and “passwd” which has password storing method in sha512 encryption.
/var - accessed by running apps and services, has /var/log that stores variable data about these apps and services
/root - home directory of the root user
/tmp - like ram, stores data until shudown

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

How to download files from a website ? via what ?

A

wget via HTTP

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

Securely trasnfering files via SSH protocol command ? Syntax for sending and receiving to and from a remote server ?

A

scp - secure copy

scp file_name remote_user_name@remote_ip:path - to send

scp remote_user@remote_ip:path_to_file

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

What command opens a running server via python ?

A

python3 -m http.server - to serve files

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

Command to get from a server after python server deployment ?

A

wget http://machine_ip:port/file_name

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

What are processes, what are they managed by ? How do they identify ?

A

Processes are programs ran on machine, managed by the kernel. They identify by their PID’s, and incremented in order i.e 60th process’s PID = 60

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

How do we check the list of processes ?

A

ps command

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

Command to check which user is running what process and processes that don’t run in that session ?

A

ps aux

17
Q

what does the top command do ?

A

gives real time stats of processes

18
Q

what does ps command do ? what does ps aux command do ?

A

ps command shows the processes ran in the session. ps aux shows users that run them and also processes not ran in the session

19
Q

How do we eliminate a process ?

A

kill “PID”

20
Q

what are other commands like kill what do they do ?

A

sigterm - kill the process but do cleanup beforehand
sigkill - kill without cleanup
sigstop - stop suspend a process

21
Q

What is the method of splitting resources up for specific processes called ? what is it good for and what is it’s specificity ?

A

Method is called namespaces, it is good for security since only the processes assigned the same resource (cpu, ram,etc..) can see each other.

22
Q

What is the first process when booting linux ?

A

systemd

23
Q

how do we communicate with systemd ?

A

systemctl [option] [service]
options : start, stop, enable, disable.

24
Q

What are the two states that processes can run in ? Give an example for both.

A

Foreground and background
If we take command “echo”
echo “hi” -> returns hi
if we do
echo “hi” & -> returns the ID for echo

25
Q

How do you foreground a process ?

A

fg

26
Q

How do we communicate with cron ? what is cron ?

A

crontabs. Cron helps us manage at what time a certain process will be deployed.

27
Q

What values does cron take ?

A

min - what minute to exec at
hour - what hour to exec at
DOM - what day of the month to exec at
MON - what month of the year to exec at
DOW - what day of the week to exec at
CMD - actual command that will be executed

28
Q

What is the syntax of the crontabs ? Helpful syntax ?

A

min hour DOM MON DOW CMD
Useful syntax : “/n” every n’th example : 0 */12 every 12’th hour.

29
Q

how do you edit crontabs ?

A

crontab -e

30
Q

Where do devs submit their software ?

A

to an apt repo