<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://teaching.healthtech.dtu.dk/22126/index.php?action=history&amp;feed=atom&amp;title=Basic_UNIX_notes</id>
	<title>Basic UNIX notes - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://teaching.healthtech.dtu.dk/22126/index.php?action=history&amp;feed=atom&amp;title=Basic_UNIX_notes"/>
	<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk/22126/index.php?title=Basic_UNIX_notes&amp;action=history"/>
	<updated>2026-04-27T16:48:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://teaching.healthtech.dtu.dk/22126/index.php?title=Basic_UNIX_notes&amp;diff=216&amp;oldid=prev</id>
		<title>Mick: Created page with &quot;=== Introduction to UNIX === UNIX refers to a family of multitasking, multi-user operating systems that originated from AT&amp;T Unix (Bell Labs, 1969). Many modern operating systems are UNIX-like and inherit its core principles of stability, flexibility, and powerful command-line tools.  Although UNIX may appear complex at first, it is essential in bioinformatics and NGS analysis. Most tools you will use in this course (and in real research) run exclusively on the command l...&quot;</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk/22126/index.php?title=Basic_UNIX_notes&amp;diff=216&amp;oldid=prev"/>
		<updated>2025-11-20T09:02:38Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=== Introduction to UNIX === UNIX refers to a family of multitasking, multi-user operating systems that originated from AT&amp;amp;T Unix (Bell Labs, 1969). Many modern operating systems are UNIX-like and inherit its core principles of stability, flexibility, and powerful command-line tools.  Although UNIX may appear complex at first, it is essential in bioinformatics and NGS analysis. Most tools you will use in this course (and in real research) run exclusively on the command l...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== Introduction to UNIX ===&lt;br /&gt;
