Skip to content
Back to skills

Foundations Linux Fundamentals

BSecurity

Linux command-line essentials for bioinformatics: navigation, file ops, pipes, grep, file format inspection, and vim survival guide.

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 27, 2026
data-aipythonshellbash

Security analysis

B85/100
  • highPerforms destructive filesystem operations

Pro shows the line behind each finding and how to fix it

Scanned May 27, 2026

npx -y skills add Pavel-Kravchenko/Bioinformatics --skill foundations-linux-fundamentals --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Foundations Linux Fundamentals?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Foundations Linux Fundamentals
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/pavel-kravchenko-foundations-linux-fundamentals/badge)](https://www.skillsdirectory.com/skills/pavel-kravchenko-foundations-linux-fundamentals)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: foundations-linux-fundamentals
description: "Linux command-line essentials for bioinformatics: navigation, file ops, pipes, grep, file format inspection, and vim survival guide."
tool_type: python
primary_tool: Python
---

# Linux Fundamentals for Bioinformatics

## Pitfalls

- **Spaces around `=` in Bash:** `var = value` is wrong; `var=value` is right. The space makes Bash interpret `var` as a command.
- **`rm` is permanent:** No trash bin. Always double-check before `rm -rf`. Never run `rm -rf /` or `rm -rf ~`.
- **Pipes discard stderr:** `cmd1 | cmd2` only passes stdout. Add `2>&1` to also pipe error messages.
- **Wildcards expand before the command runs:** `rm *.fastq` — the shell does the glob expansion, not `rm`. If no files match, you get an error (not a no-op).
- **Relative vs absolute paths:** Scripts run from cron or other directories need absolute paths.
- **Compressed files:** Use `zcat`/`zgrep`/`zless` for `.gz` files; never decompress just to inspect.

## Navigation

| Symbol | Meaning |
|---|---|
| `/` | Root of filesystem |
| `~` | Home directory |
| `.` | Current directory |
| `..` | Parent directory |
| `-` | Previous directory (`cd -`) |

```bash
pwd           # where am I
ls -lah       # long + hidden + human sizes — daily driver
cd -          # back to previous directory
```

## File Operations

```bash
# Create project structure
mkdir -p RNA_Seq/{00_raw,01_qc,02_trimmed,03_aligned,04_counts,scripts,logs}

# Copy, move, delete
cp -r src_dir/ dest_dir/        # -r required for directories
mv old.txt new.txt              # rename
rm -rf directory/               # permanent — no undo

# Inspect without decompressing
zcat sample.fastq.gz | head -8  # first 2 reads (4 lines each)
zgrep "PASS" variants.vcf.gz    # grep compressed file
```

## Viewing Files

```bash
head -n 4 reads.fastq    # first FASTQ read (4 lines per read)
tail -f pipeline.log     # follow log in real time
wc -l file.txt           # count lines
wc -c file.txt           # count bytes
less large.bam           # interactive scroll (q=quit, /=search)
```

## Bioinformatics File Formats

| Format | Extension | Content |
|---|---|---|
| FASTA | `.fa`, `.fasta` | Sequences (genome, protein) |
| FASTQ | `.fq`, `.fastq.gz` | Reads + quality scores (4 lines/read) |
| SAM/BAM | `.sam`, `.bam` | Alignments (BAM = binary SAM) |
| BED | `.bed` | Genomic intervals (0-based half-open) |
| VCF | `.vcf` | Variant calls (1-based) |
| GFF/GTF | `.gff`, `.gtf` | Gene annotations (1-based) |

## Pipes and Redirection

```bash
# Operators
>    # redirect stdout (overwrite)
>>   # redirect stdout (append)
2>   # redirect stderr
2>&1 # merge stderr into stdout
|    # pipe stdout to next command's stdin

# Common bioinformatics pipelines
grep -c "^>" proteins.fasta            # count FASTA sequences
zcat sample.fastq.gz | wc -l | awk '{print $1/4, "reads"}'  # count reads
grep -v "^#" variants.vcf | cut -f1 | sort | uniq -c        # variants per chr
cut -f1 regions.bed | sort | uniq -c | sort -rn              # regions per chr
```

## grep Quick Reference

```bash
grep -c "^>" genome.fa          # count sequences in FASTA
grep -v "^#" variants.vcf       # strip VCF header
grep "BRCA1" gencode.gtf        # find gene in annotation
grep -B 1 "GAATTC" seqs.fasta   # show header above EcoRI site
zgrep "PASS" variants.vcf.gz    # grep inside .gz
grep -r "error" logs/           # recursive search
```

## Vim Survival Guide

```
vim filename    open file
i               insert mode (type text)
Esc             back to normal mode
:w              save
:q              quit
:wq             save and quit
:q!             quit without saving
/pattern        search forward
n / N           next / previous match
dd              delete line
u               undo
:%s/old/new/g   replace all occurrences
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…