Merge pull request #48 from surister/new_linux_answers

New linux answers
This commit is contained in:
Arie Bregman 2019-11-29 14:01:22 +02:00 committed by GitHub
commit 4ecd287244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -800,7 +800,22 @@ TCP establishes a connection between the client and the server to guarantee the
<details> <details>
<summary>Running the command <code>df</code> you get "command not found". What could be wrong and how to fix it?</summary><br><b> <summary>Running the command <code>df</code> you get "command not found". What could be wrong and how to fix it?</summary><br><b>
</b></details> </b>
<p><b>
Most likely the default/generated $PATH was somehow modified or overridden thus not containing <code>/bin/</code> where df would normally go.
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:
1. Manually adding what you need to your $PATH <code>PATH="$PATH":/user/bin:/..etc</code>
2. You have your weird env variables backed up.
3. You would look for your distro default $PATH variable, copy paste using method #1
Note: There are many ways of getting errors like this: if bash_profile or any configuration file of your interpreter was wrongly modified; causing erratics behaviours,
permissions issues, bad compiled software (if you compiled it by yourself)... there is no answer that will be true 100% of the time.</b>
</p>
</details>
<details> <details>
<summary>How to make sure a service will start on a OS of your choice?</summary><br><b> <summary>How to make sure a service will start on a OS of your choice?</summary><br><b>
@ -816,8 +831,7 @@ With cron, tasks are scheduled using the following format:
<minute> <hour> <day of month> <month> <day of week> <command to execute> <minute> <hour> <day of month> <month> <day of week> <command to execute>
The tasks are stored in a cron file. The tasks are stored in a cron file, you can write in it using <code>crontab -e</code>
Alternatively if you are using a distro with systemd it's recommended to use systemd timers. Alternatively if you are using a distro with systemd it's recommended to use systemd timers.
@ -828,6 +842,8 @@ Alternatively if you are using a distro with systemd it's recommended to use sys
Normally you will schedule batch jobs. Normally you will schedule batch jobs.
</b></details> </b></details>
##### Permissions ##### Permissions
@ -1034,8 +1050,13 @@ Soft links can be created between different file systems while hard link can be
<summary>Fix the following commands: <summary>Fix the following commands:
* sed "s/1/2/g' /tmp/myFile * sed "s/1/2/g' /tmp/myFile
* find . -iname \*.yaml -exec sed -i "s/1/2/g" {} ;</summary><br><b> * find . -iname \*.yaml -exec sed -i "s/1/2/g" {} ;
</b></details>
</summary><br><b>
</b>
<code>sed 's/1/2/g' /tmp/myFile</code><br>
<code> find . -iname "*.yaml" -exec sed -i "s/1/2/g" {} \; </code>
</details>
<details> <details>
<summary>Explain what is stored in each of the following paths and if there is anything unique about it:</summary><br><b> <summary>Explain what is stored in each of the following paths and if there is anything unique about it:</summary><br><b>
@ -1067,10 +1088,11 @@ execution or run forever
<details> <details>
<summary>What signal is used when you run 'kill <process id>'?</summary><br><b> <summary>What signal is used when you run 'kill <process id>'?</summary><br><b>
<pre>
The default signal is SIGTERM (15). This signal kills The default signal is SIGTERM (15). This signal kills
process gracefully which means it allows it to save current process gracefully which means it allows it to save current
state configuration. state configuration.
</pre>
</b></details> </b></details>
<details> <details>
@ -1097,12 +1119,13 @@ To view all available signals run `kill -l`
<details> <details>
<summary>What are the possible states of a process in Linux?</summary><br><b> <summary>What are the possible states of a process in Linux?</summary><br><b>
<pre>
Running Running
Waiting Waiting
Stopped Stopped
Terminated Terminated
Zombie Zombie
</pre>
</b></details> </b></details>
<details> <details>