<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ihitc.net/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Franske_ITC-2480_Lab_4</id>
	<title>Franske ITC-2480 Lab 4 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ihitc.net/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Franske_ITC-2480_Lab_4"/>
	<link rel="alternate" type="text/html" href="https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;action=history"/>
	<updated>2026-05-05T23:59:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.5</generator>
	<entry>
		<id>https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=9694&amp;oldid=prev</id>
		<title>BenFranske: Update to mjnk version</title>
		<link rel="alternate" type="text/html" href="https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=9694&amp;oldid=prev"/>
		<updated>2021-08-25T02:50:32Z</updated>

		<summary type="html">&lt;p&gt;Update to mjnk version&lt;/p&gt;
&lt;a href=&quot;https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;amp;diff=9694&amp;amp;oldid=7268&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>BenFranske</name></author>
	</entry>
	<entry>
		<id>https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7268&amp;oldid=prev</id>
		<title>BenFranske: /* Working With Filesystem Links */</title>
		<link rel="alternate" type="text/html" href="https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7268&amp;oldid=prev"/>
		<updated>2018-01-29T07:57:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Working With Filesystem Links&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:57, 29 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l78&quot;&gt;Line 78:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 78:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Working With Filesystem Links==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Working With Filesystem Links==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you get stuck or have any problems understanding how links are functioning in a certain way you can find a number of introductory tutorials [http://www.nixtutor.com/freebsd/understanding-symbolic-links/ like this one] or [http://www.thegeekstuff.com/2010/10/linux-ln-command-examples/ more advanced tutorials] on the Internet by searching for them.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you get stuck or have any problems understanding how links are functioning in a certain way you can find a number of introductory tutorials [http://www.nixtutor.com/freebsd/understanding-symbolic-links/ like this one] or [http://www.thegeekstuff.com/2010/10/linux-ln-command-examples/ more advanced tutorials] on the Internet by searching for them.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use root privileges to create a new directory &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;in &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;root user&lt;/del&gt;&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;s home directory (remember this is &lt;/del&gt;&amp;#039;&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/root&lt;/del&gt;&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039; and not &amp;#039;&amp;#039;/home/root&amp;#039;&amp;#039;) &lt;/del&gt;called &amp;#039;&amp;#039;documentation&amp;#039;&amp;#039; and change the ownership permissions so that your standard user has permission to read, write, and execute as a member of a group which owns the documentation directory. You will also need to make sure that all system users have execute permission for the parent directory (&amp;#039;&amp;#039;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;root&lt;/del&gt;&amp;#039;&amp;#039;) in order to access anything in it including the documentation directory.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use root privileges to create a new directory &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;inside &lt;/ins&gt;the &amp;#039;&amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;#039;&amp;#039; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;directory &lt;/ins&gt;called &amp;#039;&amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;system-&lt;/ins&gt;documentation&amp;#039;&amp;#039; and change the ownership permissions so that your standard user has permission to read, write, and execute as a member of a group which owns the documentation directory. You will also need to make sure that all system users have execute permission for the parent directory (&amp;#039;&amp;#039;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;#039;&amp;#039;) in order to access anything in it including the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;system-&lt;/ins&gt;documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039; &lt;/ins&gt;directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Instead of needing to go into the &amp;#039;&amp;#039;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;root&lt;/del&gt;/documentation&amp;#039;&amp;#039; directory all the time it would be more convenient if your user was able to reach that directory through a link in their own home directory. Run the &amp;#039;&amp;#039;&amp;#039;ln -s /&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;root&lt;/del&gt;/documentation documentation&amp;#039;&amp;#039;&amp;#039; command inside your regular user&amp;#039;s home directory (or if you&amp;#039;re in a different working directory you can run the command as &amp;#039;&amp;#039;&amp;#039;ln -s /&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;root&lt;/del&gt;/documentation ~/documentation&amp;#039;&amp;#039;&amp;#039; Do you understand why?)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Instead of needing to go into the &amp;#039;&amp;#039;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-system-&lt;/ins&gt;documentation&amp;#039;&amp;#039; directory all the time it would be more convenient if your user was able to reach that directory through a link in their own home directory. Run the &amp;#039;&amp;#039;&amp;#039;ln -s /&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;system-&lt;/ins&gt;documentation documentation&amp;#039;&amp;#039;&amp;#039; command inside your regular user&amp;#039;s home directory (or if you&amp;#039;re in a different working directory you can run the command as &amp;#039;&amp;#039;&amp;#039;ln -s /&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;system-&lt;/ins&gt;documentation ~/documentation&amp;#039;&amp;#039;&amp;#039; Do you understand why?)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# You should now see a soft link (also called symlink) in your home directory called documentation which points to the &amp;#039;&amp;#039;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;root&lt;/del&gt;/documentation&amp;#039;&amp;#039; folder.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# You should now see a soft link (also called symlink) in your home directory called documentation which points to the &amp;#039;&amp;#039;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;system-&lt;/ins&gt;documentation&amp;#039;&amp;#039; folder.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# You should be able to &amp;#039;&amp;#039;&amp;#039;cd&amp;#039;&amp;#039;&amp;#039; into the link just like it was a real directory. In fact, if you use the &amp;#039;&amp;#039;&amp;#039;pwd&amp;#039;&amp;#039;&amp;#039; command to print your working directory while inside the link it will look like it&amp;#039;s a directory. Almost all software on the system will interact with the link just as if it&amp;#039;s a real directory.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# You should be able to &amp;#039;&amp;#039;&amp;#039;cd&amp;#039;&amp;#039;&amp;#039; into the link just like it was a real directory. In fact, if you use the &amp;#039;&amp;#039;&amp;#039;pwd&amp;#039;&amp;#039;&amp;#039; command to print your working directory while inside the link it will look like it&amp;#039;s a directory. Almost all software on the system will interact with the link just as if it&amp;#039;s a real directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Try creating some files and subdirectories inside of the link and then verify they are showing up in the real &amp;#039;&amp;#039;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;root&lt;/del&gt;/documentation&amp;#039;&amp;#039; location as well. This should work correctly if your permissions are all set correctly.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Try creating some files and subdirectories inside of the link and then verify they are showing up in the real &amp;#039;&amp;#039;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;system-&lt;/ins&gt;documentation&amp;#039;&amp;#039; location as well. This should work correctly if your permissions are all set correctly.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If you remove the link (&amp;#039;&amp;#039;&amp;#039;rm ~/documentation&amp;#039;&amp;#039;&amp;#039;) from your home directory you should see that all of the files you created are still in &amp;#039;&amp;#039;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;root&lt;/del&gt;/documentation&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If you remove the link (&amp;#039;&amp;#039;&amp;#039;rm ~/documentation&amp;#039;&amp;#039;&amp;#039;) from your home directory you should see that all of the files you created are still in &amp;#039;&amp;#039;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;system-&lt;/ins&gt;documentation&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If you re-create the link you should be able to go back into &amp;#039;&amp;#039;~/documentation&amp;#039;&amp;#039; and remove files and directories and see they are removed from the actual &amp;#039;&amp;#039;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;root&lt;/del&gt;/documentation&amp;#039;&amp;#039; directory as well&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If you re-create the link you should be able to go back into &amp;#039;&amp;#039;~/documentation&amp;#039;&amp;#039; and remove files and directories and see they are removed from the actual &amp;#039;&amp;#039;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;system-&lt;/ins&gt;documentation&amp;#039;&amp;#039; directory as well&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# You can also practice creating links to specific files as well as directories. Links do not override permissions so you need to have permission to read, write or execute the file or directory you are linking to just like if you actually changed to the real location of the item. Go ahead and practice creating and removing links until you have a good understanding of how links can be used.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# You can also practice creating links to specific files as well as directories. Links do not override permissions so you need to have permission to read, write or execute the file or directory you are linking to just like if you actually changed to the real location of the item. Go ahead and practice creating and removing links until you have a good understanding of how links can be used.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Note: If you are using &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; to back up data, depending on exactly what you want to do you may want to use the &amp;#039;&amp;#039;-h&amp;#039;&amp;#039; or &amp;#039;&amp;#039;--dereference&amp;#039;&amp;#039; option which will follow the symlink and backup the data it contains. Normal behavior for tar would just be to back up the link itslef, not the file(s) pointed to by the link. You should try creating some tar files of directories which contain symlinks, deleting the data the symlink points to and the extracting the tar file to some new location to see this in action if you are not confident that you understand this.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Note: If you are using &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; to back up data, depending on exactly what you want to do you may want to use the &amp;#039;&amp;#039;-h&amp;#039;&amp;#039; or &amp;#039;&amp;#039;--dereference&amp;#039;&amp;#039; option which will follow the symlink and backup the data it contains. Normal behavior for tar would just be to back up the link itslef, not the file(s) pointed to by the link. You should try creating some tar files of directories which contain symlinks, deleting the data the symlink points to and the extracting the tar file to some new location to see this in action if you are not confident that you understand this.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BenFranske</name></author>
	</entry>
	<entry>
		<id>https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7267&amp;oldid=prev</id>
		<title>BenFranske: /* Creating Archived/Compressed Files */</title>
		<link rel="alternate" type="text/html" href="https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7267&amp;oldid=prev"/>
		<updated>2018-01-29T07:09:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Creating Archived/Compressed Files&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:09, 29 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l53&quot;&gt;Line 53:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 53:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Creating Archived/Compressed Files==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Creating Archived/Compressed Files==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you get stuck or have any problems understanding why &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; is functioning in a certain way you can find a number of introductory tutorials [http://www.thegeekstuff.com/2010/04/unix-tar-command-examples/ like this one] about using &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; on the Internet by [https://www.google.com/#q=tar+tutorial searching for them]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you get stuck or have any problems understanding why &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; is functioning in a certain way you can find a number of introductory tutorials [http://www.thegeekstuff.com/2010/04/unix-tar-command-examples/ like this one] about using &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; on the Internet by [https://www.google.com/#q=tar+tutorial searching for them]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create a new directory &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; in your home &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;directory and enter this &lt;/del&gt;directory.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create a new directory &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; in your home directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create a GZipped TAR file of everything in your system log directory called &amp;#039;&amp;#039;logbackup1.tar.tz&amp;#039;&amp;#039; using the &amp;#039;&amp;#039;&amp;#039;tar -czvf logbackup1.tar.gz &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/var/log&lt;/del&gt;&amp;#039;&amp;#039;&amp;#039; command. Note that you will need to use root privileges to create all of the log backups in this section of the lab because some log files can not be read by a standard user.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create a GZipped TAR file of everything in your system log directory called &amp;#039;&amp;#039;logbackup1.tar.tz&amp;#039;&amp;#039; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;and save it to the &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory in your home directory by first changing your working directory to &amp;#039;&amp;#039;/var/log&amp;#039;&amp;#039; and then &lt;/ins&gt;using the &amp;#039;&amp;#039;&amp;#039;tar -czvf &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;~/experiments/&lt;/ins&gt;logbackup1.tar.gz &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;*&lt;/ins&gt;&amp;#039;&amp;#039;&amp;#039; command.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Note the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lack of a slash at the end of &lt;/del&gt;the directory &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;we are putting into &lt;/del&gt;the TAR file. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;In some older versions &lt;/del&gt;of &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;TAR putting a slash on the end meant to put the files from that directory into the file but not the directory itself&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;When files like this were untarred they would dump all of the files into the current &lt;/del&gt;directory &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;making a mess. By leaving the slash off the end we are telling TAR &lt;/del&gt;to &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;put &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;log directory,as well as it&lt;/del&gt;&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;s contents, into the TAR file so that when we extract it we will get a log &lt;/del&gt;directory &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;made with the files going into it. Even though new versions of TAR automatically prevent you from creating TAR files without a directory path it is still best practice to make sure that you are including a &lt;/del&gt;directory &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;as part of the TAR file&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#* &lt;/ins&gt;Note that you will need to use root privileges to create all of the log backups in this section of the lab because some log files can not be read by a standard user.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Note the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;asterisk (*) which is used to select all files in &lt;/ins&gt;the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;current &lt;/ins&gt;directory &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;for inclusion in &lt;/ins&gt;the TAR file. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This is a type &lt;/ins&gt;of &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wildcard character&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Change your working &lt;/ins&gt;directory to the &amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;experiments&amp;#039;&amp;#039; &lt;/ins&gt;directory &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;in your home &lt;/ins&gt;directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Try extracting the files into your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory, show a list of files as they are extracted&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Try extracting the files into your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory, show a list of files as they are extracted&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Check the contents of your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory. What happened? If you extracted a tar file made this way you could potentially end up with several more levels of directories than you really want. In this case we got an extra &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/del&gt;var&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039; &lt;/del&gt;directory inside of experiments but if we were archiving something with a deeper path we would have even more extra subdirectories. You can actually see this during the tar file creation if you have verbose output enabled you saw that all the files being added to the tar had &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/del&gt;var/log/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039; &lt;/del&gt;in front of the filename. There are at least two ways to handle this which we will look at.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Check the contents of your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory. What happened? What kind of mess could this make when you extract a TAR file when it was created this way?&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Empty your &lt;/del&gt;&amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Delete all files and subdirectories from inside the &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If we are creating the TAR file manually we can avoid these extra parts to the path by paying attention to what directory we are in when we create the TAR file. This time change your working directory to &amp;#039;&amp;#039;/var&amp;#039;&amp;#039; first and then run the &amp;#039;&amp;#039;&amp;#039;tar -czvf ~/experiments/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;logbackup2&lt;/del&gt;.tar.gz log&amp;#039;&amp;#039;&amp;#039; command. Note the different output from the tar command. This time the filenames are prefixed only by &amp;#039;&amp;#039;log/&amp;#039;&amp;#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;but we also had to specify the full path of where to create the .tar.gz file, though we used the &amp;#039;&amp;#039;~&amp;#039;&amp;#039; shortcut to our current user&amp;#039;s home directory&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Try again to create a GZipped TAR file of everything in your system log directory called &amp;#039;&amp;#039;logbackup2.tar.tz&amp;#039;&amp;#039; and save it to the &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory in your home directory but this time just run &amp;#039;&amp;#039;&amp;#039;tar -czvf logbackup2.tar.gz /var/log&amp;#039;&amp;#039;&amp;#039; command from inside the &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Switch back to your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(hint, can you do this with a shortcut?) &lt;/del&gt;and then try extracting the files from &amp;#039;&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;logbackup2&lt;/del&gt;.tar.gz&amp;#039;&amp;#039; into your experiments directory, do not show a list of files as they are extracted this time.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#* Note that you will need to use root privileges to create all of the log backups in this section of the lab because some log files can not be read by a standard user.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#* Note the lack of a slash at the end of the directory we are putting into the TAR file. In some older versions of TAR putting a slash on the end meant to put the files from that directory into the file but not the directory itself (just like when we created logbackup1.tar.gz with the asterisk wildcard). By leaving the slash off the end we are telling TAR to put the log directory,as well as it&amp;#039;s contents, into the TAR file so that when we extract it we will get a log directory made with the files going into it. Even though new versions of TAR automatically prevent you from creating TAR files without a directory path it is still best practice to make sure that you are including a directory as part of the TAR file.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Try extracting the files into your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory, show a list of files as they are extracted&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Check the contents of your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory. What happened? If you extracted a tar file made this way you could potentially end up with several more levels of directories than you really want. In this case we got an extra var directory inside of experiments but if we were archiving something with a deeper path we would have even more extra subdirectories. You can actually see this during the tar file creation if you have verbose output enabled you saw that all the files being added to the tar had var/log/ in front of the filename. There are at least two ways to handle this which we will look at.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Delete all files and subdirectories from inside the &lt;/ins&gt;&amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If we are creating the TAR file manually we can avoid these extra parts to the path by paying attention to what directory we are in when we create the TAR file. This time change your working directory to &amp;#039;&amp;#039;/var&amp;#039;&amp;#039; first and then run the &amp;#039;&amp;#039;&amp;#039;tar -czvf ~/experiments/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;logbackup3&lt;/ins&gt;.tar.gz log&amp;#039;&amp;#039;&amp;#039; command. Note the different output from the tar command. This time the filenames are prefixed only by &amp;#039;&amp;#039;log/&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Switch back to your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory and then try extracting the files from &amp;#039;&amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;logbackup3&lt;/ins&gt;.tar.gz&amp;#039;&amp;#039; into your experiments directory, do not show a list of files as they are extracted this time.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Check the contents of your experiments directory. This time you should see that there is just one new subdirectory called log and all of the files are neatly placed inside of it. This is the type of extraction people normally want and expect from a tar file that is distributed.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Check the contents of your experiments directory. This time you should see that there is just one new subdirectory called log and all of the files are neatly placed inside of it. This is the type of extraction people normally want and expect from a tar file that is distributed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Empty your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Empty your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If you want to have the same effect but without changing your working directory that is possible too. Try running the &amp;#039;&amp;#039;&amp;#039;tar -czvf ~/experiments/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;logbackup3&lt;/del&gt;.tar.gz -C /var log&amp;#039;&amp;#039;&amp;#039; command. This time it doesn&amp;#039;t make any difference which directory on the system because we have again specified a full path for where to save the tar file and we have also told tar to change to the &amp;#039;&amp;#039;/var&amp;#039;&amp;#039; directory before adding the log directory to the file using the -C argument. This automates the process of manually changing directories like we did above.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If you want to have the same effect but without changing your working directory that is possible too. Try running the &amp;#039;&amp;#039;&amp;#039;tar -czvf ~/experiments/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;logbackup4&lt;/ins&gt;.tar.gz -C /var log&amp;#039;&amp;#039;&amp;#039; command. This time it doesn&amp;#039;t make any difference which directory on the system because we have again specified a full path for where to save the tar file and we have also told tar to change to the &amp;#039;&amp;#039;/var&amp;#039;&amp;#039; directory before adding the log directory to the file using the -C argument. This automates the process of manually changing directories like we did above.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Switch back to your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(hint, can you do this with a shortcut?) &lt;/del&gt;and then try extracting the files from &amp;#039;&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;logbackup2&lt;/del&gt;.tar.gz&amp;#039;&amp;#039; into your experiments directory, do not show a list of files as they are extracted this time.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Switch back to your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory and then try extracting the files from &amp;#039;&amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;logbackup4&lt;/ins&gt;.tar.gz&amp;#039;&amp;#039; into your experiments directory, do not show a list of files as they are extracted this time.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Check the contents of your experiments directory. This time you should again see that there is just one new subdirectory called &amp;#039;&amp;#039;log&amp;#039;&amp;#039; and all of the files are neatly placed inside of it.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Check the contents of your experiments directory. This time you should again see that there is just one new subdirectory called &amp;#039;&amp;#039;log&amp;#039;&amp;#039; and all of the files are neatly placed inside of it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# There are a number of other things you can do with &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; such as creating slower but more highly compressed .bz2 bzip files, extracting single files (or directories or groups of files) from an archive, listing the contents of an archive without extracting (which can show you if a new subdirectory will be created), adding files to an existing archive, and preserving file ownership (only by extracting on the same system though) and permissions. You should read the manual page for tar and then try practicing some of these and be familiar with the many ways that &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; can be used.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# There are a number of other things you can do with &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; such as creating slower but more highly compressed .bz2 bzip files, extracting single files (or directories or groups of files) from an archive, listing the contents of an archive without extracting (which can show you if a new subdirectory will be created), adding files to an existing archive, and preserving file ownership (only by extracting on the same system though) and permissions. You should read the manual page for tar and then try practicing some of these and be familiar with the many ways that &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; can be used.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BenFranske</name></author>
	</entry>
	<entry>
		<id>https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7266&amp;oldid=prev</id>
		<title>BenFranske: /* Creating Archived/Compressed Files */</title>
		<link rel="alternate" type="text/html" href="https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7266&amp;oldid=prev"/>
		<updated>2018-01-29T06:52:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Creating Archived/Compressed Files&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 06:52, 29 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l52&quot;&gt;Line 52:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 52:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Creating Archived/Compressed Files==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Creating Archived/Compressed Files==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you get stuck or have any problems understanding why tar is functioning in a certain way you can find a number of introductory tutorials [http://www.thegeekstuff.com/2010/04/unix-tar-command-examples/ like this one] about using &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; on the Internet by [https://www.google.com/#q=tar+tutorial searching for them]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you get stuck or have any problems understanding why &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;&lt;/ins&gt;tar&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039; &lt;/ins&gt;is functioning in a certain way you can find a number of introductory tutorials [http://www.thegeekstuff.com/2010/04/unix-tar-command-examples/ like this one] about using &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; on the Internet by [https://www.google.com/#q=tar+tutorial searching for them]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create a new directory &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; in your home directory and enter this directory.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create a new directory &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; in your home directory and enter this directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create a GZipped TAR file of everything in your system log directory called &amp;#039;&amp;#039;logbackup1.tar.tz&amp;#039;&amp;#039; using the &amp;#039;&amp;#039;&amp;#039;tar -czvf logbackup1.tar.gz /var/log&amp;#039;&amp;#039;&amp;#039; command. Note that you will need to use root privileges to create all of the log backups in this section of the lab because some log files can not be read by a standard user.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create a GZipped TAR file of everything in your system log directory called &amp;#039;&amp;#039;logbackup1.tar.tz&amp;#039;&amp;#039; using the &amp;#039;&amp;#039;&amp;#039;tar -czvf logbackup1.tar.gz /var/log&amp;#039;&amp;#039;&amp;#039; command. Note that you will need to use root privileges to create all of the log backups in this section of the lab because some log files can not be read by a standard user.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BenFranske</name></author>
	</entry>
	<entry>
		<id>https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7265&amp;oldid=prev</id>
		<title>BenFranske: /* Searching for Files in Linux */</title>
		<link rel="alternate" type="text/html" href="https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7265&amp;oldid=prev"/>
		<updated>2018-01-28T08:17:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Searching for Files in Linux&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:17, 28 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l48&quot;&gt;Line 48:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 48:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Install the locate program using &amp;#039;&amp;#039;&amp;#039;sudo apt-get install locate&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Install the locate program using &amp;#039;&amp;#039;&amp;#039;sudo apt-get install locate&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create an updated database of files on your system using the &amp;#039;&amp;#039;&amp;#039;sudo updatedb&amp;#039;&amp;#039;&amp;#039; command. Note, it will take a while for this program to find and index all the files on your system so give it a while to run. The advantage is after you do this you can search the database for many different files very quickly instead of waiting for each search as with the find command. We need to run the &amp;#039;&amp;#039;&amp;#039;updatedb&amp;#039;&amp;#039;&amp;#039; program as an administrator so that it can search though all locations on the system, including ones your user does not normally have access to.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create an updated database of files on your system using the &amp;#039;&amp;#039;&amp;#039;sudo updatedb&amp;#039;&amp;#039;&amp;#039; command. Note, it will take a while for this program to find and index all the files on your system so give it a while to run. The advantage is after you do this you can search the database for many different files very quickly instead of waiting for each search as with the find command. We need to run the &amp;#039;&amp;#039;&amp;#039;updatedb&amp;#039;&amp;#039;&amp;#039; program as an administrator so that it can search though all locations on the system, including ones your user does not normally have access to.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#* Note: Programs that may need to run for a long time and do not require user input (like &#039;&#039;&#039;updatedb&#039;&#039;&#039;) can be run in the background by placing an ampersand at the end of the command line like &#039;&#039;&#039;sudo updatedb&amp;amp;&#039;&#039;&#039;. This will immediately return you to a command prompt so you can continue to work on other things while the command finishes running.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Search for files with &amp;#039;&amp;#039;syslog&amp;#039;&amp;#039; in the name again but now using the command &amp;#039;&amp;#039;&amp;#039;locate syslog&amp;#039;&amp;#039;&amp;#039;. You should see many files found with this name and it should happen quickly, much faster than with the find command.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Search for files with &amp;#039;&amp;#039;syslog&amp;#039;&amp;#039; in the name again but now using the command &amp;#039;&amp;#039;&amp;#039;locate syslog&amp;#039;&amp;#039;&amp;#039;. You should see many files found with this name and it should happen quickly, much faster than with the find command.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BenFranske</name></author>
	</entry>
	<entry>
		<id>https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7264&amp;oldid=prev</id>
		<title>BenFranske: /* Command Output Manipulation */</title>
		<link rel="alternate" type="text/html" href="https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7264&amp;oldid=prev"/>
		<updated>2018-01-28T07:55:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Command Output Manipulation&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:55, 28 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l28&quot;&gt;Line 28:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 28:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Notice how there is no command output. This is normal as you redirected the command output to the file &amp;#039;&amp;#039;listfiles.txt&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Notice how there is no command output. This is normal as you redirected the command output to the file &amp;#039;&amp;#039;listfiles.txt&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use &amp;#039;&amp;#039;&amp;#039;cat&amp;#039;&amp;#039;&amp;#039; to verify the contents of &amp;#039;&amp;#039;listfiles.txt&amp;#039;&amp;#039; Notice how it contains the exact same output as running &amp;#039;&amp;#039;&amp;#039;ls -al&amp;#039;&amp;#039;&amp;#039; on the command line.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use &amp;#039;&amp;#039;&amp;#039;cat&amp;#039;&amp;#039;&amp;#039; to verify the contents of &amp;#039;&amp;#039;listfiles.txt&amp;#039;&amp;#039; Notice how it contains the exact same output as running &amp;#039;&amp;#039;&amp;#039;ls -al&amp;#039;&amp;#039;&amp;#039; on the command line.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Now, run &amp;#039;&amp;#039;&amp;#039;ls -al /var/log&amp;#039;&amp;#039;&amp;#039;. Notice how many files there are in the &amp;#039;&amp;#039;/var/log&amp;#039;&amp;#039; directory. Lets say we wanted to just know the information of the &amp;#039;&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dmesg&lt;/del&gt;&amp;#039;&amp;#039; log files. For this, we would use a pipe and the grep command.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Now, run &amp;#039;&amp;#039;&amp;#039;ls -al /var/log&amp;#039;&amp;#039;&amp;#039;. Notice how many files there are in the &amp;#039;&amp;#039;/var/log&amp;#039;&amp;#039; directory. Lets say we wanted to just know the information of the &amp;#039;&amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;debug&lt;/ins&gt;&amp;#039;&amp;#039; log files. For this, we would use a pipe and the grep command.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# So, now run &amp;#039;&amp;#039;&amp;#039;ls -al /var/log | grep debug&amp;#039;&amp;#039;&amp;#039;. Notice how the output is limited to all files that contain the string &amp;#039;&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dmesg&lt;/del&gt;&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# So, now run &amp;#039;&amp;#039;&amp;#039;ls -al /var/log | grep debug&amp;#039;&amp;#039;&amp;#039;. Notice how the output is limited to all files that contain the string &amp;#039;&amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;debug&lt;/ins&gt;&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* TIP: Grep is very powerful. Here we&amp;#039;re just using it to search for a string but you can use it to search regular expressions as well. We mentioned these in a previous lab too. You can learn more about regular expressions at [https://regexone.com RegexOne] and [https://www.regular-expressions.info Regular-Expressions.info] among many other places. These are frequently used in system administration and programming so it&amp;#039;s worth your while to get at least a basic understanding of them.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* TIP: Grep is very powerful. Here we&amp;#039;re just using it to search for a string but you can use it to search regular expressions as well. We mentioned these in a previous lab too. You can learn more about regular expressions at [https://regexone.com RegexOne] and [https://www.regular-expressions.info Regular-Expressions.info] among many other places. These are frequently used in system administration and programming so it&amp;#039;s worth your while to get at least a basic understanding of them.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Whats nice about pipes and redirects is that they can be used back to back on a command line creating a chain of programs which accept data as standard input and output it to the next program as standard output.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Whats nice about pipes and redirects is that they can be used back to back on a command line creating a chain of programs which accept data as standard input and output it to the next program as standard output.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BenFranske</name></author>
	</entry>
	<entry>
		<id>https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7263&amp;oldid=prev</id>
		<title>BenFranske: /* Command Output Manipulation */</title>
		<link rel="alternate" type="text/html" href="https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7263&amp;oldid=prev"/>
		<updated>2018-01-28T07:55:03Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Command Output Manipulation&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:55, 28 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l29&quot;&gt;Line 29:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use &amp;#039;&amp;#039;&amp;#039;cat&amp;#039;&amp;#039;&amp;#039; to verify the contents of &amp;#039;&amp;#039;listfiles.txt&amp;#039;&amp;#039; Notice how it contains the exact same output as running &amp;#039;&amp;#039;&amp;#039;ls -al&amp;#039;&amp;#039;&amp;#039; on the command line.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use &amp;#039;&amp;#039;&amp;#039;cat&amp;#039;&amp;#039;&amp;#039; to verify the contents of &amp;#039;&amp;#039;listfiles.txt&amp;#039;&amp;#039; Notice how it contains the exact same output as running &amp;#039;&amp;#039;&amp;#039;ls -al&amp;#039;&amp;#039;&amp;#039; on the command line.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Now, run &amp;#039;&amp;#039;&amp;#039;ls -al /var/log&amp;#039;&amp;#039;&amp;#039;. Notice how many files there are in the &amp;#039;&amp;#039;/var/log&amp;#039;&amp;#039; directory. Lets say we wanted to just know the information of the &amp;#039;&amp;#039;dmesg&amp;#039;&amp;#039; log files. For this, we would use a pipe and the grep command.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Now, run &amp;#039;&amp;#039;&amp;#039;ls -al /var/log&amp;#039;&amp;#039;&amp;#039;. Notice how many files there are in the &amp;#039;&amp;#039;/var/log&amp;#039;&amp;#039; directory. Lets say we wanted to just know the information of the &amp;#039;&amp;#039;dmesg&amp;#039;&amp;#039; log files. For this, we would use a pipe and the grep command.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# So, now run &amp;#039;&amp;#039;&amp;#039;ls -al /var/log | grep &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dmesg&lt;/del&gt;&amp;#039;&amp;#039;&amp;#039;. Notice how the output is limited to all files that contain the string &amp;#039;&amp;#039;dmesg&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# So, now run &amp;#039;&amp;#039;&amp;#039;ls -al /var/log | grep &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;debug&lt;/ins&gt;&amp;#039;&amp;#039;&amp;#039;. Notice how the output is limited to all files that contain the string &amp;#039;&amp;#039;dmesg&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* TIP: Grep is very powerful. Here we&amp;#039;re just using it to search for a string but you can use it to search regular expressions as well. We mentioned these in a previous lab too. You can learn more about regular expressions at [https://regexone.com RegexOne] and [https://www.regular-expressions.info Regular-Expressions.info] among many other places. These are frequently used in system administration and programming so it&amp;#039;s worth your while to get at least a basic understanding of them.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* TIP: Grep is very powerful. Here we&amp;#039;re just using it to search for a string but you can use it to search regular expressions as well. We mentioned these in a previous lab too. You can learn more about regular expressions at [https://regexone.com RegexOne] and [https://www.regular-expressions.info Regular-Expressions.info] among many other places. These are frequently used in system administration and programming so it&amp;#039;s worth your while to get at least a basic understanding of them.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Whats nice about pipes and redirects is that they can be used back to back on a command line creating a chain of programs which accept data as standard input and output it to the next program as standard output.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Whats nice about pipes and redirects is that they can be used back to back on a command line creating a chain of programs which accept data as standard input and output it to the next program as standard output.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BenFranske</name></author>
	</entry>
	<entry>
		<id>https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7262&amp;oldid=prev</id>
		<title>BenFranske: /* Text File Editing */</title>
		<link rel="alternate" type="text/html" href="https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7262&amp;oldid=prev"/>
		<updated>2018-01-28T06:58:40Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Text File Editing&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 06:58, 28 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# There are many different text editors available for Linux but systems almost always include some version of &amp;#039;&amp;#039;&amp;#039;vi&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;nano&amp;#039;&amp;#039;&amp;#039; so those are the two we&amp;#039;ll focus on. In your ssh window open the &amp;#039;&amp;#039;index.html&amp;#039;&amp;#039; file in nano by running &amp;#039;&amp;#039;&amp;#039;nano index.html&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# There are many different text editors available for Linux but systems almost always include some version of &amp;#039;&amp;#039;&amp;#039;vi&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;nano&amp;#039;&amp;#039;&amp;#039; so those are the two we&amp;#039;ll focus on. In your ssh window open the &amp;#039;&amp;#039;index.html&amp;#039;&amp;#039; file in nano by running &amp;#039;&amp;#039;&amp;#039;nano index.html&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#*: NOTE: Because your user does not own this file you may need to edit the file as the superuser.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#*: NOTE: Because your user does not own this file you may need to edit the file as the superuser.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The nano text editor is fairly simple to use and you should now see the contents of the &amp;#039;&amp;#039;index.html&amp;#039;&amp;#039; file on your screen. Try navigating around the file with your arrow keys and changing the &amp;quot;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;It works&lt;/del&gt;&amp;quot; text to &amp;quot;Welcome to My Linux Webserver&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The nano text editor is fairly simple to use and you should now see the contents of the &amp;#039;&amp;#039;index.html&amp;#039;&amp;#039; file on your screen. Try navigating around the file with your arrow keys and changing the &amp;quot;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Apache2 Debian Default Page&lt;/ins&gt;&amp;quot; text &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;at the top of the page &lt;/ins&gt;to &amp;quot;Welcome to My Linux Webserver&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Basic instructions for using nano abound on the Internet. You can get a basic introduction [http://staffwww.fullcoll.edu/sedwards/Nano/IntroToNano.html here] but it basically comes down to the menu lines at the bottom of the screen showing what your options are. The ^ character is commonly used to indicate the CTRL key so to exit the program (you will be prompted to save changes if you have made any) press CTRL-X or to save without exiting press CTRL-O and follow the prompts at the bottom of the screen.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Basic instructions for using nano abound on the Internet. You can get a basic introduction [http://staffwww.fullcoll.edu/sedwards/Nano/IntroToNano.html here] but it basically comes down to the menu lines at the bottom of the screen showing what your options are. The ^ character is commonly used to indicate the CTRL key so to exit the program (you will be prompted to save changes if you have made any) press CTRL-X or to save without exiting press CTRL-O and follow the prompts at the bottom of the screen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Save your file with the changed text and then reload the page in your browser on your host system to see if the changes have taken effect.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Save your file with the changed text and then reload the page in your browser on your host system to see if the changes have taken effect.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BenFranske</name></author>
	</entry>
	<entry>
		<id>https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7251&amp;oldid=prev</id>
		<title>BenFranske: /* Working With Filesystem Links */</title>
		<link rel="alternate" type="text/html" href="https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7251&amp;oldid=prev"/>
		<updated>2018-01-19T17:40:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Working With Filesystem Links&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:40, 19 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l69&quot;&gt;Line 69:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 69:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Working With Filesystem Links==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Working With Filesystem Links==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you get stuck or have any problems understanding how links are functioning in a certain way you can find a number of introductory tutorials [http://www.nixtutor.com/freebsd/understanding-symbolic-links/ like this one] or [http://www.thegeekstuff.com/2010/10/linux-ln-command-examples/ more advanced tutorials] on the Internet by searching for them.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you get stuck or have any problems understanding how links are functioning in a certain way you can find a number of introductory tutorials [http://www.nixtutor.com/freebsd/understanding-symbolic-links/ like this one] or [http://www.thegeekstuff.com/2010/10/linux-ln-command-examples/ more advanced tutorials] on the Internet by searching for them.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use root privileges to create a new directory in the root user&amp;#039;s home directory (remember this is /root and not /home/root) called &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;&lt;/del&gt;documentation&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot; &lt;/del&gt;and change the ownership permissions so that your standard user has permission to read, write, and execute as a member of a group which owns the documentation directory. You will also need to make sure that all system users have execute permission for the parent directory (/root) in order to access anything in it including the documentation directory.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use root privileges to create a new directory in the root user&amp;#039;s home directory (remember this is &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;/root&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039; &lt;/ins&gt;and not &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;/home/root&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;) called &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039; &lt;/ins&gt;and change the ownership permissions so that your standard user has permission to read, write, and execute as a member of a group which owns the documentation directory. You will also need to make sure that all system users have execute permission for the parent directory (&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;/root&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;) in order to access anything in it including the documentation directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Instead of needing to go into the /root/documentation directory all the time it would be more convenient if your user was able to reach that directory through a link in their own home directory. Run the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;&lt;/del&gt;ln -s /root/documentation documentation&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot; &lt;/del&gt;command inside your regular user&amp;#039;s home directory (or if you&amp;#039;re in a different working directory you can run the command as &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;&lt;/del&gt;ln -s /root/documentation ~/documentation&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot; do &lt;/del&gt;you understand why?)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Instead of needing to go into the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;/root/documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039; &lt;/ins&gt;directory all the time it would be more convenient if your user was able to reach that directory through a link in their own home directory. Run the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;&lt;/ins&gt;ln -s /root/documentation documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039; &lt;/ins&gt;command inside your regular user&amp;#039;s home directory (or if you&amp;#039;re in a different working directory you can run the command as &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;&lt;/ins&gt;ln -s /root/documentation ~/documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039; Do &lt;/ins&gt;you understand why?)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# You should now see a soft link (also called symlink) in your home directory called documentation which points to the /root/documentation folder.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# You should now see a soft link (also called symlink) in your home directory called documentation which points to the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;/root/documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039; &lt;/ins&gt;folder.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# You should be able to cd into the link just like it was a real directory. In fact, if you use the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;&lt;/del&gt;pwd&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot; &lt;/del&gt;command to print your working directory while inside the link it will look like it&amp;#039;s a directory. Almost all software on the system will interact with the link &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jsut &lt;/del&gt;as if it&amp;#039;s a real directory.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# You should be able to &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;&lt;/ins&gt;cd&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039; &lt;/ins&gt;into the link just like it was a real directory. In fact, if you use the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;&lt;/ins&gt;pwd&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039; &lt;/ins&gt;command to print your working directory while inside the link it will look like it&amp;#039;s a directory. Almost all software on the system will interact with the link &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;just &lt;/ins&gt;as if it&amp;#039;s a real directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Try creating some files and subdirectories inside of the link and then verify they are showing up in the real /root/documentation location as well. This should work correctly if your permissions are all set correctly.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Try creating some files and subdirectories inside of the link and then verify they are showing up in the real &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;/root/documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039; &lt;/ins&gt;location as well. This should work correctly if your permissions are all set correctly.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If you remove the link (rm ~/documentation) from your home directory you should see that all of the files you created are still in /root/documentation&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If you remove the link (&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;&lt;/ins&gt;rm ~/documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;&lt;/ins&gt;) from your home directory you should see that all of the files you created are still in &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;/root/documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If you re-create the link you should be able to go back into ~/documentation and remove files and directories and see they are removed from the actual /root/documentation directory as well&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If you re-create the link you should be able to go back into &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;~/documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039; &lt;/ins&gt;and remove files and directories and see they are removed from the actual &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;/root/documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039; &lt;/ins&gt;directory as well&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# You can also practice creating links to specific files as well as directories. Links do not override permissions so you need to have permission to read, write or execute the file or directory you are linking to just like if you actually changed to the real location of the item. Go ahead and practice creating and removing links until you have a good understanding of how links can be used.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# You can also practice creating links to specific files as well as directories. Links do not override permissions so you need to have permission to read, write or execute the file or directory you are linking to just like if you actually changed to the real location of the item. Go ahead and practice creating and removing links until you have a good understanding of how links can be used.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Note: If you are using &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;TAR &lt;/del&gt;to back up data, depending on exactly what you want to do you may want to use the -h or --dereference option which will follow the symlink and backup the data it contains. Normal behavior for tar would just be to back up the link, not the file(s) pointed to by the link. You should try creating some tar files of directories which contain symlinks, deleting the data the symlink points to and the extracting the tar file to some new location to see this in action if you are not confident that you understand this.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Note: If you are using &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; &lt;/ins&gt;to back up data, depending on exactly what you want to do you may want to use the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;-h&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039; &lt;/ins&gt;or &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;--dereference&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039; &lt;/ins&gt;option which will follow the symlink and backup the data it contains. Normal behavior for tar would just be to back up the link &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;itslef&lt;/ins&gt;, not the file(s) pointed to by the link. You should try creating some tar files of directories which contain symlinks, deleting the data the symlink points to and the extracting the tar file to some new location to see this in action if you are not confident that you understand this.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BenFranske</name></author>
	</entry>
	<entry>
		<id>https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7250&amp;oldid=prev</id>
		<title>BenFranske: /* Creating Archived/Compressed Files */</title>
		<link rel="alternate" type="text/html" href="https://wiki.ihitc.net/mediawiki/index.php?title=Franske_ITC-2480_Lab_4&amp;diff=7250&amp;oldid=prev"/>
		<updated>2018-01-19T17:37:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Creating Archived/Compressed Files&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:37, 19 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l65&quot;&gt;Line 65:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 65:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Switch back to your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory (hint, can you do this with a shortcut?) and then try extracting the files from &amp;#039;&amp;#039;logbackup2.tar.gz&amp;#039;&amp;#039; into your experiments directory, do not show a list of files as they are extracted this time.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Switch back to your &amp;#039;&amp;#039;experiments&amp;#039;&amp;#039; directory (hint, can you do this with a shortcut?) and then try extracting the files from &amp;#039;&amp;#039;logbackup2.tar.gz&amp;#039;&amp;#039; into your experiments directory, do not show a list of files as they are extracted this time.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Check the contents of your experiments directory. This time you should again see that there is just one new subdirectory called &amp;#039;&amp;#039;log&amp;#039;&amp;#039; and all of the files are neatly placed inside of it.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Check the contents of your experiments directory. This time you should again see that there is just one new subdirectory called &amp;#039;&amp;#039;log&amp;#039;&amp;#039; and all of the files are neatly placed inside of it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# There are a number of other things you can do with &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; such as creating slower but more highly compressed .bz2 bzip files, extracting single files (or directories or groups of files) from an archive, listing the contents of an archive without extracting (which can show you if a new subdirectory will be created), adding files to an existing archive, and preserving file ownership (only by extracting on the same system though) and permissions. You should read the manual page for tar and then try practicing some of these and be familiar with the many ways that tar can be used.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# There are a number of other things you can do with &amp;#039;&amp;#039;&amp;#039;tar&amp;#039;&amp;#039;&amp;#039; such as creating slower but more highly compressed .bz2 bzip files, extracting single files (or directories or groups of files) from an archive, listing the contents of an archive without extracting (which can show you if a new subdirectory will be created), adding files to an existing archive, and preserving file ownership (only by extracting on the same system though) and permissions. You should read the manual page for tar and then try practicing some of these and be familiar with the many ways that &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;&lt;/ins&gt;tar&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039; &lt;/ins&gt;can be used.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Working With Filesystem Links==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Working With Filesystem Links==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BenFranske</name></author>
	</entry>
</feed>