# DBT JRF 2022 — Question 123

Exam: DBT JRF 2022 · Section: B · Topic: Bioinformatics › Unix/Linux Commands for Bioinformatics · Difficulty: Medium

## Question

Which one of the following lines of unix commands can tell you the number of lines in a file?

## Options

- **A.** pc - f
- **B.** ls - a
- **C.** df - h
- **D.** wc - l

## Answer

Option D

## Explanation

Unix/Linux commands — identifying 'wc -l': Common Unix commands: • wc -l filename: counts the number of LINES in a file. ('wc' = word count; '-l' = lines only) • ls -a: lists ALL files including hidden files (those starting with '.') • df -h: displays disk usage in human-readable format (df = disk free) • pc -f: NOT a standard Unix command (does not exist). Usage of wc: • wc filename: outputs lines, words, and characters • wc -l filename: lines only • wc -w filename: words only • wc -c filename: byte count Bioinformatics application: wc -l is routinely used to count sequences in FASTQ files (divide by 4), SAM/VCF records, etc. Answer: 'wc -l filename' counts the number of lines in a file.

Source: https://mypyqbuddy.com/questions/which-one-of-the-following-lines-of-unix-6a104cd5920734408bc0c78a
