The basic command interpreter on the machine (and most often found on a linux machine) is `bash`.
> Bash is a command processor that typically runs in a text window, where the user types commands that cause actions. Bash can also read commands from a file, called a script. Like all Unix shells, it supports filename globbing (wildcard matching), piping, here documents, command substitution, variables and control structures for condition-testing and iteration. The keywords, syntax and other basic features of the language were all copied from sh. Other features, e.g., history, were copied from csh and ksh. Bash is a POSIX shell, but with a number of extensions.
> RTFM is an initialism for the expression "read the fucking manual" or, in the context of the Unix computer operating system, "read the fucking man page". The RTFM comment is usually expressed when the speaker is irritated by another person's question or lack of knowledge. It refers to either that person's inability to read a technical manual, or to their perceived laziness in not doing so first, before asking the question.
The official `bash` documentation: [documentation]( https://www.gnu.org/software/bash/manual/ )
## RTFM: getting help with `man`
> A man page (short for manual page) is a form of software documentation usually found on a Unix or Unix-like operating system. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts. A user may invoke a man page by issuing the man command.
| `man <command>` | prints manual for the `command` command |
For example, to get the manual page for the `man` command:
```bash
man man
```
## RTFM: getting help with `-h` or `--help`
When there is no man page associated to a command one can use the `-h` or `--help` options:
For example, to get the help associated to the `man` command:
```bash
man --help
```
# Filesystem -- basic commands and streams
{ width=40% }
## Absolute path
> An absolute or full path points to the same location in a file system, regardless of the current working directory. To do that, it must include the root directory.
| `cp <filename> <filename>` | copy files or directories |
| `mv <filename> <filename>` | move files or directories |
| `rm <filename>` | remove files or directories |
## Permissions
Files and directories are assigned permissions or access rights to specific users and groups of users. The permissions control the ability of the users to view, change, navigate, and execute the contents of the file system.
> Permissions on Unix-like systems are managed in three distinct scopes or classes.
> These scopes are known as user, group, and others.
| `sed <command> <filename>` | process file line by line for basic editing |
| `grep [options] <regular expression> <filenames>` | search files for a *pattern* |
| `egrep [options] <extended regular expression> <filenames>` | similar as using the `-e` option of `grep` |
## `Unix` streams
> In computer programming, standard streams are pre-connected input and output channels that allow communication between a computer program and its environment when the program begins execution.
> The three I/O connections are called standard input (`stdin`), standard output (`stdout`) and standard error (`stderr`).
A basic `Unix` command: Piping a stream into another command> [wikipedia:streams](https://en.wikipedia.org/wiki/Standard_streams)
## A basic `Unix` command
{ width=50% }
standard input (`stdin`), standard output (`stdout`), standard error (`stderr`) and parameters don't need to be specified.
By default, `stdin` is empty, `stdout` and `stderr` output their content to the terminal.
- `ngsfilter`: Assigns sequence records to the corresponding experiment/sample based on DNA tags and primers
- `obiclean`: tags a set of sequences for PCR/sequencing errors identification
- `obiuniq`: groups and dereplicates sequences
- Sequence sampling and filtering
- `obigrep`: filters sequence file
- `obihead`: extracts the first sequence records
- Statistics over sequence file
- `obicount`: counts the number of sequence records
- `obistat`: computes basic statistics for attribute values
## Regular expressions: Regex
> In computing, a regular expression is a specific pattern that provides concise and flexible means to "match" (specify and recognize) strings of text, such as particular characters, words, or patterns of characters.
>
> Common abbreviations for "regular expression" include regex and regexp.
| `([ACGT]{3})\1{9,}` (matching a stretch of at least the same codon 10 times) | As the langage described is not regular, no automaton can be used to represent the expression |
[What is my regular expression engine capable of ?](https://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines)
## Regular expressions and `obigrep`
Regular expressions can be used with `obigrep` to filter sequences with the appropriate options: