You've already forked devops-exercises
Add Terraform and Linux questions and exercises
Also updated the script that counts questions to actually update the number in README.md
This commit is contained in:
@@ -2,46 +2,69 @@
|
||||
|
||||
## Linux Master Application
|
||||
|
||||
A completely free application for testing your knowledge on Linux
|
||||
A completely free application for testing your knowledge on Linux.
|
||||
Desclaimer: developed by repository owner
|
||||
|
||||
<a href="https://play.google.com/store/apps/details?id=com.codingshell.linuxmaster"><img src="images/linux_master.jpeg"/></a>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.codingshell.linuxmaster"><img src="../../images/linux_master.jpeg"/></a>
|
||||
|
||||
## Linux Self Assessment
|
||||
- [Linux](#linux)
|
||||
- [Linux Master Application](#linux-master-application)
|
||||
- [Linux Exercises](#linux-exercises)
|
||||
- [Basics](#basics)
|
||||
- [Misc](#misc)
|
||||
- [Linux Questions](#linux-questions)
|
||||
- [Linux 101](#linux-101)
|
||||
- [I/O Redirection](#io-redirection)
|
||||
- [Filesystem Hierarchy Standard](#filesystem-hierarchy-standard)
|
||||
- [Permissions](#permissions)
|
||||
- [Scenarios](#scenarios)
|
||||
- [Systemd](#systemd)
|
||||
- [Troubleshooting and Debugging](#troubleshooting-and-debugging)
|
||||
- [Scenarios](#scenarios-1)
|
||||
- [Kernel](#kernel)
|
||||
- [SSH](#ssh)
|
||||
- [Globbing & Wildcards](#globbing--wildcards)
|
||||
- [Boot Process](#boot-process)
|
||||
- [Disk and Filesystem](#disk-and-filesystem)
|
||||
- [Performance Analysis](#performance-analysis)
|
||||
- [Processes](#processes)
|
||||
- [Security](#security)
|
||||
- [Networking](#networking)
|
||||
- [DNS](#dns)
|
||||
- [Packaging](#packaging)
|
||||
- [DNF](#dnf)
|
||||
- [Applications and Services](#applications-and-services)
|
||||
- [Users and Groups](#users-and-groups)
|
||||
- [Hardware](#hardware)
|
||||
- [Namespaces](#namespaces)
|
||||
- [Virtualization](#virtualization)
|
||||
- [AWK](#awk)
|
||||
- [System Calls](#system-calls)
|
||||
- [Filesystem & Files](#filesystem--files)
|
||||
- [Advanced Networking](#advanced-networking)
|
||||
- [Memory](#memory)
|
||||
- [Distributions](#distributions)
|
||||
- [Sed](#sed)
|
||||
- [Misc](#misc-1)
|
||||
|
||||
* [Linux 101](#questions-linux-101)
|
||||
* [Linux I/O Redirection](#questions-linux-redirection)
|
||||
* [Linux Filesystem Hierarchy Standard](#questions-linux-fhs)
|
||||
* [Linux Permissions](#questions-linux-permissions)
|
||||
* [Linux Scenarios](#questions-linux-scenarios)
|
||||
* [Linux Systemd](#questions-linux-systemd)
|
||||
* [Linux Troubleshooting and Debugging](#questions-linux-troubleshooting)
|
||||
* [Linux kernel](#questions-linux-kernel)
|
||||
* [Linux SSH](#questions-linux-ssh)
|
||||
* [Linux Globbing and Wildcards](#questions-linux-wildcards)
|
||||
* [Linux Boot Process](#questions-linux-boot)
|
||||
* [Linux Disk and Filesystem](#questions-linux-disk-fs)
|
||||
* [Linux Performance Analysis](#questions-linux-performance-analysis)
|
||||
* [Linux Processes](#questions-linux-processes)
|
||||
* [Linux Security](#questions-linux-security)
|
||||
* [Linux Networking](#questions-linux-networking)
|
||||
* [Linux DNS](#questions-linux-dns)
|
||||
* [Linux Packaging](#questions-linux-packaging)
|
||||
* [Linux DNF](#questions-linux-dnf)
|
||||
* [Linux Applications and Services](#questions-linux-apps-and-services)
|
||||
* [Linux Users and Groups](#questions-linux-users-and-groups)
|
||||
* [Linux Hardware](#questions-linux-hardware)
|
||||
* [Linux Namepsaces](#questions-linux-namespaces)
|
||||
* [Linux Virtualization](#questions-linux-virtualization)
|
||||
* [Linux AWK](#questions-linux-awk)
|
||||
* [Linux System Calls](#questions-linux-system-calls)
|
||||
* [Linux Filesystem and Files](#questions-linux-fs-files)
|
||||
* [Linux Advanced Networking](#questions-linux-advanced-networking)
|
||||
* [Linux Memory](#questions-linux-memory)
|
||||
* [Linux Distributions](#questions-linux-distributions)
|
||||
* [Linux Sed](#questions-linux-sed)
|
||||
* [Linux Misc](#questions-linux-misc)
|
||||
## Linux Exercises
|
||||
|
||||
### Basics
|
||||
|
||||
|Name|Topic|Objective & Instructions|Solution|Comments|
|
||||
|--------|--------|------|----|----|
|
||||
| Navigation | cd, pwd | [Exercise](exercises/navigation/README.md) | [Solution](exercises/navigation/solution.md)
|
||||
| Create and Destroy | touch, rm, mkdir | [Exercise](exercises/create_remove/README.md) | [Solution](exercises/create_remove/solution.md)
|
||||
| Copy Time | touch, cp, ls | [Exercise](exercises/copy/README.md) | [Solution](exercises/copy/solution.md)
|
||||
|
||||
### Misc
|
||||
|
||||
|Name|Topic|Objective & Instructions|Solution|Comments|
|
||||
|--------|--------|------|----|----|
|
||||
| Unique Count | | [Exercise](exercises/uniqe_count/README.md) | [Solution](exercises/uniqe_count/solution.md)
|
||||
|
||||
## Linux Questions
|
||||
|
||||
<a name="questions-linux-101"></a>
|
||||
### Linux 101
|
||||
|
||||
<details>
|
||||
@@ -50,6 +73,7 @@ A completely free application for testing your knowledge on Linux
|
||||
[Wikipedia](https://en.wikipedia.org/wiki/Linux): "Linux is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged in a Linux distribution."
|
||||
|
||||
[Red Hat](https://www.redhat.com/en/topics/linux/what-is-linux): "Linux® is an open source operating system (OS). An operating system is the software that directly manages a system’s hardware and resources, like CPU, memory, and storage. The OS sits between applications and hardware and makes the connections between all of your software and the physical resources that do the work."
|
||||
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
@@ -479,8 +503,7 @@ To stop a service: `systemctl stop <service name>`
|
||||
<summary>Describe how to make a certain process/app a service</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
<a name="questions-linux-troubleshooting"></a>
|
||||
### Troubleshooting & Debugging
|
||||
### Troubleshooting and Debugging
|
||||
|
||||
<details>
|
||||
<summary>Where system logs are located?</summary><br><b>
|
||||
@@ -551,7 +574,16 @@ tail -f <file_name>
|
||||
<summary>How you measure time execution of a program?</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
<a name="questions-linux-kernel"></a>
|
||||
#### Scenarios
|
||||
|
||||
<details>
|
||||
<summary>You have a process writing to a file. You don't know which process exactly, you just know the path of the file. You would like to kill the process as it's no longer needed. How would you achieve it?</summary><br><b>
|
||||
|
||||
1. Run `lsof <FILE_PATH>`
|
||||
2. Use the pid (process ID) from the lsof command and run `kill <PID>`
|
||||
|
||||
</b></details>
|
||||
|
||||
### Kernel
|
||||
|
||||
<details>
|
||||
|
||||
15
topics/linux/exercises/copy/README.md
Normal file
15
topics/linux/exercises/copy/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Copy Time
|
||||
|
||||
## Objectives
|
||||
|
||||
1. Create an empty file called `x` in `/tmp`
|
||||
2. Copy the `x` file you created to your home directory
|
||||
3. Create a copy of `x` file called `y`
|
||||
4. Create a directory called `files` and move `x` and `y` there
|
||||
5. Copy the directory "files" and name the copy `copy_of_files`
|
||||
6. Rename `copy_of_files` directory to `files2`
|
||||
7. Remove `files` and `files2` directories
|
||||
|
||||
## Solution
|
||||
|
||||
Click [here](solution.md) to view the solution.
|
||||
25
topics/linux/exercises/copy/solution.md
Normal file
25
topics/linux/exercises/copy/solution.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Copy Time
|
||||
|
||||
## Objectives
|
||||
|
||||
1. Create an empty file called `x` in `/tmp`
|
||||
2. Copy the `x` file you created to your home directory
|
||||
3. Create a copy of `x` file called `y`
|
||||
4. Create a directory called `files` and move `x` and `y` there
|
||||
5. Copy the directory "files" and name the copy `copy_of_files`
|
||||
6. Rename `copy_of_files` directory to `files2`
|
||||
7. Remove `files` and `files2` directories
|
||||
|
||||
## Solution
|
||||
|
||||
```
|
||||
touch /tmp/x
|
||||
cp x ~/
|
||||
cp x y
|
||||
mkdir files
|
||||
cp x files
|
||||
cp y files
|
||||
cp -r files copy_of_files
|
||||
mv copy_of_files files2
|
||||
rm -rf files files2
|
||||
```
|
||||
14
topics/linux/exercises/create_remove/README.md
Normal file
14
topics/linux/exercises/create_remove/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Create & Destroy
|
||||
|
||||
## Objectives
|
||||
|
||||
1. Create a file called `x`
|
||||
2. Create a directory called `content`
|
||||
3. Move `x` file to the `content` directory
|
||||
4. Create a file insidethe `content` directory called `y`
|
||||
5. Create the following directory structure in `content` directory: `dir1/dir2/dir3`
|
||||
6. Remove the content directory
|
||||
|
||||
## Solution
|
||||
|
||||
Click [here](solution.md) to view the solution.
|
||||
21
topics/linux/exercises/create_remove/solution.md
Normal file
21
topics/linux/exercises/create_remove/solution.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Create & Destroy
|
||||
|
||||
## Objectives
|
||||
|
||||
1. Create a file called `x`
|
||||
2. Create a directory called `content`
|
||||
3. Move `x` file to the `content` directory
|
||||
4. Create a file insidethe `content` directory called `y`
|
||||
5. Create the following directory structure in `content` directory: `dir1/dir2/dir3`
|
||||
6. Remove the content directory
|
||||
|
||||
## Solution
|
||||
|
||||
```
|
||||
touch x
|
||||
mkdir content
|
||||
mv x content
|
||||
touch content/y
|
||||
mkdir -p content/dir1/dir2/dir3
|
||||
rm -rf content
|
||||
```
|
||||
19
topics/linux/exercises/navigation/README.md
Normal file
19
topics/linux/exercises/navigation/README.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Navigation
|
||||
|
||||
## Requirements
|
||||
|
||||
1. Linux :)
|
||||
|
||||
## Objectives
|
||||
|
||||
1. Change directory to `/tmp`
|
||||
2. Move to parent directory
|
||||
3. Change directory to home directory
|
||||
4. Move to parent directory
|
||||
5. Move again to parent directory
|
||||
1. Where are you at? Verify with a command
|
||||
6. Change to last visited directory
|
||||
|
||||
## Solution
|
||||
|
||||
Click [here](solution.md) to view the solution
|
||||
28
topics/linux/exercises/navigation/solution.md
Normal file
28
topics/linux/exercises/navigation/solution.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# Navigation
|
||||
|
||||
## Requirements
|
||||
|
||||
1. Linux :)
|
||||
|
||||
## Objectives
|
||||
|
||||
1. Change directory to `/tmp`
|
||||
2. Move to parent directory
|
||||
3. Change directory to home directory
|
||||
4. Move to parent directory
|
||||
5. Move again to parent directory
|
||||
1. Where are you at? Verify with a command
|
||||
6. Change to last visited directory
|
||||
|
||||
## Solution
|
||||
|
||||
```
|
||||
cd /tmp
|
||||
cd ..
|
||||
cd ~
|
||||
cd ..
|
||||
cd ..
|
||||
# root (/)
|
||||
pwd
|
||||
cd -
|
||||
```
|
||||
9
topics/linux/exercises/uniqe_count/README.md
Normal file
9
topics/linux/exercises/uniqe_count/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Unique Count
|
||||
|
||||
## Objectives
|
||||
|
||||
In this directory you have a file with list of IP addresses called `ip_list`. Using the file, determine which IP address is the most recurring (listed the most times).
|
||||
|
||||
# Solution
|
||||
|
||||
Click [here](solution.md) to view the solution
|
||||
115
topics/linux/exercises/uniqe_count/ip_list
Normal file
115
topics/linux/exercises/uniqe_count/ip_list
Normal file
@@ -0,0 +1,115 @@
|
||||
88.249.123.246 GET 200
|
||||
204.14.121.43 GET 200
|
||||
49.11.110.6 GET 200
|
||||
137.126.109.160 GET 200
|
||||
107.13.168.5 GET 200
|
||||
232.136.91.101 GET 404
|
||||
43.140.194.174 GET 200
|
||||
137.126.109.160 GET 200
|
||||
63.219.2.31 GET 200
|
||||
17.86.6.109 GET 200
|
||||
119.89.134.53 GET 404
|
||||
137.126.109.160 GET 200
|
||||
204.14.121.43 GET 200
|
||||
238.183.3.55 GET 200
|
||||
254.62.231.49 GET 200
|
||||
250.1.145.213 POST 200
|
||||
17.86.6.109 GET 404
|
||||
119.89.134.53 POST 200
|
||||
88.249.123.246 GET 200
|
||||
49.11.110.61 GET 200
|
||||
107.13.168.5 GET 504
|
||||
232.136.91.101 GET 200
|
||||
137.126.109.160 POST 200
|
||||
63.219.2.31 GET 200
|
||||
17.86.6.109 GET 200
|
||||
119.89.134.53 GET 504
|
||||
17.86.6.109 GET 200
|
||||
197.1.166.141 GET 200
|
||||
17.86.6.109 GET 200
|
||||
87.21.188.245 GET 504
|
||||
235.230.62.243 GET 200
|
||||
246.3.48.149 GET 200
|
||||
194.131.205.190 GET 504
|
||||
222.129.41.212 POST 200
|
||||
224.57.91.248 GET 504
|
||||
238.183.3.55 GET 200
|
||||
137.126.109.160 GET 504
|
||||
254.62.231.49 POST 200
|
||||
250.1.145.213 GET 504
|
||||
185.80.235.15 GET 200
|
||||
137.126.109.160 GET 200
|
||||
63.219.2.31 GET 504
|
||||
17.86.6.109 GET 200
|
||||
119.89.134.53 POST 200
|
||||
63.219.2.31 GET 504
|
||||
17.86.6.109 GET 200
|
||||
119.89.134.53 GET 504
|
||||
88.249.123.246 GET 200
|
||||
238.183.3.55 POST 200
|
||||
224.57.91.248 GET 504
|
||||
238.183.3.55 POST 200
|
||||
254.62.231.49 GET 200
|
||||
254.62.231.49 POST 404
|
||||
250.1.145.213 GET 200
|
||||
221.169.255.179 GET 200
|
||||
220.35.213.247 GET 200
|
||||
67.89.94.133 GET 200
|
||||
77.192.163.242 POST 200
|
||||
204.14.121.43 GET 200
|
||||
22.244.145.46 GET 200
|
||||
89.127.55.7 GET 200
|
||||
137.126.109.160 GET 200
|
||||
88.249.123.246 POST 200
|
||||
238.183.3.55 GET 200
|
||||
254.62.231.49 GET 200
|
||||
250.1.145.213 GET 200
|
||||
137.126.109.160 POST 200
|
||||
221.169.255.179 GET 200
|
||||
232.136.91.101 GET 200
|
||||
197.1.166.141 GET 200
|
||||
87.21.188.245 GET 200
|
||||
235.230.62.243 GET 200
|
||||
246.3.48.149 GET 200
|
||||
194.131.205.190 GET 200
|
||||
222.129.41.212 GET 200
|
||||
137.126.109.160 GET 200
|
||||
224.57.91.248 GET 200
|
||||
185.80.235.15 GET 200
|
||||
137.126.109.160 GET 200
|
||||
63.219.2.31 GET 200
|
||||
17.86.6.109 GET 200
|
||||
119.89.134.53 GET 200
|
||||
88.249.123.246 GET 200
|
||||
238.183.3.55 GET 200
|
||||
254.62.231.49 GET 200
|
||||
250.1.145.213 GET 200
|
||||
63.219.2.31 GET 200
|
||||
17.86.6.109 GET 200
|
||||
119.89.134.53 POST 200
|
||||
88.249.123.246 GET 200
|
||||
137.126.109.160 POST 200
|
||||
238.183.3.55 GET 200
|
||||
254.62.231.49 POST 200
|
||||
250.1.145.213 GET 200
|
||||
137.126.109.160 POST 200
|
||||
63.219.2.31 GET 200
|
||||
17.86.6.109 GET 404
|
||||
107.13.168.5 POST 200
|
||||
232.136.91.101 GET 200
|
||||
137.126.109.160 POST 200
|
||||
63.219.2.31 GET 200
|
||||
17.86.6.109 GET 200
|
||||
197.1.166.141 GET 200
|
||||
87.21.188.245 POST 200
|
||||
235.230.62.243 POST 200
|
||||
246.3.48.149 GET 200
|
||||
194.131.205.190 GET 200
|
||||
224.57.91.248 GET 200
|
||||
238.183.3.55 POST 200
|
||||
254.62.231.49 GET 200
|
||||
88.249.123.246 GET 200
|
||||
49.11.110.61 GET 200
|
||||
107.13.168.5 POST 200
|
||||
232.136.91.101 GET 200
|
||||
204.14.121.43 POST 200
|
||||
9
topics/linux/exercises/uniqe_count/solution.md
Normal file
9
topics/linux/exercises/uniqe_count/solution.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Unique Count
|
||||
|
||||
## Objectives
|
||||
|
||||
In this directory you have a file with list of IP addresses called `ip_list`. Using the file, determine which IP address is the most recurring (listed the most times).
|
||||
|
||||
# Solution
|
||||
|
||||
`sort ip_list | cut -d' ' -f1 | uniq -c | sort -n | tail -1`
|
||||
Reference in New Issue
Block a user