<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.itcollege.ee/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pkuulme</id>
	<title>ICO wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.itcollege.ee/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pkuulme"/>
	<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php/Special:Contributions/Pkuulme"/>
	<updated>2026-06-16T03:30:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122578</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122578"/>
		<updated>2017-05-18T20:48:02Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 3. Managing software(installation, removing, dependencies) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
[https://wiki.itcollege.ee/index.php/Osadmin_spikker &#039;&#039;&#039;OSadmin spikker&#039;&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a file by redirecting information to a file using &#039;&#039; &amp;gt; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; | echo &amp;quot;This is some text&amp;quot; &amp;gt; textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; containing text &amp;quot;This is some text&amp;quot; is created.&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -type f -name &amp;quot;*.log&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039;&amp;lt;permissions&amp;gt; &amp;lt;file or directory&amp;gt; &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
Permissions can be changed on multiple files and folders simultaneously. To do that, just separate the files or folders with a space.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; will belong to group &#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This can also be done using &#039;&#039;&#039;chown :&amp;lt;group&amp;gt; &amp;lt;file/directory&amp;gt;&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown :students folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; will belong to group &#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;addgroup students &amp;amp;&amp;amp; adduser --ingroup students fedor &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |addgroup students &amp;amp;&amp;amp; adduser --ingroup students fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; sudo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor sudo &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L  &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is recomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt-get update  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt update &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039; and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. GB, MB)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;sudo apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;sudo apt-get dist-upgrade&#039;&#039;&#039; or &#039;&#039;&#039; sudo apt full-upgrade  &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;~/.bash_aliases&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano ~/.bash_aliases&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installfile.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command &#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; exits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- Selecting the first sector of a partition: Accept value given by default or change value manually.&lt;br /&gt;
&lt;br /&gt;
- Selecting the last sector or the size of the partition: When choosing the size, the &#039;&#039;&#039;+&#039;&#039;&#039; sign must be used before the value. &#039;&#039;&#039;eg:+1GB&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowsay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122577</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122577"/>
		<updated>2017-05-18T20:38:17Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 2. MANAGING USERS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
[https://wiki.itcollege.ee/index.php/Osadmin_spikker &#039;&#039;&#039;OSadmin spikker&#039;&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a file by redirecting information to a file using &#039;&#039; &amp;gt; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; | echo &amp;quot;This is some text&amp;quot; &amp;gt; textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; containing text &amp;quot;This is some text&amp;quot; is created.&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -type f -name &amp;quot;*.log&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039;&amp;lt;permissions&amp;gt; &amp;lt;file or directory&amp;gt; &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
Permissions can be changed on multiple files and folders simultaneously. To do that, just separate the files or folders with a space.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; will belong to group &#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This can also be done using &#039;&#039;&#039;chown :&amp;lt;group&amp;gt; &amp;lt;file/directory&amp;gt;&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown :students folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; will belong to group &#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;addgroup students &amp;amp;&amp;amp; adduser --ingroup students fedor &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |addgroup students &amp;amp;&amp;amp; adduser --ingroup students fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; sudo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor sudo &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L  &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is recomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt-get update  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt update &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039; and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. GB, MB)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;sudo apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;sudo apt-get dist-upgrade&#039;&#039;&#039; or &#039;&#039;&#039; sudo apt full-upgrade  &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installfile.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command &#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; exits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- Selecting the first sector of a partition: Accept value given by default or change value manually.&lt;br /&gt;
&lt;br /&gt;
- Selecting the last sector or the size of the partition: When choosing the size, the &#039;&#039;&#039;+&#039;&#039;&#039; sign must be used before the value. &#039;&#039;&#039;eg:+1GB&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowsay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122576</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122576"/>
		<updated>2017-05-18T20:37:10Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 4. Disk partitions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
[https://wiki.itcollege.ee/index.php/Osadmin_spikker &#039;&#039;&#039;OSadmin spikker&#039;&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a file by redirecting information to a file using &#039;&#039; &amp;gt; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; | echo &amp;quot;This is some text&amp;quot; &amp;gt; textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; containing text &amp;quot;This is some text&amp;quot; is created.&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -type f -name &amp;quot;*.log&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039;&amp;lt;permissions&amp;gt; &amp;lt;file or directory&amp;gt; &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
Permissions can be changed on multiple files and folders simultaneously. To do that, just separate the files or folders with a space.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; will belong to group &#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This can also be done using &#039;&#039;&#039;chown :&amp;lt;group&amp;gt; &amp;lt;file/directory&amp;gt;&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown :students folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; will belong to group &#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;addgroup students &amp;amp;&amp;amp; adduser --ingroup students fedor &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; sudo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor sudo &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L  &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is recomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt-get update  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt update &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039; and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. GB, MB)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;sudo apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;sudo apt-get dist-upgrade&#039;&#039;&#039; or &#039;&#039;&#039; sudo apt full-upgrade  &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installfile.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command &#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; exits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- Selecting the first sector of a partition: Accept value given by default or change value manually.&lt;br /&gt;
&lt;br /&gt;
- Selecting the last sector or the size of the partition: When choosing the size, the &#039;&#039;&#039;+&#039;&#039;&#039; sign must be used before the value. &#039;&#039;&#039;eg:+1GB&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowsay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122573</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122573"/>
		<updated>2017-05-18T18:05:18Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 3. Managing software(installation, removing, dependencies) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
[https://wiki.itcollege.ee/index.php/Osadmin_spikker &#039;&#039;&#039;OSadmin spikker&#039;&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a file by redirecting information to a file using &#039;&#039; &amp;gt; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; | echo &amp;quot;This is some text&amp;quot; &amp;gt; textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; containing text &amp;quot;This is some text&amp;quot; is created.&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -type f -name &amp;quot;*.log&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039;&amp;lt;permissions&amp;gt; &amp;lt;file or directory&amp;gt; &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
Permissions can be changed on multiple files and folders simultaneously. To do that, just separate the files or folders with a space.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; will belong to group &#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This can also be done using &#039;&#039;&#039;chown :&amp;lt;group&amp;gt; &amp;lt;file/directory&amp;gt;&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown :students folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; will belong to group &#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;addgroup students &amp;amp;&amp;amp; adduser --ingroup students fedor &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; sudo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor sudo &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L  &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is recomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt-get update  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt update &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039; and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. GB, MB)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;sudo apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;sudo apt-get dist-upgrade&#039;&#039;&#039; or &#039;&#039;&#039; sudo apt full-upgrade  &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installfile.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command &#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowsay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122572</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122572"/>
		<updated>2017-05-18T18:03:28Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 2. MANAGING USERS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
[https://wiki.itcollege.ee/index.php/Osadmin_spikker &#039;&#039;&#039;OSadmin spikker&#039;&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a file by redirecting information to a file using &#039;&#039; &amp;gt; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; | echo &amp;quot;This is some text&amp;quot; &amp;gt; textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; containing text &amp;quot;This is some text&amp;quot; is created.&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -type f -name &amp;quot;*.log&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039;&amp;lt;permissions&amp;gt; &amp;lt;file or directory&amp;gt; &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
Permissions can be changed on multiple files and folders simultaneously. To do that, just separate the files or folders with a space.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; will belong to group &#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This can also be done using &#039;&#039;&#039;chown :&amp;lt;group&amp;gt; &amp;lt;file/directory&amp;gt;&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown :students folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; will belong to group &#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;addgroup students &amp;amp;&amp;amp; adduser --ingroup students fedor &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; sudo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor sudo &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L  &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is recomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt-get update  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt update &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039; and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. GB, MB)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installfile.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command &#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowsay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122571</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122571"/>
		<updated>2017-05-18T17:59:11Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 1. WORKING WITH FILES */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
[https://wiki.itcollege.ee/index.php/Osadmin_spikker &#039;&#039;&#039;OSadmin spikker&#039;&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a file by redirecting information to a file using &#039;&#039; &amp;gt; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; | echo &amp;quot;This is some text&amp;quot; &amp;gt; textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; containing text &amp;quot;This is some text&amp;quot; is created.&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -type f -name &amp;quot;*.log&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039;&amp;lt;permissions&amp;gt; &amp;lt;file or directory&amp;gt; &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
Permissions can be changed on multiple files and folders simultaneously. To do that, just separate the files or folders with a space.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; will belong to group &#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This can also be done using &#039;&#039;&#039;chown :&amp;lt;group&amp;gt; &amp;lt;file/directory&amp;gt;&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown :students folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; will belong to group &#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L -e &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is recomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt-get update  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt update &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039; and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. GB, MB)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installfile.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command &#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowsay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122570</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122570"/>
		<updated>2017-05-18T17:30:30Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* Author of the Estonian version */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
[https://wiki.itcollege.ee/index.php/Osadmin_spikker &#039;&#039;&#039;OSadmin spikker&#039;&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L -e &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is recomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt-get update  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt update &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039; and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. GB, MB)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installfile.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command &#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowsay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122569</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122569"/>
		<updated>2017-05-18T17:30:13Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* Author of the Estonian version */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&#039;&#039;&#039;[[https://wiki.itcollege.ee/index.php/Osadmin_spikker|OSadmin Spikker]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[https://wiki.itcollege.ee/index.php/Osadmin_spikker &#039;&#039;&#039;OSadmin spikker&#039;&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L -e &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is recomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt-get update  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt update &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039; and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. GB, MB)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installfile.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command &#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowsay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122568</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122568"/>
		<updated>2017-05-18T17:24:43Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 6. WORKING WITH PROCESSES */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L -e &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is recomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt-get update  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt update &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039; and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. GB, MB)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installfile.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command &#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowsay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122567</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122567"/>
		<updated>2017-05-18T17:24:05Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 4. Disk partitions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L -e &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is recomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt-get update  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt update &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039; and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. GB, MB)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installfile.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command &#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowssay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122566</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=122566"/>
		<updated>2017-05-18T17:22:36Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 3. Managing software(installation, removing, dependencies) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L -e &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is recomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt-get update  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |sudo apt update &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039; and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. GB, MB)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installfile.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command&#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowssay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_wiki_article&amp;diff=122565</id>
		<title>OSadmin wiki article</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_wiki_article&amp;diff=122565"/>
		<updated>2017-05-18T15:50:58Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* Chosen topics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Intro=&lt;br /&gt;
*Choose a topic from personal experience related with the subject or from topics found on the wiki page&lt;br /&gt;
*[[#Chosen_topics|Write the topic here]].&lt;br /&gt;
*Lecturer will confirm the topic&lt;br /&gt;
*Write your article in wiki environment &lt;br /&gt;
*Inform the [[Operating_systems#Lecturer|lecturer]] when the article is finished&lt;br /&gt;
*Receive feedback for corrections&lt;br /&gt;
&lt;br /&gt;
=Requirements for the wiki article=&lt;br /&gt;
Author: name, group and date when the article is written&lt;br /&gt;
&lt;br /&gt;
==Introduction ==&lt;br /&gt;
Covers points what will be discussed in the article, what are the requirements for the article reader; what are the operating system’s requirements. &lt;br /&gt;
&lt;br /&gt;
==Contents==&lt;br /&gt;
All commands should be easily separable from the overall text. &lt;br /&gt;
Users should be able to copy the commands directly (additional info like prompt and user distinction symbols should be left out from the command description area)&lt;br /&gt;
The text should determine what user permissions are needed to perform these tasks. &lt;br /&gt;
The reader of your article is your fellow students, so try to avoid irrelevant information and stay on topic (don’t explain the meaning of IP address or how to install Ubuntu, when your topic is actually about htop)&lt;br /&gt;
All the content should be referenced. &lt;br /&gt;
Do not use slang and try to be grammatically correct.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt; &lt;br /&gt;
Bear in mind that this is an open environment, so everything you write in your wiki article, will be public. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Referencing==&lt;br /&gt;
Best practises of wiki referencing should be used. &lt;br /&gt;
Terms are but between square brackets to reference other articles in the system.&lt;br /&gt;
All drawing and images have to be referenced below the picture and in the text. (for example “System architecture can be viewed on image x, y and z.”)&lt;br /&gt;
Author’s own ideas have to be clearly presentable. Everything used from the sources have to be referenced. &lt;br /&gt;
&lt;br /&gt;
==Fellow student review==&lt;br /&gt;
Please find a fellow student who will review your article and give a feedback on the discussion tab of the article using [http://enos.itcollege.ee/~edmund/materials/viki-artikkel/Assessment-model-for-the-wiki-article.html the following assessment model].&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Besides a short overview, what was discussed in this article, it should also include the author&#039;s own opinion about the topic. &lt;br /&gt;
&lt;br /&gt;
==Category==&lt;br /&gt;
Add the following category to the end of the article (last row):&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Chosen topics==&lt;br /&gt;
Please write here your topic and name, group:&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/Fedora_os &#039;&#039;&#039;Fedora OS&#039;&#039;&#039;]; Anamul Hoque Shihab; CSE-11&lt;br /&gt;
* &#039;&#039;&#039;Basic Automation with Python&#039;&#039;&#039;; Ardi Vaba; CSE-11&lt;br /&gt;
* [https://wiki.itcollege.ee/index.php/SSH_Encryption &#039;&#039;&#039;SSH Encryption&#039;&#039;&#039;], Frank Korving, CSE-11&lt;br /&gt;
* [https://wiki.itcollege.ee/index.php/OSadmin_help &#039;&#039;&#039;Translation of OSadmin wiki help page to English&#039;&#039;&#039;]; Peep Kuulme; CSE-11&lt;br /&gt;
* [https://wiki.itcollege.ee/index.php/Cross-Site_Scripting_(XSS)_attacks &#039;&#039;&#039;Cross-Site Scripting&#039;&#039;&#039;]; Masaki Ihara; CSE-11&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/Auditd &#039;&#039;&#039;Auditd - Linux system monitoring with audit daemon&#039;&#039;&#039;], Nika Ptskialadze, CSE-11&lt;br /&gt;
* &#039;&#039;&#039;GNU Privacy Guard (GnuPG)&#039;&#039;&#039;; Patricia Bruno Barbosa; CSE-11&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/BackBox_OS &#039;&#039;&#039;BackBox OS&#039;&#039;&#039;]; Ats Tootsi; CSE-11&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/Apparmor_and_its_usage &#039;&#039;&#039;Apparmor and its usage&#039;&#039;&#039;], Mikus, CSE-11&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/Arch_linux &#039;&#039;&#039;Arch Linux&#039;&#039;&#039;];Farhan Nayeem Islam;CSE-C11&lt;br /&gt;
* &#039;&#039;&#039;&#039;VPN (English version)&#039;&#039;&#039;&#039;, Christian Cataldo, CSE-C11; [https://wiki.itcollege.ee/index.php/VPN_(English_version)]&lt;br /&gt;
* &#039;&#039;Translation of DDoS Wiki page[[https://wiki.itcollege.ee/index.php/DDoS_Eng]]&#039;&#039;&#039;; Andris Männik; CSE-11&lt;br /&gt;
*&#039;&#039;&#039;Translation of Ps Wiki page[[https://wiki.itcollege.ee/index.php/Ps_Eng]]&#039;&#039;&#039;&#039;&#039;; Christopher Carr; CSE-11&lt;br /&gt;
*&#039;&#039;&#039;Translation of Bash_Shell wiki page[[https://wiki.itcollege.ee/index.php/BASH_shell_en]]&#039;&#039;&#039;; Steven Rugam; CSE-11&lt;br /&gt;
*[[https://wiki.itcollege.ee/index.php/SED_eng &#039;&#039;SED_Stream Editor&#039;&#039;]; Gabriel Adoyi; CSE-11&lt;br /&gt;
*&#039;&#039;&#039;Pass: The Standard Unix Password Manager&#039;&#039;&#039;[[https://wiki.itcollege.ee/index.php/Pass]]; Oliver Rahula; CSE-11&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/Rsync_eng &#039;&#039;Rsync&#039;&#039;]; Eriks Ocakovskis; C11&lt;br /&gt;
* &#039;&#039;&#039;Translation of Hotspot[https://wiki.itcollege.ee/index.php/hotspot]&#039;&#039;&#039;; [https://wiki.itcollege.ee/index.php/Setting_up_hotspot &#039;&#039;Setting up Hotspot&#039;&#039;] Sander Valgo C11&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/Sshutel &#039;&#039;&#039;Sshuttle&#039;&#039;&#039;], Kirill Trunov, CSE-11&lt;br /&gt;
&lt;br /&gt;
==Ideas==&lt;br /&gt;
&lt;br /&gt;
* UNIX CLI password manager https://www.passwordstore.org and its GUI http://qtpass.org/&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
* [https://wiki.itcollege.ee/index.php/Osadmin_referaadi_teemad counterpart article in Estonian]&lt;br /&gt;
* http://manpage.io&lt;br /&gt;
* https://linuxjourney.com/&lt;br /&gt;
* [https://linux.die.net/man/ Linux man-pages]&lt;br /&gt;
* [https://linux.die.net Linux docs]&lt;br /&gt;
* http://www.tecmint.com/60-commands-of-linux-a-guide-from-newbies-to-system-administrator/&lt;br /&gt;
* http://www.tecmint.com/useful-linux-commands-for-system-administrators/&lt;br /&gt;
* http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html&lt;br /&gt;
* http://www.thegeekstuff.com/2010/12/50-unix-linux-sysadmin-tutorials&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_wiki_article&amp;diff=122564</id>
		<title>OSadmin wiki article</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_wiki_article&amp;diff=122564"/>
		<updated>2017-05-18T15:49:56Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* Chosen topics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Intro=&lt;br /&gt;
*Choose a topic from personal experience related with the subject or from topics found on the wiki page&lt;br /&gt;
*[[#Chosen_topics|Write the topic here]].&lt;br /&gt;
*Lecturer will confirm the topic&lt;br /&gt;
*Write your article in wiki environment &lt;br /&gt;
*Inform the [[Operating_systems#Lecturer|lecturer]] when the article is finished&lt;br /&gt;
*Receive feedback for corrections&lt;br /&gt;
&lt;br /&gt;
=Requirements for the wiki article=&lt;br /&gt;
Author: name, group and date when the article is written&lt;br /&gt;
&lt;br /&gt;
==Introduction ==&lt;br /&gt;
Covers points what will be discussed in the article, what are the requirements for the article reader; what are the operating system’s requirements. &lt;br /&gt;
&lt;br /&gt;
==Contents==&lt;br /&gt;
All commands should be easily separable from the overall text. &lt;br /&gt;
Users should be able to copy the commands directly (additional info like prompt and user distinction symbols should be left out from the command description area)&lt;br /&gt;
The text should determine what user permissions are needed to perform these tasks. &lt;br /&gt;
The reader of your article is your fellow students, so try to avoid irrelevant information and stay on topic (don’t explain the meaning of IP address or how to install Ubuntu, when your topic is actually about htop)&lt;br /&gt;
All the content should be referenced. &lt;br /&gt;
Do not use slang and try to be grammatically correct.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt; &lt;br /&gt;
Bear in mind that this is an open environment, so everything you write in your wiki article, will be public. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Referencing==&lt;br /&gt;
Best practises of wiki referencing should be used. &lt;br /&gt;
Terms are but between square brackets to reference other articles in the system.&lt;br /&gt;
All drawing and images have to be referenced below the picture and in the text. (for example “System architecture can be viewed on image x, y and z.”)&lt;br /&gt;
Author’s own ideas have to be clearly presentable. Everything used from the sources have to be referenced. &lt;br /&gt;
&lt;br /&gt;
==Fellow student review==&lt;br /&gt;
Please find a fellow student who will review your article and give a feedback on the discussion tab of the article using [http://enos.itcollege.ee/~edmund/materials/viki-artikkel/Assessment-model-for-the-wiki-article.html the following assessment model].&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Besides a short overview, what was discussed in this article, it should also include the author&#039;s own opinion about the topic. &lt;br /&gt;
&lt;br /&gt;
==Category==&lt;br /&gt;
Add the following category to the end of the article (last row):&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Chosen topics==&lt;br /&gt;
Please write here your topic and name, group:&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/Fedora_os &#039;&#039;&#039;Fedora OS&#039;&#039;&#039;]; Anamul Hoque Shihab; CSE-11&lt;br /&gt;
* &#039;&#039;&#039;Basic Automation with Python&#039;&#039;&#039;; Ardi Vaba; CSE-11&lt;br /&gt;
* [https://wiki.itcollege.ee/index.php/SSH_Encryption &#039;&#039;&#039;SSH Encryption&#039;&#039;&#039;], Frank Korving, CSE-11&lt;br /&gt;
* &#039;&#039;&#039;Translation of OSadmin wiki help page to English&#039;&#039;&#039; [https://wiki.itcollege.ee/index.php/OSadmin_help]; Peep Kuulme; CSE-11&lt;br /&gt;
* [https://wiki.itcollege.ee/index.php/Cross-Site_Scripting_(XSS)_attacks &#039;&#039;&#039;Cross-Site Scripting&#039;&#039;&#039;]; Masaki Ihara; CSE-11&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/Auditd &#039;&#039;&#039;Auditd - Linux system monitoring with audit daemon&#039;&#039;&#039;], Nika Ptskialadze, CSE-11&lt;br /&gt;
* &#039;&#039;&#039;GNU Privacy Guard (GnuPG)&#039;&#039;&#039;; Patricia Bruno Barbosa; CSE-11&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/BackBox_OS &#039;&#039;&#039;BackBox OS&#039;&#039;&#039;]; Ats Tootsi; CSE-11&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/Apparmor_and_its_usage &#039;&#039;&#039;Apparmor and its usage&#039;&#039;&#039;], Mikus, CSE-11&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/Arch_linux &#039;&#039;&#039;Arch Linux&#039;&#039;&#039;];Farhan Nayeem Islam;CSE-C11&lt;br /&gt;
* &#039;&#039;&#039;&#039;VPN (English version)&#039;&#039;&#039;&#039;, Christian Cataldo, CSE-C11; [https://wiki.itcollege.ee/index.php/VPN_(English_version)]&lt;br /&gt;
* &#039;&#039;Translation of DDoS Wiki page[[https://wiki.itcollege.ee/index.php/DDoS_Eng]]&#039;&#039;&#039;; Andris Männik; CSE-11&lt;br /&gt;
*&#039;&#039;&#039;Translation of Ps Wiki page[[https://wiki.itcollege.ee/index.php/Ps_Eng]]&#039;&#039;&#039;&#039;&#039;; Christopher Carr; CSE-11&lt;br /&gt;
*&#039;&#039;&#039;Translation of Bash_Shell wiki page[[https://wiki.itcollege.ee/index.php/BASH_shell_en]]&#039;&#039;&#039;; Steven Rugam; CSE-11&lt;br /&gt;
*[[https://wiki.itcollege.ee/index.php/SED_eng &#039;&#039;SED_Stream Editor&#039;&#039;]; Gabriel Adoyi; CSE-11&lt;br /&gt;
*&#039;&#039;&#039;Pass: The Standard Unix Password Manager&#039;&#039;&#039;[[https://wiki.itcollege.ee/index.php/Pass]]; Oliver Rahula; CSE-11&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/Rsync_eng &#039;&#039;Rsync&#039;&#039;]; Eriks Ocakovskis; C11&lt;br /&gt;
* &#039;&#039;&#039;Translation of Hotspot[https://wiki.itcollege.ee/index.php/hotspot]&#039;&#039;&#039;; [https://wiki.itcollege.ee/index.php/Setting_up_hotspot &#039;&#039;Setting up Hotspot&#039;&#039;] Sander Valgo C11&lt;br /&gt;
*[https://wiki.itcollege.ee/index.php/Sshutel &#039;&#039;&#039;Sshuttle&#039;&#039;&#039;], Kirill Trunov, CSE-11&lt;br /&gt;
&lt;br /&gt;
==Ideas==&lt;br /&gt;
&lt;br /&gt;
* UNIX CLI password manager https://www.passwordstore.org and its GUI http://qtpass.org/&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
* [https://wiki.itcollege.ee/index.php/Osadmin_referaadi_teemad counterpart article in Estonian]&lt;br /&gt;
* http://manpage.io&lt;br /&gt;
* https://linuxjourney.com/&lt;br /&gt;
* [https://linux.die.net/man/ Linux man-pages]&lt;br /&gt;
* [https://linux.die.net Linux docs]&lt;br /&gt;
* http://www.tecmint.com/60-commands-of-linux-a-guide-from-newbies-to-system-administrator/&lt;br /&gt;
* http://www.tecmint.com/useful-linux-commands-for-system-administrators/&lt;br /&gt;
* http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html&lt;br /&gt;
* http://www.thegeekstuff.com/2010/12/50-unix-linux-sysadmin-tutorials&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=120017</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=120017"/>
		<updated>2017-04-11T12:43:32Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 3. Managing software(installation, removing, dependencies) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L -e &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is reccomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039;and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. Gb, Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installfile.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command&#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowssay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=120016</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=120016"/>
		<updated>2017-04-11T12:43:12Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 2. MANAGING USERS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L -e &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is reccomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039;and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. Gb, Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command&#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowssay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119985</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119985"/>
		<updated>2017-04-09T09:33:00Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 4. Disk partitions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is reccomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039;and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. Gb, Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command&#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command &#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowssay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119984</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119984"/>
		<updated>2017-04-09T09:27:59Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 2. MANAGING USERS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount:  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is reccomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039;and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. Gb, Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command&#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command&#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowssay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119983</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119983"/>
		<updated>2017-04-09T09:25:30Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 1. WORKING WITH FILES */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all of its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with of its content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;old&#039;&#039; and all of its content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolder &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the end of the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; location criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB within &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by &#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group and its permissions&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Give &#039;&#039;students&#039;&#039; group permission to write into &#039;&#039;sometextfile.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
First you need to change the group of &#039;&#039;textfile.txt&#039;&#039; and then change the group permissions.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students textfile.txt&lt;br /&gt;
chmod g+w textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;textfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;textfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is reccomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039;and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. Gb, Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command&#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command&#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowssay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119982</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119982"/>
		<updated>2017-04-09T09:07:34Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 1. WORKING WITH FILES */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory&#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with it&#039;s content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;Directory &#039;&#039;old&#039;&#039; and all of it&#039;s content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolger &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the endof the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; locatin criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB withing &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by&#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| Fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Grupi ja selle õiguste muutmine&lt;br /&gt;
&amp;lt;u&amp;gt;Näide&amp;lt;/u&amp;gt;: Anda grupile audio2 faili &#039;&#039;kirjutis.txt&#039;&#039; kirjutamise õigus.&lt;br /&gt;
&lt;br /&gt;
Esiteks tuleb muuta faili &#039;&#039;kirjutis.txt&#039;&#039; grupp, seejärel muuta grupi õigused (lisada sellesse faili kirjutamise õigus).&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp audio2 kirjutis.txt&lt;br /&gt;
chmod g+w kirjutis.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;sometextfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;sometextfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is reccomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039;and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. Gb, Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command&#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command&#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowssay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119981</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119981"/>
		<updated>2017-04-09T09:06:51Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* 1. WORKING WITH FILES */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
Linux/Unix considers directories as files aswell, which is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory&#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with it&#039;s content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;Directory &#039;&#039;old&#039;&#039; and all of it&#039;s content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolger &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the endof the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; locatin criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB withing &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by&#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| Fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Grupi ja selle õiguste muutmine&lt;br /&gt;
&amp;lt;u&amp;gt;Näide&amp;lt;/u&amp;gt;: Anda grupile audio2 faili &#039;&#039;kirjutis.txt&#039;&#039; kirjutamise õigus.&lt;br /&gt;
&lt;br /&gt;
Esiteks tuleb muuta faili &#039;&#039;kirjutis.txt&#039;&#039; grupp, seejärel muuta grupi õigused (lisada sellesse faili kirjutamise õigus).&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp audio2 kirjutis.txt&lt;br /&gt;
chmod g+w kirjutis.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;sometextfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;sometextfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is reccomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039;and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. Gb, Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command&#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command&#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowssay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119980</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119980"/>
		<updated>2017-04-09T09:05:00Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /*  OSADMIN HELP  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
inux/Unix considers directories as files aswell, witch is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory&#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with it&#039;s content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;Directory &#039;&#039;old&#039;&#039; and all of it&#039;s content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolger &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the endof the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; locatin criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB withing &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by&#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| Fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Grupi ja selle õiguste muutmine&lt;br /&gt;
&amp;lt;u&amp;gt;Näide&amp;lt;/u&amp;gt;: Anda grupile audio2 faili &#039;&#039;kirjutis.txt&#039;&#039; kirjutamise õigus.&lt;br /&gt;
&lt;br /&gt;
Esiteks tuleb muuta faili &#039;&#039;kirjutis.txt&#039;&#039; grupp, seejärel muuta grupi õigused (lisada sellesse faili kirjutamise õigus).&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp audio2 kirjutis.txt&lt;br /&gt;
chmod g+w kirjutis.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;sometextfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;sometextfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is reccomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039;and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. Gb, Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command&#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command&#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowssay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119970</id>
		<title>OSadmin help</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_help&amp;diff=119970"/>
		<updated>2017-04-08T09:31:55Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: Created page with &amp;quot;== &amp;#039;&amp;#039;&amp;#039; OSADMIN HELP(V2.0) &amp;#039;&amp;#039;&amp;#039; == &amp;lt;!--Purpose of this help page--&amp;gt;  {|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;  |This help page is a tool that can be used in...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039; OSADMIN HELP(V2.0) &#039;&#039;&#039; ==&lt;br /&gt;
&amp;lt;!--Purpose of this help page--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|- style=&amp;quot;padding:10px 10px 10px 10px; text-align:justify;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|This help page is a tool that can be used in the IT College course &amp;quot;Operating systems&amp;quot; practical exam. The page is suitable for those who did not have any experience regarding Linux/Unix server administrating before this course. The help page gives an overview of the main commands pirorly used in the practical labs of this course. However this pages does not claim to contain all the commands required in the practical exam. The purpose of this help page is to help students find the correct commands faster and understand them through practice. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Author ==&lt;br /&gt;
&lt;br /&gt;
Translated from Estonian by Peep Kuulme&lt;br /&gt;
&lt;br /&gt;
== Author of the Estonian version==&lt;br /&gt;
Kristiina Kaarna&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. WORKING WITH FILES  ==&lt;br /&gt;
inux/Unix considers directories as files aswell, witch is why i will handle working with directories alongside with other files.&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.1. Creating&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Creating a file: &#039;&#039;&#039; touch &#039;&#039; file &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A file named &#039;&#039;textfile.txt&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |touch folder1/textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A file named &#039;&#039;textfile.txt&#039;&#039; is created to the directory named folder1 that is located in the home directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a directory: &#039;&#039;&#039; mkdir &#039;&#039;directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;  A directory named &#039;&#039;folder1&#039;&#039; is created to the current working directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a subdirectory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir folder1/sub1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; A subdirectory named &#039;&#039;sub1&#039;&#039; is created inside directory &#039;&#039;folder1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Creating a nested directory&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir -p folder1/sub1/sub2/sub3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;Inside &#039;&#039;folder1&#039;&#039; is created a directory named &#039;&#039;folder2&#039;&#039; witch contains &#039;&#039;folder3&#039;&#039; witch contains &#039;&#039;folder4&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.2. Deleting&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Deleting a file:  &#039;&#039;&#039; rm &#039;&#039; fail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting a directory: &#039;&#039;&#039; rm -r &#039;&#039; directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Option&#039;&#039;&#039; -r &#039;&#039;&#039; means that the directory will be deleted with all its content.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r folder1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named &#039;&#039;folder1&#039;&#039; and all its content will be deleted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Deleting the contents of a directory without deleting the directory itself: &#039;&#039;&#039; rm -r *&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
NB! User needs to be located inside the folder.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |rm -r *&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;The contents of the current directory will be deleted, the directory will remain.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.3. Moving and renaming &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Moving a file: &#039;&#039;&#039; mv &#039;&#039; filename destination &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File named &#039;&#039;textfile.txt&#039;&#039; is moved to a directory named &#039;&#039;folder1&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to another directory: &#039;&#039;&#039; mv &#039;&#039;directory_name destination&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The contents of the directory being moved will move to the new directory.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory named&#039;&#039; folder1&#039;&#039; is being moved inside &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Moving a directory to a subdirectory&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv folder1 folder2/sub2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Directory&#039;&#039; folder1&#039;&#039; will be moved to  &#039;&#039; sub2&#039;&#039; witch is a subdirectory of &#039;&#039; folder2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Renaming a file or a directory: &#039;&#039;&#039; mv &#039;&#039;OLD_name NEW_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mv textfile.txt story.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;File &#039;&#039;textfile.txt&#039;&#039; will be renamed to &#039;&#039;story.txt&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.4. Copying&amp;lt;/u&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
* Copying a file: &#039;&#039;&#039; cp &#039;&#039; filename NEW_filename&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; File&#039;&#039;old&#039;&#039; will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Copying a folder with it&#039;s content: &#039;&#039;&#039; cp &#039;&#039; &#039;&#039; -r&#039;&#039; filename NEW_filename&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cp -r old new&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt;Directory &#039;&#039;old&#039;&#039; and all of it&#039;s content will be copied to file &#039;&#039; new&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.5. Navigation between directories &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Navigating to home directory: &#039;&#039;&#039; cd &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; User will navigate to &#039;&#039;home&#039;&#039; directory. Administrator will navigate to &#039;&#039;root&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Navigating one level up: &#039;&#039;&#039; cd .. &#039;&#039;&#039;&lt;br /&gt;
* Navigating two levels up: &#039;&#039;&#039; cd ../.. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to last visited directory: &#039;&#039;&#039; cd -&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Navigating to subfolger &#039;&#039;/var/log&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |cd /var/log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt;1.6. Viewing&amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Viewing the contents of a directory: &#039;&#039;&#039;ls -l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* viewing the contents of a file: &#039;&#039;&#039; less &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example: Use &#039;&#039;&#039;less&#039;&#039;&#039; command to open file &#039;&#039;messages&#039;&#039; located in &#039;&#039;/var/log/&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |less /var/log/messages &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
** Useful commands for navigating inside a file opend with &#039;&#039;&#039;less&#039;&#039;&#039; command:&lt;br /&gt;
{|- style=&amp;quot;padding:0px 0px 0px 50px;&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Navigating down: &#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating up: &#039;&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the beginning of the file: &#039;&#039;&#039;g&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Navigating to the endof the file: &#039;&#039;&#039;G&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Help: &#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exit file and &#039;&#039;less&#039;&#039;-command: &#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;u&amp;gt; 1.7.Searching&amp;lt;/u&amp;gt; ====&lt;br /&gt;
* Searching for a file by some criteria: &#039;&#039;&#039;find &#039;&#039; locatin criteria    what&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /etc -name &amp;quot;*.log&amp;quot; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;etc&#039;&#039; will be scanned for all files with the extension &#039;&#039;.log&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |find /var/log -size 1M&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching for all files with size 1MB withing &#039;&#039;var&#039;&#039; subdirectory &#039;&#039;log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Viewing a file by&#039;&#039;&#039;CONTENT&#039;&#039;&#039;: &#039;&#039;&#039;grep &#039;&#039;WHAT WHERE&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |grep sda /var/log -i -R&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Searching recursively for expression &#039;&#039;sda&#039;&#039; from &#039;&#039;/var/log&#039;&#039; regardless if the expression has capital or small letters.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.8. File permissions &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
When &#039;&#039;ls -l&#039;&#039; command is entered, the following information will be displayed:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:1000px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| d/-  &lt;br /&gt;
| rwx   &lt;br /&gt;
| rw- &lt;br /&gt;
| r-- &lt;br /&gt;
| Fedor&lt;br /&gt;
| students&lt;br /&gt;
| 2007-02-01 16:00 &lt;br /&gt;
| textfile.txt&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; object type &lt;br /&gt;
|&#039;&#039;&#039; user permissions&lt;br /&gt;
|&#039;&#039;&#039; group permissions &lt;br /&gt;
|&#039;&#039;&#039; other permissions&lt;br /&gt;
|&#039;&#039;&#039; user &lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; date modified&lt;br /&gt;
|&#039;&#039;&#039; name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For object type &#039;&#039;&#039;d&#039;&#039;&#039; stands for directory and &#039;&#039;&#039;-&#039;&#039;&#039; stands for file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Permission types:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:530px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| r  &lt;br /&gt;
| w   &lt;br /&gt;
| x &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; file: read permission;&lt;br /&gt;
&#039;&#039;&#039;directory: &#039;&#039;ls -l&#039;&#039; use permission&lt;br /&gt;
|&#039;&#039;&#039; write permission&lt;br /&gt;
|&#039;&#039;&#039; file: execute permission; &lt;br /&gt;
&#039;&#039;&#039;directory: permission to enter directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Permission groups:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:2px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;a  &lt;br /&gt;
| &#039;&#039;&#039;u   &lt;br /&gt;
| &#039;&#039;&#039;g &lt;br /&gt;
| &#039;&#039;&#039;o&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039; all&lt;br /&gt;
|&#039;&#039;&#039; user&lt;br /&gt;
|&#039;&#039;&#039; group&lt;br /&gt;
|&#039;&#039;&#039; others&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder permissions: &#039;&#039;&#039; chmod   &#039;&#039; WHO  permission file &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chmod a-x,g+w,o-w textfile.txt&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Execute permission revoked from all, write permission given to group and write permission revoked from others.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;u&amp;gt; 1.9. Changing file ownership and group &amp;lt;/u&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Changing file or folder owner: &#039;&#039;&#039; chown &#039;&#039; NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory &#039;&#039;folder1&#039;&#039; ownership will be set to &#039;&#039;Fedor&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the owner of a folder and all of its contents: &#039;&#039;&#039;chown -R &#039;&#039;NEW_owner folder_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown -R fedor folder1 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; and all of it&#039;s content&#039;s ownership will be transferred to Fedor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing the group of a file or folder: &#039;&#039;&#039; chgrp &#039;&#039; NEW_group directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp students folder1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Directory&#039;&#039;folder1&#039;&#039; will belong to group&#039;&#039;students&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Grupi ja selle õiguste muutmine&lt;br /&gt;
&amp;lt;u&amp;gt;Näide&amp;lt;/u&amp;gt;: Anda grupile audio2 faili &#039;&#039;kirjutis.txt&#039;&#039; kirjutamise õigus.&lt;br /&gt;
&lt;br /&gt;
Esiteks tuleb muuta faili &#039;&#039;kirjutis.txt&#039;&#039; grupp, seejärel muuta grupi õigused (lisada sellesse faili kirjutamise õigus).&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chgrp audio2 kirjutis.txt&lt;br /&gt;
chmod g+w kirjutis.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Changing owner and group with one command&lt;br /&gt;
&amp;lt;u&amp;gt;Example&amp;lt;/u&amp;gt;: Assign &#039;&#039;Fedor&#039;&#039; as the owner of &#039;&#039;sometextfile.txt&#039;&#039; and &#039;&#039;student&#039;&#039; as the group.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |chown fedor:student textfile.txt &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; &#039;&#039;Fedor&#039;&#039; is the new owner of &#039;&#039;sometextfile.txt&#039;&#039; and the file belongs to &#039;&#039;student&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
== 2. MANAGING USERS  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a new user: &#039;&#039;&#039;adduser &#039;&#039;username group&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New user &#039;&#039;Fedor&#039;&#039; will be created and he belongs to &#039;&#039;students&#039;&#039; group&lt;br /&gt;
&lt;br /&gt;
* Granting  administrator privileges: &#039;&#039;&#039;adduser &#039;&#039;username&#039;&#039; admin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |adduser fedor admin &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; will be granted &#039;&#039;administrator&#039;&#039; permissions.&lt;br /&gt;
&lt;br /&gt;
* Creating a group: &#039;&#039;&#039;groupadd &#039;&#039;students&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |groupadd students&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; New group &#039;&#039;students&#039;&#039; will be created.&lt;br /&gt;
&lt;br /&gt;
* Locking a useraccount: &#039;&#039;&#039;usermod -L &#039;&#039;username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -L fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be locked.&lt;br /&gt;
&lt;br /&gt;
* Unlocking a useraccount  &#039;&#039;&#039; usermod -U &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -U fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Useraccount &#039;&#039;fedor&#039;&#039; will be unlocked.&lt;br /&gt;
&lt;br /&gt;
* Changing a username: &#039;&#039;&#039;usermod -l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -l student fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;Username &#039;&#039;fedor&#039;&#039; will be changed to &#039;&#039;student&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Changing user home directory and username: &#039;&#039;&#039;usermod –d &#039;&#039;home_directory&#039;&#039; –m –l &#039;&#039;NEW_username OLD_username&#039;&#039; &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod –d /home/students –m –l student professor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;professor&#039;&#039; will be changed to user &#039;&#039;student&#039;&#039; using option &#039;&#039;&#039;-l&#039;&#039;&#039;. New user &#039;&#039;student&#039;&#039; home directory will become &#039;&#039;students&#039;&#039; using option &#039;&#039;&#039;-d&#039;&#039;&#039; . All files will be moved to the new home directory using option &#039;&#039;&#039;-m&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Deleting a user: &#039;&#039;&#039;userdel &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |userdel fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; User &#039;&#039;Fedor&#039;&#039; Will be deleted.&lt;br /&gt;
&lt;br /&gt;
* Changing your account password when logged in: &#039;&#039;&#039;passwd&#039;&#039;&#039;&lt;br /&gt;
Then enter your current password  and then a new password twice.&lt;br /&gt;
&lt;br /&gt;
* Changing another user password(only with root permission): &#039;&#039;&#039;passwd &#039;&#039;Username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
Then enter the password twice and a new password will be set to user &amp;quot;Fedor&amp;quot;..&lt;br /&gt;
&lt;br /&gt;
* Changing user shell value: &#039;&#039;&#039;usermod -s /bin/shell_value &#039;&#039;username&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |usermod -s /bin/false fedor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;User &#039;&#039;Fedor&#039;&#039; can no longer login with ssh. Access to commandline disabled when logged in. To restore, replace /bin/false with /bin/bash/ or another original shell&lt;br /&gt;
&lt;br /&gt;
* Finding information about local groups and users: &#039;&#039;&#039;getent group&#039;&#039;&#039;, &#039;&#039;&#039;getent passwd &#039;&#039;&#039; or with more details&#039;&#039;&#039;getent passwd username&#039;&#039;&#039;&lt;br /&gt;
Command &#039;&#039;getent&#039;&#039; displays the information about the user in the system database.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent passwd fedor&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Output for user Fedor &lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fedor:x:1000:1000:Fedor,,,:/home/fedor:/bin/bash &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getent group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Lists information about groups and users&lt;br /&gt;
{|style=&amp;quot;background:lightblue;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
root:x:0:&lt;br /&gt;
daemon:x:1:&lt;br /&gt;
bin:x:2:&lt;br /&gt;
sys:x:3:&lt;br /&gt;
adm:x:4:fedor&lt;br /&gt;
itk:x:5:&lt;br /&gt;
disk:x:6:&lt;br /&gt;
lp:x:7:&lt;br /&gt;
mail:x:8:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*Information about users and groups can also be found in &#039;&#039;&#039;/etc/shadow&#039;&#039;&#039; and &#039;&#039;&#039;/etc/passwd&#039;&#039;&#039; and &#039;&#039;&#039;/etc/group&#039;&#039;&#039;  files&lt;br /&gt;
&lt;br /&gt;
== 3. Managing software(installation, removing, dependencies) ==&lt;br /&gt;
&lt;br /&gt;
* Software installation: &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be installed.&lt;br /&gt;
&lt;br /&gt;
Before installing an application it is reccomended to update the operating system software list.&lt;br /&gt;
&lt;br /&gt;
** Simulating software installation:  &#039;&#039;&#039;apt-get install &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get install firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Installation of &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Downloadable &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; installation: &#039;&#039;&#039;dpkg -i &#039;&#039;debfail &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Software removal: &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Application &#039;&#039;Firefox&#039;&#039; will be removed.&lt;br /&gt;
&lt;br /&gt;
** Simulating software removal:  &#039;&#039;&#039;apt-get remove &#039;&#039;program&#039;&#039; -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove firefox -s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Removal of application &#039;&#039;Firefox&#039;&#039; will be simulated.&lt;br /&gt;
&lt;br /&gt;
**Previously installed &#039;&#039;&#039; &#039;&#039;deb-file&#039;&#039; &#039;&#039;&#039; removal: &#039;&#039;&#039;dpkg -r &#039;&#039;debfile &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Removing a program with its configuration: &#039;&#039;&#039;apt-get remove --purge &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-get remove --purge postfix&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Mailing progam &#039;&#039;Postfix&#039;&#039;and all the configurations for it will be removed.&lt;br /&gt;
&lt;br /&gt;
**Removing installation files: &#039;&#039;&#039;apt-get clean&#039;&#039;&#039;&lt;br /&gt;
Installation files will be removed from /var/cache/apt/archives and disk space will be freed. To view disk space enter command &#039;&#039;&#039;du -h&#039;&#039;&#039;. Option &#039;&#039;&#039;-h&#039;&#039;&#039; notes &#039;&#039;human readable&#039;&#039;(eg. Gb, Mb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating operation system software list: &#039;&#039;&#039;apt-get update&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Updating already installed software: &#039;&#039;&#039;apt-get upgrade&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating aliases&lt;br /&gt;
&lt;br /&gt;
Use a text editor(like nano) to edit &#039;&#039;&#039; &#039;&#039;.bashrc&#039;&#039; &#039;&#039;&#039; located in the user home directory. Add the desired alias to the alias list. To save the changes restart &#039;&#039;bashrc&#039;&#039;.&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano .bashrc&lt;br /&gt;
alias getapp=&#039;apt-get install&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
To save the changes file &#039;&#039;.bashrc&#039;&#039; needs to be restarted&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |. .bashrc&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Result: Alias &#039;&#039;getapp&#039;&#039; is created and can now be used instead of &#039;&#039;apt-get install&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |getapp firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Viewing software version: &#039;&#039;&#039;apt-cache policy &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache policy firefox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information if &#039;&#039;firefox&#039;&#039; is installed will be displayed, and if installed also the current version. &#039;&#039;Candidate&#039;&#039; means reccomended version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checking dependencies&lt;br /&gt;
** Checking what software a certain application depends of: &#039;&#039;&#039;apt-cache depends &#039;&#039;program&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache depends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Information about text editor &#039;&#039;nano&#039;&#039; dependencies will be displayed.&lt;br /&gt;
 &lt;br /&gt;
** Checking what other software depends on a specific program: &#039;&#039;&#039;apt-cache rdepends &#039;&#039;programm&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |apt-cache rdepends nano&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Displays all software that depends on &#039;&#039;nano&#039;&#039; text editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fixing a disrupted installation&lt;br /&gt;
&lt;br /&gt;
Command &#039;&#039;&#039;apt-get –f install&#039;&#039;&#039; checks and fixes disrupted dependencies. Command &#039;&#039;&#039;dpkg –configure –a&#039;&#039;&#039; completes an unfinished installation. These commands should be implemented one after another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Migrating a software package to another server&lt;br /&gt;
&lt;br /&gt;
** Reading the software package list: &#039;&#039;&#039;dpkg --get-selections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Creating the old server software package list: &#039;&#039;&#039;dpkg --get-selections&amp;gt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** Implementing the old server software package list onto a new server:&lt;br /&gt;
&#039;&#039;&#039;dpkg --set-selections&amp;lt;&#039;&#039;installifail.txt&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 4. Disk partitions== &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Theory:&#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:800px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 8px;font-family:arial;font-size:8pt;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
After creating a disk partition a file system needs to be created to it. The disk partition then needs to be connected to a directory(usually a home directory).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Primary partition&#039;&#039; &#039;&#039;&#039; There can be max 4 primary partitions. Numeration of those is 1-4. Eg. sdb4(4th partition of the second disk)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Extended partition&#039;&#039; &#039;&#039;&#039; Can be created into one of the primary partitions. Numeration is 1-4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; &#039;&#039;Logical partition&#039;&#039; &#039;&#039;&#039; Can be mutiple partitions and always located inside a virtual partition. Numeration starts from 5. Eg sdb5 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Checking disk partition table: &#039;&#039;&#039;fdisk –l&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All partitions on a disk will be displayed:&lt;br /&gt;
 &lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 0px;font-family:courier;font-size:8pt;&amp;quot; |&lt;br /&gt;
  &#039;&#039;&#039;Device&#039;&#039;&#039;     BootStart    End      Blocks      Id    System&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb1&#039;&#039;&#039;      1        62      497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb2&#039;&#039;&#039;      133      1044    7325640      5    Extended&lt;br /&gt;
&lt;br /&gt;
  /dev/&#039;&#039;&#039;sdb5&#039;&#039;&#039;      133      194     497983+     83    Linux&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a partition: &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |fdisk /dev/sdb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result:&amp;lt;/u&amp;gt; Entering into the second disc prompt, where commands are asked to enter.&lt;br /&gt;
&lt;br /&gt;
**Command&#039;&#039;&#039;n&#039;&#039;&#039; is used in the prompt to create a new partition to the disk.&lt;br /&gt;
&lt;br /&gt;
**New partition configuration:&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; creates a primary partition and &#039;&#039;&#039;e&#039;&#039;&#039; creates a extended partition. A logical partition can be created inside a virtual partition with the command &#039;&#039;&#039;l&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
- Setting a partition number: 1-4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Other partition related commands inside &#039;&#039;&#039;fdisk /dev/sdX&#039;&#039;&#039; prompt:&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;p&#039;&#039;&#039; displays the partition table.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;q&#039;&#039;&#039; xits the prompt without saving the changes.&lt;br /&gt;
&lt;br /&gt;
- Command &#039;&#039;&#039;d&#039;&#039;&#039; deletes a partition.&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;u&amp;gt;Command&#039;&#039;&#039;w&#039;&#039;&#039; saves the changes into the partition table. &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB!&#039;&#039;&#039; If operating system gives an &#039;&#039;&#039;error&#039;&#039;&#039; message upon entering &#039;&#039;w&#039;&#039; command(&amp;quot;Warning, error 16: Device or resource busy. The Kernel still uses the old table&amp;quot;), then the previously created partitions need to be unmounted(see &#039;&#039;unmount&#039;&#039; below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Creating a file system: &#039;&#039;&#039;mkfs –t &#039;&#039;type partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkfs –t ext4 /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;: A file system is created to &#039;&#039;sdb1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Mounting a partition to a (home)directory: &#039;&#039;&#039;mount &#039;&#039;partition directory&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkdir /var/primary&lt;br /&gt;
mount  /dev/sdb1    /var/primary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:Partition &#039;&#039;sdb1&#039;&#039; will be mounted to &#039;&#039;&#039; &#039;&#039;/var/primary&#039;&#039; &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Adding a connected filesystem to the boot file &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; using a text editor&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After implementing changes the &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; usually looks like this:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb2 	 &lt;br /&gt;
|/var/primary&lt;br /&gt;
|ext4&lt;br /&gt;
|defaults&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
* Unmounting a partition: &#039;&#039;&#039;umount /&#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |umount /dev/sdb1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Result&amp;lt;/u&amp;gt;:  Partition &#039;&#039;sdb1&#039;&#039; will be unmounted.&lt;br /&gt;
&lt;br /&gt;
== 5. SWAP== &lt;br /&gt;
&lt;br /&gt;
* Swap consists of the following phases:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;u&amp;gt;Creating a partition for swap.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)&amp;lt;u&amp;gt; Assigning the created partition to swap: &#039;&#039;&#039; mkswap &#039;&#039;partition&#039;&#039; &#039;&#039;&#039;&amp;lt;/u&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |mkswap /dev/sdb5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3) &amp;lt;u&amp;gt;Changing the boot file&#039;&#039;&#039;/etc/fstab&#039;&#039;&#039; .&amp;lt;/u&amp;gt;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |nano /etc/fstab&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Partition information needs to be entered as such:&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:600px;margin:1px;border:1px solid lightgrey&amp;quot;&lt;br /&gt;
| &amp;lt;file system&amp;gt;&lt;br /&gt;
| &amp;lt;mount point&amp;gt;    &lt;br /&gt;
| &amp;lt;type&amp;gt;&lt;br /&gt;
| &amp;lt;options&amp;gt; &lt;br /&gt;
| &amp;lt;dump&amp;gt;&lt;br /&gt;
| &amp;lt;pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|/dev/sdb5 	 &lt;br /&gt;
|none&lt;br /&gt;
|swap&lt;br /&gt;
|sw&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4) &amp;lt;u&amp;gt;Enable paging: &#039;&#039;&#039;swapon -a&#039;&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap configuration will be loaded from &#039;&#039;&#039;/etc/fstab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check for swap area existence: &#039;&#039;&#039;swapon -s&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 6. WORKING WITH PROCESSES ==&lt;br /&gt;
&lt;br /&gt;
* Listing processes: &#039;&#039;&#039;ps -ef&#039;&#039;&#039;&lt;br /&gt;
Process list displays an id number for every process(&amp;quot;&amp;quot;&amp;quot;PID&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
* Displaying processes sent to the backround: &#039;&#039;&#039;jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Killing a process: &#039;&#039;&#039;kill &#039;&#039;-signal PID&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 1305&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt;  A process with PID 1305 will be killed.&lt;br /&gt;
  &lt;br /&gt;
* Killing a process running in the background:  &#039;&#039;&#039;kill &#039;&#039;-signal&#039;&#039; %&#039;&#039;job_number&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |kill -9 %2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process number 2 running in the background will be killed.&lt;br /&gt;
&lt;br /&gt;
* Creating a soft link: &#039;&#039;&#039;ln -s &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln -s /var/log logs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A soft link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
* Creating a hard link: &#039;&#039;&#039;ln &#039;&#039;/path/filename link &#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:300px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; |ln /var/log logis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; A hard link &#039;&#039;logs&#039;&#039; has been created pointing to &#039;&#039;/var/log&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Redirecting&lt;br /&gt;
Redirecting works with a &amp;quot;pipe&amp;quot; symbol &#039;&#039;&#039;|&#039;&#039;&#039;. &lt;br /&gt;
To redirect into a file use &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039;. Double sign means adding to the file, single rewrites the file.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; env | grep path | cowsay &amp;gt; text.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Enviromental changers are beeing scanned for lines containing word &amp;quot;path&amp;quot;. These lines are redirected to the program &#039;&#039;cowsay&#039;&#039; and its output will be redirected to text.txt, rewriting its contents.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey&amp;quot; align=centre&lt;br /&gt;
| style=&amp;quot;padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;&amp;quot; ps –ef  | grep top | grep –v grep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt; Result:&amp;lt;/u&amp;gt; Process table is being scanned for process &amp;quot;top&amp;quot;, filtering the results so that process &amp;quot;grep top&amp;quot; will not be shown in the results. Instead only &amp;quot;top&amp;quot; process information will be displayed.&lt;br /&gt;
&lt;br /&gt;
* Sending a running process to the background &#039;&#039;&#039;ctrl+z&#039;&#039;&#039;.&lt;br /&gt;
* To start a process on the background add the &#039;&#039;&#039;&amp;amp;&#039;&#039;&#039; sign after the program name: &#039;&#039;&#039;cowssay &amp;amp;&#039;&#039;&#039;.&lt;br /&gt;
* Bringing a program back from the background: &#039;&#039;&#039;fg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Starting a program from the working directory: &#039;&#039;&#039;./&#039;&#039;program_name&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_wiki_article&amp;diff=117997</id>
		<title>OSadmin wiki article</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_wiki_article&amp;diff=117997"/>
		<updated>2017-02-21T14:03:31Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Intro=&lt;br /&gt;
*Choose a topic from personal experience related with the subject or from topics found on the wiki page&lt;br /&gt;
*[[#Chosen_topics|Write the topic here]].&lt;br /&gt;
*Lecturer will confirm the topic&lt;br /&gt;
*Write your article in wiki environment &lt;br /&gt;
*Inform the [[Operating_systems#Lecturer|lecturer]] when the article is finished&lt;br /&gt;
*Receive feedback for corrections&lt;br /&gt;
&lt;br /&gt;
=Requirements for the wiki article=&lt;br /&gt;
Author: name, group and date when the article is written&lt;br /&gt;
&lt;br /&gt;
==Introduction ==&lt;br /&gt;
Covers points what will be discussed in the article, what are the requirements for the article reader; what are the operating system’s requirements. &lt;br /&gt;
&lt;br /&gt;
==Contents==&lt;br /&gt;
All commands should be easily separable from the overall text. &lt;br /&gt;
Users should be able to copy the commands directly (additional info like prompt and user distinction symbols should be left out from the command description area)&lt;br /&gt;
The text should determine what user permissions are needed to perform these tasks. &lt;br /&gt;
The reader of your article is your fellow students, so try to avoid irrelevant information and stay on topic (don’t explain the meaning of IP address or how to install Ubuntu, when your topic is actually about htop)&lt;br /&gt;
All the content should be referenced. &lt;br /&gt;
Do not use slang and try to be grammatically correct.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt; &lt;br /&gt;
Bear in mind that this is an open environment, so everything you write in your wiki article, will be public. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Referencing==&lt;br /&gt;
Best practises of wiki referencing should be used. &lt;br /&gt;
Terms are but between square brackets to reference other articles in the system.&lt;br /&gt;
All drawing and images have to be referenced below the picture and in the text. (for example “System architecture can be viewed on image x, y and z.”)&lt;br /&gt;
Author’s own ideas have to be clearly presentable. Everything used from the sources have to be referenced. &lt;br /&gt;
&lt;br /&gt;
==Fellow student review==&lt;br /&gt;
Please find a fellow student who will review your article and give a feedback on the discussion tab of the article using [http://enos.itcollege.ee/~edmund/materials/viki-artikkel/Assessment-model-for-the-wiki-article.html the following assessment model].&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Besides a short overview, what was discussed in this article, it should also include the author&#039;s own opinion about the topic. &lt;br /&gt;
&lt;br /&gt;
==Category==&lt;br /&gt;
Add the following category to the end of the article (last row):&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Chosen topics=&lt;br /&gt;
Please write here your topic and name, group:&lt;br /&gt;
* &#039;&#039;&#039;Basic Automation with Python&#039;&#039;&#039;; Ardi Vaba; CSE-11&lt;br /&gt;
* &#039;&#039;&#039;SSH Encryption&#039;&#039;&#039;; Frank Korving; CSE-11&lt;br /&gt;
* &#039;&#039;&#039;Translation of OSadmin wiki help page to English [[https://wiki.itcollege.ee/index.php/Osadmin_spikker]]&#039;&#039;&#039;; Peep Kuulme; CSE-11&lt;br /&gt;
==Ideas==&lt;br /&gt;
* UNIX CLI password manager https://www.passwordstore.org and its GUI http://qtpass.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
* [https://wiki.itcollege.ee/index.php/Osadmin_referaadi_teemad counterpart article in Estonian]&lt;br /&gt;
* http://manpage.io&lt;br /&gt;
* https://linuxjourney.com/&lt;br /&gt;
* [https://linux.die.net/man/ Linux man-pages]&lt;br /&gt;
* [https://linux.die.net Linux docs]&lt;br /&gt;
* http://www.tecmint.com/60-commands-of-linux-a-guide-from-newbies-to-system-administrator/&lt;br /&gt;
* http://www.tecmint.com/useful-linux-commands-for-system-administrators/&lt;br /&gt;
* http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html&lt;br /&gt;
* http://www.thegeekstuff.com/2010/12/50-unix-linux-sysadmin-tutorials&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=OSadmin_wiki_article&amp;diff=117996</id>
		<title>OSadmin wiki article</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=OSadmin_wiki_article&amp;diff=117996"/>
		<updated>2017-02-21T14:02:55Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Intro=&lt;br /&gt;
*Choose a topic from personal experience related with the subject or from topics found on the wiki page&lt;br /&gt;
*[[#Chosen_topics|Write the topic here]].&lt;br /&gt;
*Lecturer will confirm the topic&lt;br /&gt;
*Write your article in wiki environment &lt;br /&gt;
*Inform the [[Operating_systems#Lecturer|lecturer]] when the article is finished&lt;br /&gt;
*Receive feedback for corrections&lt;br /&gt;
&lt;br /&gt;
=Requirements for the wiki article=&lt;br /&gt;
Author: name, group and date when the article is written&lt;br /&gt;
&lt;br /&gt;
==Introduction ==&lt;br /&gt;
Covers points what will be discussed in the article, what are the requirements for the article reader; what are the operating system’s requirements. &lt;br /&gt;
&lt;br /&gt;
==Contents==&lt;br /&gt;
All commands should be easily separable from the overall text. &lt;br /&gt;
Users should be able to copy the commands directly (additional info like prompt and user distinction symbols should be left out from the command description area)&lt;br /&gt;
The text should determine what user permissions are needed to perform these tasks. &lt;br /&gt;
The reader of your article is your fellow students, so try to avoid irrelevant information and stay on topic (don’t explain the meaning of IP address or how to install Ubuntu, when your topic is actually about htop)&lt;br /&gt;
All the content should be referenced. &lt;br /&gt;
Do not use slang and try to be grammatically correct.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt; &lt;br /&gt;
Bear in mind that this is an open environment, so everything you write in your wiki article, will be public. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Referencing==&lt;br /&gt;
Best practises of wiki referencing should be used. &lt;br /&gt;
Terms are but between square brackets to reference other articles in the system.&lt;br /&gt;
All drawing and images have to be referenced below the picture and in the text. (for example “System architecture can be viewed on image x, y and z.”)&lt;br /&gt;
Author’s own ideas have to be clearly presentable. Everything used from the sources have to be referenced. &lt;br /&gt;
&lt;br /&gt;
==Fellow student review==&lt;br /&gt;
Please find a fellow student who will review your article and give a feedback on the discussion tab of the article using [http://enos.itcollege.ee/~edmund/materials/viki-artikkel/Assessment-model-for-the-wiki-article.html the following assessment model].&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Besides a short overview, what was discussed in this article, it should also include the author&#039;s own opinion about the topic. &lt;br /&gt;
&lt;br /&gt;
==Category==&lt;br /&gt;
Add the following category to the end of the article (last row):&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Chosen topics=&lt;br /&gt;
Please write here your topic and name, group:&lt;br /&gt;
* &#039;&#039;&#039;Basic Automation with Python&#039;&#039;&#039;; Ardi Vaba; CSE-11&lt;br /&gt;
* &#039;&#039;&#039;SSH Encryption&#039;&#039;&#039;; Frank Korving; CSE-11&lt;br /&gt;
* &#039;&#039;&#039;Translation of OSadmin wiki page to English [[https://wiki.itcollege.ee/index.php/Osadmin_spikker]]&#039;&#039;&#039;; Peep Kuulme; CSE-11&lt;br /&gt;
==Ideas==&lt;br /&gt;
* UNIX CLI password manager https://www.passwordstore.org and its GUI http://qtpass.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
* [https://wiki.itcollege.ee/index.php/Osadmin_referaadi_teemad counterpart article in Estonian]&lt;br /&gt;
* http://manpage.io&lt;br /&gt;
* https://linuxjourney.com/&lt;br /&gt;
* [https://linux.die.net/man/ Linux man-pages]&lt;br /&gt;
* [https://linux.die.net Linux docs]&lt;br /&gt;
* http://www.tecmint.com/60-commands-of-linux-a-guide-from-newbies-to-system-administrator/&lt;br /&gt;
* http://www.tecmint.com/useful-linux-commands-for-system-administrators/&lt;br /&gt;
* http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html&lt;br /&gt;
* http://www.thegeekstuff.com/2010/12/50-unix-linux-sysadmin-tutorials&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=117839</id>
		<title>User:Eocakovs</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User:Eocakovs&amp;diff=117839"/>
		<updated>2017-02-17T09:36:15Z</updated>

		<summary type="html">&lt;p&gt;Pkuulme: /* I701 - Information System Analysis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= I701 - Information System Analysis =&lt;br /&gt;
&lt;br /&gt;
== Group Project ==&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
* Ardi Vaba&lt;br /&gt;
* Pascal Tietjen&lt;br /&gt;
* Peep Kuulme&lt;br /&gt;
* Nika Ptskialadze&lt;br /&gt;
* Erik Ocakovskih&lt;br /&gt;
* Frank Korving&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Organization==== &lt;br /&gt;
WPE (Windows Programs Explained)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Daily Operations:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
We are a software development company. Our current major project consists of providing and supporting an application with simple interface to analyze currently installed programs on the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example Information Systems:&#039;&#039;&#039;  &amp;lt;br&amp;gt;&lt;br /&gt;
Accounting Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Customer Support Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Sales Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Developer Daily-Work Information System &amp;lt;br&amp;gt;&lt;br /&gt;
Transaction Processing Information System &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Value Chain Analysis====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Primary Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Software Development [Getting the software to working state]&lt;br /&gt;
* Software Delivery [Getting the product to the market]&lt;br /&gt;
* Sales [Selling a product to current customers and new customer aquisition] &lt;br /&gt;
* Marketing [Providing product information to target group]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* Scheduling [Optimizing work and workload assignments]&lt;br /&gt;
* Support / Service [Maintenance of existing software and customer assistance]&lt;br /&gt;
* Marketing [Customer Management]&lt;br /&gt;
&#039;&#039;Quality Assurance&#039;&#039;&lt;br /&gt;
* Testing [Functionality verification of the developed working software]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Support Activities:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Direct&#039;&#039;&lt;br /&gt;
* Infrastructure [Providing Legal, Administrative and Accounting support]&lt;br /&gt;
* Procurement [Acquisition of external services]&lt;br /&gt;
&#039;&#039;Indirect&#039;&#039;&lt;br /&gt;
* HR Management [Human Resource Management]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Strenght&lt;br /&gt;
Innovative - no other popular program like this&lt;br /&gt;
Strong team - well organized, good programmers&lt;br /&gt;
Competitively priced&lt;br /&gt;
User-friendly interface&lt;br /&gt;
&lt;br /&gt;
Weakness&lt;br /&gt;
No brand recognition&lt;br /&gt;
Small company not a lot of financial backup&lt;br /&gt;
Developlment slow due to the size of the company&lt;br /&gt;
Organic growth - no outside funding&lt;br /&gt;
&lt;br /&gt;
Opportunities&lt;br /&gt;
Globally extending&lt;br /&gt;
Expand the team for faster development&lt;br /&gt;
Targeting industries&lt;br /&gt;
&lt;br /&gt;
Threats&lt;br /&gt;
Larger company might sprint past with a similar program&lt;br /&gt;
Sustainable financial backing&lt;br /&gt;
Customer scepticisim - do not want to give access to scan their computer&lt;/div&gt;</summary>
		<author><name>Pkuulme</name></author>
	</entry>
</feed>