diff --git a/README.md b/README.md index 43a95cd..06d4ae0 100644 --- a/README.md +++ b/README.md @@ -2159,6 +2159,8 @@ mv command.
What are hidden files/directories? How to list them?
+ +`ls -a`
@@ -2169,7 +2171,7 @@ Most likely the default/generated $PATH was somehow modified or overridden thus This issue could also happen if bash_profile or any configuration file of your interpreter was wrongly modified, causing erratics behaviours. You would solve this by fixing your $PATH variable: -As to fix it there are serveral options: +As to fix it there are several options: 1. Manually adding what you need to your $PATH PATH="$PATH":/user/bin:/..etc 2. You have your weird env variables backed up. @@ -2194,7 +2196,6 @@ With cron, tasks are scheduled using the following format: The tasks are stored in a cron file, you can write in it using crontab -e Alternatively if you are using a distro with systemd it's recommended to use systemd timers. -
@@ -2470,7 +2471,7 @@ Each number has different meaning, based on how the application was developed. I consider this as a good blog post to read more about it: https://shapeshed.com/unix-exit-codes
-##### Linux - Storage & Filesystem +##### Linux Disk & Filesystem
What's an inode?
@@ -2542,6 +2543,8 @@ There are many answers for this question. One way is running `df -T`
How would you check what is the size of a certain directory?
+ +`du -sh`
@@ -2611,7 +2614,45 @@ There are many answers for this question. One way is running `df -T` False. /tmp is cleared upon system boot while /var/tmp is cleared every a couple of days or not cleared at all (depends on distro).
-#### Processes +#### Linux Performance Analysis + +
+How to check what is the current load average?
+ +One can use `uptime` or `top` +
+ +
+You know how to see the load average, great. but what each part of it means? for example 1.43, 2.34, 2.78
+ +[This article](http://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html) summarizes the load average topic in a great way +
+ +
+How to check process usage?
+ +pidstat +
+ +
+How to check disk I/O?
+ +`iostat -xz 1` +
+ +
+How to check how much free memory a system has? How to check memory consumption by each process?
+ +You can use the commands top and free +
+ +
+How to check TCP stats?
+ +sar -n TCP,ETCP 1 +
+ +#### Linux Processes
How to run a process in the background and why to do that in the first place?
@@ -2735,12 +2776,6 @@ If you mention at any point ps command with arugments, be familiar with what the find /some_dir -iname \*.yml -print0 | xargs -0 -r sed -i "s/1/2/g"
-
-How to check how much free memory a system has? How to check memory consumption by each process?
- -You can use the commands top and free -
-
You run ls and you get "/lib/ld-linux-armhf.so.3 no such file or directory". What is the problem?
@@ -3260,6 +3295,12 @@ These system calls are reading the file /my/file and 5 is the file What is the difference between a process and a thread?
+
+What is context switch?
+ +From [wikipedia](https://en.wikipedia.org/wiki/Context_switch): a context switch is the process of storing the state of a process or thread, so that it can be restored and resume execution at a later point +
+
You found there is a server with high CPU load but you didn't find a process with high CPU. How is that possible?
@@ -3310,7 +3351,7 @@ This is a good article about the topic: https://ops.tips/blog/how-linux-creates- You executed a script and while still running, it got accidentally removed. Is it possible to restore the script while it's still running?
-#### Memory +#### Linux Memory
What is the difference between MemFree and MemAvailable in /proc/meminfo?
@@ -3319,6 +3360,18 @@ MemFree - The amount of unused physical RAM in your system MemAvailable - The amount of available memory for new workloads (without pushing system to use swap) based on MemFree, Active(file), Inactive(file), and SReclaimable.
+
+What is virtual memory?
+
+ +
+What is the difference between paging and swapping?
+
+ +
+Explain what is OOM killer
+
+ #### Distribution
@@ -3843,6 +3896,12 @@ HCL stands for Hashicorp Configuration Language. It is the language Hashicorp ma It keeps track of the IDs of created resources so that Terraform knows what it is managing.
+
+How do you rename an existing resource?
+ +terraform state mv +
+
Explain what the following commands do: @@ -5027,6 +5086,10 @@ some_list[:3] ```
+
+How to insert an item to the beginning of a list? What about two items?
+
+
How to sort list by the length of items?