UNIX refers to a family of multitasking, multi-user operating systems that originated from AT&amp;amp;T Unix (Bell Labs, 1969). Many modern operating systems are UNIX-like and inherit its core principles of stability, flexibility, and powerful command-line tools.&lt;br /&gt;
&lt;br /&gt;
Although UNIX may appear complex at first, it is essential in bioinformatics and NGS analysis. Most tools you will use in this course (and in real research) run exclusively on the command line.&lt;br /&gt;
&lt;br /&gt;
=== Accessing UNIX ===&lt;br /&gt;
You can access a UNIX shell in several ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Windows&amp;#039;&amp;#039;&amp;#039;: Install [https://mobaxterm.mobatek.net/ MobaXTerm] (recommended).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Mac&amp;#039;&amp;#039;&amp;#039;: macOS is UNIX-based; use the built-in &amp;#039;&amp;#039;&amp;#039;Terminal&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Linux&amp;#039;&amp;#039;&amp;#039;: Most Linux distributions include a terminal by default.&lt;br /&gt;
&lt;br /&gt;
Opening the terminal launches a **shell**, where you enter commands.&lt;br /&gt;
&lt;br /&gt;
=== The Shell ===&lt;br /&gt;
The shell is your interface to the operating system. A prompt shows that it is ready for input. Examples:&lt;br /&gt;
&lt;br /&gt;
* `aix4(s010178) $`&lt;br /&gt;
* `interaction[pws]:/home/people/pws&amp;gt;`&lt;br /&gt;
* `pws@antros:~$`&lt;br /&gt;
&lt;br /&gt;
Prompts may differ between systems and shell types (bash, zsh, etc.).&lt;br /&gt;
&lt;br /&gt;
Useful shortcuts:&lt;br /&gt;
* Press &amp;#039;&amp;#039;&amp;#039;TAB&amp;#039;&amp;#039;&amp;#039; to autocomplete commands and file names.&lt;br /&gt;
* Press &amp;#039;&amp;#039;&amp;#039;↑/↓&amp;#039;&amp;#039;&amp;#039; to scroll through command history.&lt;br /&gt;
* Press &amp;#039;&amp;#039;&amp;#039;Ctrl + R&amp;#039;&amp;#039;&amp;#039; to search your command history.&lt;br /&gt;
* Press &amp;#039;&amp;#039;&amp;#039;Ctrl + C&amp;#039;&amp;#039;&amp;#039; to cancel a running command.&lt;br /&gt;
* Press &amp;#039;&amp;#039;&amp;#039;q&amp;#039;&amp;#039;&amp;#039; to exit `less`, `man`, and similar programs.&lt;br /&gt;
&lt;br /&gt;
=== File System Basics ===&lt;br /&gt;
In this guide, placeholders like `&amp;lt;filename&amp;gt;` mean “replace this with your file name” (e.g., `mydata.txt`).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Naming conventions:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Avoid spaces and special characters in file/directory names.&lt;br /&gt;
* Safe characters:&lt;br /&gt;
** `a-z`&lt;br /&gt;
** `A-Z`&lt;br /&gt;
** `0-9.-_`&lt;br /&gt;
* UNIX is case-sensitive: `file.txt` ≠ `File.txt`&lt;br /&gt;
* File extensions are optional but recommended.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Navigation:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* `pwd` – show current directory&lt;br /&gt;
* `ls -l` – list files with details&lt;br /&gt;
* `cd &amp;lt;directory&amp;gt;` – change directory&lt;br /&gt;
* `mkdir &amp;lt;name&amp;gt;` – create directory&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Viewing files:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* `cat &amp;lt;file&amp;gt;`&lt;br /&gt;
* `less &amp;lt;file&amp;gt;`&lt;br /&gt;
* `head &amp;lt;file&amp;gt;`&lt;br /&gt;
* `tail &amp;lt;file&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Be careful with:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* `rm &amp;lt;file&amp;gt;` – permanently deletes files&lt;br /&gt;
* `rm -rf &amp;lt;directory&amp;gt;` – recursively deletes directories (&amp;#039;&amp;#039;&amp;#039;NO UNDO&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== File Permissions ===&lt;br /&gt;
Each file has permissions for:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;User&amp;#039;&amp;#039;&amp;#039; – the owner  &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Group&amp;#039;&amp;#039;&amp;#039; – users in the same group  &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Others&amp;#039;&amp;#039;&amp;#039; – everyone else  &lt;br /&gt;
&lt;br /&gt;
Permissions:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Read (r)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Write (w)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Execute (x)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Example from `ls -l`:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-rwxr--r-- 1 root sys 113520 Sep 5 14:15 good_program&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Directory example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
drwxr-xr-x 6 gorm user 72 Jun 26 23:50 gorm_directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Directory meanings:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;r&amp;#039;&amp;#039;&amp;#039; – list directory contents  &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;w&amp;#039;&amp;#039;&amp;#039; – create/delete files inside  &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;x&amp;#039;&amp;#039;&amp;#039; – enter the directory  &lt;br /&gt;
&lt;br /&gt;
=== Basic Input/Output and Pipes (brief introduction) ===&lt;br /&gt;
Every UNIX command interacts with three “streams”:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;stdin&amp;#039;&amp;#039;&amp;#039; – input (keyboard by default)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;stdout&amp;#039;&amp;#039;&amp;#039; – normal output&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;stderr&amp;#039;&amp;#039;&amp;#039; – error messages&lt;br /&gt;
&lt;br /&gt;
You can redirect them:&lt;br /&gt;
&lt;br /&gt;
* Redirect stdout: `command &amp;gt; out.txt`&lt;br /&gt;
* Redirect stderr: `command 2&amp;gt; errors.txt`&lt;br /&gt;
* Redirect stdin:  `command &amp;lt; input.txt`&lt;br /&gt;
* Append instead of overwrite: `&amp;gt;&amp;gt;`&lt;br /&gt;
* Pipe output of one command into another:  &lt;br /&gt;
  `command1 | command2`&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls | wc -l      # count files&lt;br /&gt;
grep HUMAN ex1.acc | sort | uniq -c&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a deeper explanation of pipes, file descriptors, and redirection, see the advanced page:  &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[Advanced UNIX and Pipes]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== Common UNIX Commands ===&lt;br /&gt;
Use `man &amp;lt;command&amp;gt;` to read manual pages.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
* `man ls`&lt;br /&gt;
* `man grep`&lt;br /&gt;
&lt;br /&gt;
You will learn additional commands during the exercises and project work.&lt;br /&gt;
&lt;br /&gt;
For a more complete list, see the  &lt;br /&gt;
[https://teaching.healthtech.dtu.dk/unix/index.php/Commands_summary UNIX Commands Summary].&lt;/div&gt;</summary>
		<author><name>Mick</name></author>
	</entry>
</feed>