meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| general:computerenvironment:shell_basic_commands [2019/12/01 21:34] – ruben | general:computerenvironment:shell_basic_commands [2020/09/07 18:20] (current) – [If / Else] ingo | ||
|---|---|---|---|
| Line 19: | Line 19: | ||
| Remember to call the file only in the first command given: | Remember to call the file only in the first command given: | ||
| cat ejemplo.txt | grep " | cat ejemplo.txt | grep " | ||
| + | |||
| + | ---- | ||
| + | Tip: You can create this file with: | ||
| + | < | ||
| + | nano ejemplo.txt | ||
| + | </ | ||
| + | paste the contents of the ejemplo file into the nano editor and close it using STRG/CMD + X | ||
| + | |||
| + | Alternatively you can download the file by clicking on its name and do the exercises in a linux environment on your local computer (for example using mobaXterm on windows, or in the command line on macOS). | ||
| + | ---- | ||
| + | |||
| ===== Reading files + counting lines ===== | ===== Reading files + counting lines ===== | ||
| Line 42: | Line 53: | ||
| </ | </ | ||
| + | ---- | ||
| + | |||
| + | ===== Tab completion ===== | ||
| + | |||
| + | You can auto-complete paths by pressing the tab key once or twice anytime while writing a path. If the auto-completion does not work, there might be something wrong with your path.. | ||
| + | |||
| + | You can check out [[https:// | ||
| ---- | ---- | ||
| Line 161: | Line 179: | ||
| If a directory does not exist, ' | If a directory does not exist, ' | ||
| <hidden Grep and quotations> | <hidden Grep and quotations> | ||
| + | Trying to find all ">" | ||
| + | <file txt important_sequence.fasta> | ||
| + | > | ||
| + | AAATTCTCACCCCTCAGAAA | ||
| + | > | ||
| + | ACCTCAGAAAAATTCTCACC | ||
| + | </ | ||
| < | < | ||
| - | echo -e $"> | ||
| - | cat important_sequence.fasta | ||
| grep > important_sequence.fasta | grep > important_sequence.fasta | ||
| </ | </ | ||
| Line 189: | Line 212: | ||
| ---- | ---- | ||
| - | ====== | + | ====== |
| ===== For-loop ===== | ===== For-loop ===== | ||
| Line 217: | Line 240: | ||
| <hidden Exercise> | <hidden Exercise> | ||
| - | Find the lines that contain " | + | Find the lines that contain " |
| This means, each file should look like this: | This means, each file should look like this: | ||
| <file txt a.txt> | <file txt a.txt> | ||
| Line 224: | Line 247: | ||
| axaxa bxbxb | axaxa bxbxb | ||
| </ | </ | ||
| - | </ | ||
| Hint: let me start the command for you: | Hint: let me start the command for you: | ||
| < | < | ||
| for i in a b c; do ... | for i in a b c; do ... | ||
| </ | </ | ||
| + | </ | ||
| + | |||
| ---- | ---- | ||
| Line 271: | Line 295: | ||
| * -gt = is greater than | * -gt = is greater than | ||
| * -lt = is lesser than | * -lt = is lesser than | ||
| + | |||