<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://teaching.healthtech.dtu.dk/22113/index.php?action=history&amp;feed=atom&amp;title=Unix</id>
	<title>Unix - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://teaching.healthtech.dtu.dk/22113/index.php?action=history&amp;feed=atom&amp;title=Unix"/>
	<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk/22113/index.php?title=Unix&amp;action=history"/>
	<updated>2026-06-06T11:28:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://teaching.healthtech.dtu.dk/22113/index.php?title=Unix&amp;diff=22&amp;oldid=prev</id>
		<title>WikiSysop: Created page with &quot;__NOTOC__ {| width=500  style=&quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&quot; |Previous: None |Next: Python Recap and Objects |}  You did do the Course preparation, right!! Otherwise all of this matters not.  == Required course material for the lesson == Powerpoint: [https://teaching.healthtech.dtu.dk/material/22113/22113_01-Unix.ppt Introduction to Unix]&lt;br&gt; The videos are not entirely in sync with the powerpoint, as it has been updated.&lt;br...&quot;</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk/22113/index.php?title=Unix&amp;diff=22&amp;oldid=prev"/>
		<updated>2024-03-06T13:36:11Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ {| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot; |Previous: None |Next: &lt;a href=&quot;/22113/index.php/Python_Recap_and_Objects&quot; title=&quot;Python Recap and Objects&quot;&gt;Python Recap and Objects&lt;/a&gt; |}  You did do the &lt;a href=&quot;/22113/index.php/Course_preparation&quot; title=&quot;Course preparation&quot;&gt;Course preparation&lt;/a&gt;, right!! Otherwise all of this matters not.  == Required course material for the lesson == Powerpoint: [https://teaching.healthtech.dtu.dk/material/22113/22113_01-Unix.ppt Introduction to Unix]&amp;lt;br&amp;gt; The videos are not entirely in sync with the powerpoint, as it has been updated.&amp;lt;br...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: None&lt;br /&gt;
|Next: [[Python Recap and Objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You did do the [[Course preparation]], right!! Otherwise all of this matters not.&lt;br /&gt;
&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22113/22113_01-Unix.ppt Introduction to Unix]&amp;lt;br&amp;gt;&lt;br /&gt;
The videos are not entirely in sync with the powerpoint, as it has been updated.&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=110b2544-db60-4491-95cd-af270127f161 Unix intro and navigation] Monday&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=88cb52db-1c77-4a98-94db-af270127d0dc Coping, Moving, Renaming files. Changing permissions] Monday&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=fa98c15f-5c50-4ea3-8c85-af270127aedf Using shortcuts in Unix - making it easier] Monday&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=7f775d1b-2788-45ee-b4ac-af2701279221 File inspection and editor in unix. 1½ min silence at the end] Monday&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=16f1e9bd-8044-4a97-b033-af27012771e2 Manipulating files: wc, paste, cut &amp;amp; sort] Monday&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=5ecff806-b2de-42f7-ab97-af2701274f66 Manipulating files: grep and pipelines] Monday&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=0679c534-a422-4ed6-9f52-af27012730b2 Touching upon various relevant subjects] Monday&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [https://teaching.healthtech.dtu.dk/unix The resource on Unix for many courses at Health Tech]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Biological knowledge needed in the course]]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [http://www.ee.surrey.ac.uk/Teaching/Unix/ UNIX Tutorial for Beginners] from University of Surrey&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [http://www.tutorialspoint.com/unix/ UNIX/LINUX Tutorial] from TutorialsPoint&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Basic file handling in UNIX.&lt;br /&gt;
* Understanding and navigating the file system.&lt;br /&gt;
* Many different Unix commands&lt;br /&gt;
* Scripting in bash&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
Use a text editor to to create a file mycommands.txt where you write all commands and observations you do in the following exercises. Use copy/paste to copy the commands.&amp;lt;br&amp;gt;&lt;br /&gt;
Note: Make sure that we can easily see which exercise you attempt to solve.&amp;lt;br&amp;gt;&lt;br /&gt;
Note: You should work from your home directory, or a work directory that you specify explicitly in the top of your hand-in.&amp;lt;br&amp;gt;&lt;br /&gt;
Note: Data files can be found in the [[collection of files]].&lt;br /&gt;
&lt;br /&gt;
===Exercises to do after Monday===&lt;br /&gt;
It is assumed that you have downloaded the 3 files; ex1.dat, ex1.acc and orphans.sp before you start the exercises&lt;br /&gt;
# First list the files in the directory.&lt;br /&gt;
# Copy &amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039; to &amp;#039;&amp;#039;myfile.acc&amp;#039;&amp;#039;.&lt;br /&gt;
# Look at the content of both files to ensure they are identical.&lt;br /&gt;
# Copy &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; to &amp;#039;&amp;#039;myfile.acc&amp;#039;&amp;#039;.&lt;br /&gt;
# Check that the content of &amp;#039;&amp;#039;myfile.acc&amp;#039;&amp;#039; changed.&lt;br /&gt;
# Delete &amp;#039;&amp;#039;myfile.acc&amp;#039;&amp;#039;.&lt;br /&gt;
# Make a directory &amp;#039;&amp;#039;test&amp;#039;&amp;#039; and move the three files to it.&lt;br /&gt;
# Make a directory &amp;#039;&amp;#039;data&amp;#039;&amp;#039; and move the three files to that instead.&lt;br /&gt;
# Remove &amp;#039;&amp;#039;test&amp;#039; directory.&lt;br /&gt;
# Change directory to &amp;#039;&amp;#039;data&amp;#039;&amp;#039; and confirm that you succeeded. Go back to the home/work directory afterwards.&lt;br /&gt;
# Make three new directories &amp;#039;&amp;#039;newtest&amp;#039;&amp;#039; - one inside the other, like a Russian doll.&lt;br /&gt;
# Move the data directory to the innermost &amp;#039;&amp;#039;newtest&amp;#039;&amp;#039; directory.&lt;br /&gt;
# Confirm that the three files are moved along with the data directory.&lt;br /&gt;
# Copy the three files to your home (your top directory).&lt;br /&gt;
# Remove all &amp;#039;&amp;#039;newtest&amp;#039;&amp;#039; directories and &amp;#039;&amp;#039;data&amp;#039;&amp;#039; in the with a single command.&lt;br /&gt;
# Count the lines in &amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039; and &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039;.&lt;br /&gt;
# Con&amp;#039;&amp;#039;&amp;#039;cat&amp;#039;&amp;#039;&amp;#039;enate &amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039; and &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; in the file &amp;#039;&amp;#039;ex1.tot&amp;#039;&amp;#039;, i.e. copy the content of two files into one new file. Verify that all gene IDs comes first followed by numerical data.&lt;br /&gt;
# Merge/Paste &amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039; and &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; together in &amp;#039;&amp;#039;ex1.tot&amp;#039;&amp;#039;, thus destroying the old file. Verify that corresponding gene IDs and numerical data are put on the same line as the data.&lt;br /&gt;
# Extract (cut) SwissProt ID and 3nd numerical data (column 1 and 5) from &amp;#039;&amp;#039;ex1.tot&amp;#039;&amp;#039;. Put results into a file &amp;#039;&amp;#039;ex1.res&amp;#039;&amp;#039;.&lt;br /&gt;
# Find the 3 SwissProt ID&amp;#039;s in &amp;#039;&amp;#039;ex1.res&amp;#039;&amp;#039; which have the largest number(s) in column 2, i.e. the top 3 entries. Display only the ID&amp;#039;s.&lt;br /&gt;
# Find the lines (using grep) in &amp;#039;&amp;#039;orphans.sp&amp;#039;&amp;#039; which contain a GenBank accession number. There are 85, verify this. Note: An accession number is one or two capital letters and looks like this &amp;#039;AB000114.CDS.1&amp;#039;, i.e. Some letters followed by some numbers. The .CDS. part is kind of optional.&lt;br /&gt;
# How many human genes with SwissProt IDs in &amp;#039;&amp;#039;orphans.sp&amp;#039;&amp;#039; exist ? How many of those are hypothetical ? (11)&lt;br /&gt;
# How many genes belong to the rat, and how many of those are precursors ? (9) Note: A Swissprot ID looks like &amp;#039;PARG_HUMAN&amp;#039; or &amp;#039;TF1A_MOUSE&amp;#039;, with the gene being before the underscore and the organism after the underscore.&lt;br /&gt;
# From the file &amp;#039;&amp;#039;ex1.res&amp;#039;&amp;#039; find the lines with positive numbers and put then into &amp;#039;&amp;#039;ex1.pos&amp;#039;&amp;#039;. The lines with negative number go into &amp;#039;&amp;#039;ex1.neg&amp;#039;&amp;#039;.&lt;br /&gt;
# Calculate ((356+51)*123-12765)/56 on the command line.&lt;br /&gt;
&lt;br /&gt;
===Exercises to do after Thursday===&lt;br /&gt;
&amp;lt;ol start=&amp;quot;26&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Go back to exercise 2 &amp;amp; 3. Check if the files are changed, using &amp;#039;&amp;#039;&amp;#039;diff&amp;#039;&amp;#039;&amp;#039; this time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In the &amp;#039;&amp;#039;myfile.acc&amp;#039;&amp;#039; (copy of &amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;) change all occurrences of SPC to BLNK, using &amp;#039;&amp;#039;&amp;#039;sed&amp;#039;&amp;#039;&amp;#039;. Check if the files are changed, using &amp;#039;&amp;#039;&amp;#039;diff&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;li&amp;gt;What is the path to the &amp;#039;&amp;#039;&amp;#039;bash&amp;#039;&amp;#039;&amp;#039; command?&lt;br /&gt;
&amp;lt;li&amp;gt;Write a bash shell script that solves exercise 19-24, with the exercises clearly separated and explained in both the script and the output. &amp;quot;42&amp;quot; is unclear, but &amp;quot;Number of genes: 42&amp;quot; is clear. This should be straight forward (but long), especially since you wrote down what you did.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Write a bash shell script that puts all the positive numbers in the file &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; into a file &amp;#039;&amp;#039;ex1.pos2&amp;#039;&amp;#039;, and all the negative numbers into a file &amp;#039;&amp;#039;ex1.neg2&amp;#039;&amp;#039;. Column position does not matter. The script must clean up after itself, so if any temporary files are used, they must be deleted as the last action. Put the date and a description of the files in the first lines of the resulting output files.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Write a bash shell script that calculates the total number of lines for all files in the directory mentioned on the command line as argument. No argument means current directory. Misleading hint: &amp;#039;&amp;#039;&amp;#039;cut&amp;#039;&amp;#039;&amp;#039; can split on other than tab.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
</feed>