Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/Thomas-George-T/HackerRank-The-Linux-Shell-Challenges-Solutions

Complete Solutions and related tutorials for the Linux Shell - Bash, text processing, Arrays in Bash, Grep Sed Awk Challenges on HackerRank
https://github.com/Thomas-George-T/HackerRank-The-Linux-Shell-Challenges-Solutions

awk bash challenge cut grep hackerrank hackerrank-solutions head linux linux-shell paste sed shell sort tail text-processing tr tutorial uniq unix

Last synced: 21 days ago
JSON representation

Complete Solutions and related tutorials for the Linux Shell - Bash, text processing, Arrays in Bash, Grep Sed Awk Challenges on HackerRank

Lists

README

        

![GitHub](https://img.shields.io/github/license/Thomas-George-T/HackerRank-The-Linux-Shell-Challenges-Solutions.svg?style=flat)
![GitHub top language](https://img.shields.io/github/languages/top/Thomas-George-T/HackerRank-The-Linux-Shell-Challenges-Solutions.svg?style=flat)
![GitHub last commit](https://img.shields.io/github/last-commit/Thomas-George-T/HackerRank-The-Linux-Shell-Challenges-Solutions.svg?style=flat)
![ViewCount](https://views.whatilearened.today/views/github/Thomas-George-T/HackerRank-The-Linux-Shell-Challenges-Solutions.svg?cache=remove)











## Description
Solutions to all the easy, medium and hard challenges compiled with related learning resources for the Linux Shell Challenges on HackerRank.

Domains included:
* [Bash Challenges](https://github.com/Thomas-George-T/HackerRank-The-Linux-Shell-Challenges-Solutions#bash-challenges)
* [Text Processing](https://github.com/Thomas-George-T/HackerRank-The-Linux-Shell-Challenges-Solutions#text-processing)
* [Arrays in Bash](https://github.com/Thomas-George-T/HackerRank-The-Linux-Shell-Challenges-Solutions#arrays-in-bash)
* [Grep Sed Awk](https://github.com/Thomas-George-T/HackerRank-The-Linux-Shell-Challenges-Solutions#grep-sed-awk)

## Bash Challenges

| Number | Challenges | Solutions |
|:------:|------------|:---------:|
| 1 |[Let's Echo!](https://www.hackerrank.com/challenges/bash-tutorials-lets-echo/problem) | [Solution.sh](Challenges/Bash/Let's%20Echo.sh)
| 2 |[Looping and Skipping](https://www.hackerrank.com/challenges/bash-tutorials---looping-and-skipping/problem) | [Solution.sh](Challenges/Bash/Looping%20and%20Skipping.sh)
| 3 |[A Personalized Echo](https://www.hackerrank.com/challenges/bash-tutorials---a-personalized-echo/problem) | [Solution.sh](Challenges/Bash/A%20Personalized%20Echo.sh)
| 4 |[Looping with numbers](https://www.hackerrank.com/challenges/bash-tutorials---looping-with-numbers/problem) | [Solution.sh](Challenges/Bash/Looping%20with%20Numbers.sh)
| 5 |[The World of Numbers](https://www.hackerrank.com/challenges/bash-tutorials---the-world-of-numbers/problem) | [Solution.sh](Challenges/Bash/The%20World%20of%20Numbers.sh)
| 6 |[Comparing Numbers](https://www.hackerrank.com/challenges/bash-tutorials---comparing-numbers/problem) | [Solution.sh](Challenges/Bash/Comparing%20Numbers.sh)
| 7 |[Getting started with conditionals](https://www.hackerrank.com/challenges/bash-tutorials---getting-started-with-conditionals/problem) | [Solution.sh](Challenges/Bash/Getting%20started%20with%20conditionals.sh)
| 8 |[More on Conditionals](https://www.hackerrank.com/challenges/bash-tutorials---more-on-conditionals/problem) | [Solution.sh](Challenges/Bash/More%20on%20Conditionals.sh)
| 9 |[Arithmetic Operations](https://www.hackerrank.com/challenges/bash-tutorials---arithmetic-operations/problem) | [Solution.sh](Challenges/Bash/Arithmetic%20Operations.sh)
| 10|[Compute the Average](https://www.hackerrank.com/challenges/bash-tutorials---compute-the-average/problem) | [Solution.sh](Challenges/Bash/Compute%20the%20average.sh)
| 11|[Functions and Fractals - Recursive Trees - Bash!](https://www.hackerrank.com/challenges/fractal-trees-all/problem) | [Solution.sh](Challenges/Bash/Functions%20and%20Fractals%20-%20Recursive%20Trees%20-%20Bash!.sh)

## Text Processing

| Number | Challenge | Solutions |
|:------:|-----------|:---------:|
|1|[Cut #1](https://www.hackerrank.com/challenges/text-processing-cut-1/problem) | [Solution](Challenges/Text%20Processing/Cut%20%231.sh) |
|2|[Cut #2](https://www.hackerrank.com/challenges/text-processing-cut-2/problem) | [Solution](Challenges/Text%20Processing/Cut%20%232.sh) |
|3|[Cut #3](https://www.hackerrank.com/challenges/text-processing-cut-3/problem) | [Solution](Challenges/Text%20Processing/Cut%20%233.sh) |
|4|[Cut #4](https://www.hackerrank.com/challenges/text-processing-cut-4/problem) | [Solution](Challenges/Text%20Processing/Cut%20%234%20.sh) |
|5|[Cut #5](https://www.hackerrank.com/challenges/text-processing-cut-5/problem) | [Solution](Challenges/Text%20Processing/Cut%20%235.sh) |
|6|[Cut #6](https://www.hackerrank.com/challenges/text-processing-cut-6/problem) | [Solution](Challenges/Text%20Processing/Cut%20%236.sh) |
|7|[Cut #7](https://www.hackerrank.com/challenges/text-processing-cut-7/problem) | [Solution](Challenges/Text%20Processing/Cut%20%237.sh) |
|8|[Cut #8](https://www.hackerrank.com/challenges/text-processing-cut-8/problem) | [Solution](Challenges/Text%20Processing/Cut%20%238.sh) |
|9|[Cut #9](https://www.hackerrank.com/challenges/text-processing-cut-9/problem) | [Solution](Challenges/Text%20Processing/Cut%20%239.sh) |
|10|[Head of a Text File #1](https://www.hackerrank.com/challenges/text-processing-head-1/problem) | [Solution](Challenges/Text%20Processing/Head%20of%20a%20Text%20File%20%231.sh) |
|11|[Head of a Text File #2](https://www.hackerrank.com/challenges/text-processing-head-2/problem) | [Solution](Challenges/Text%20Processing/Head%20of%20a%20Text%20File%20%232.sh) |
|12|[Middle of a Text File](https://www.hackerrank.com/challenges/text-processing-in-linux---the-middle-of-a-text-file/problem) | [Solution](Challenges/Text%20Processing/Middle%20of%20a%20Text%20File.sh) |
|13|[Tail of a Text File #1](https://www.hackerrank.com/challenges/text-processing-tail-1/problem) | [Solution](Challenges/Text%20Processing/Tail%20of%20a%20Text%20File%20%231.sh) |
|14|[Tail of a Text File #2](https://www.hackerrank.com/challenges/text-processing-tail-2/problem) | [Solution](Challenges/Text%20Processing/Tail%20of%20a%20Text%20File%20%232.sh) |
|15|['Tr' Command #1](https://www.hackerrank.com/challenges/text-processing-tr-1/problem) | [Solution](Challenges/Text%20Processing/'Tr'%20Command%20%231.sh) |
|16|['Tr' Command #2](https://www.hackerrank.com/challenges/text-processing-tr-2/problem) | [Solution](Challenges/Text%20Processing/'Tr'%20Command%20%232.sh) |
|17|['Tr' Command #3](https://www.hackerrank.com/challenges/text-processing-tr-3/problem) | [Solution](Challenges/Text%20Processing/'Tr'%20Command%20%233.sh) |
|18|[Sort Command #1](https://www.hackerrank.com/challenges/text-processing-sort-1/problem) | [Solution](Challenges/Text%20Processing/Sort%20Command%20%231.sh) |
|19|[Sort Command #2](https://www.hackerrank.com/challenges/text-processing-sort-2/problem) | [Solution](Challenges/Text%20Processing/Sort%20Command%20%232.sh) |
|20|[Sort Command #3](https://www.hackerrank.com/challenges/text-processing-sort-3/problem) | [Solution](Challenges/Text%20Processing/Sort%20Command%20%233.sh) |
|21|[Sort Command #4](https://www.hackerrank.com/challenges/text-processing-sort-4/problem) | [Solution](Challenges/Text%20Processing/Sort%20Command%20%234.sh) |
|22|[Sort Command #5](https://www.hackerrank.com/challenges/text-processing-sort-5/problem) | [Solution](Challenges/Text%20Processing/Sort%20Command%20%235.sh) |
|23|[Sort Command #6](https://www.hackerrank.com/challenges/text-processing-sort-6/problem) | [Solution](Challenges/Text%20Processing/Sort%20command%20%236.sh) |
|24|[Sort Command #7](https://www.hackerrank.com/challenges/text-processing-sort-7/problem) | [Solution](Challenges/Text%20Processing/Sort%20command%20%237.sh) |
|25|['Uniq' Command #1](https://www.hackerrank.com/challenges/text-processing-in-linux-the-uniq-command-1/problem) | [Solution](Challenges/Text%20Processing/'Uniq'%20Command%20%231.sh) |
|26|['Uniq' Command #2](https://www.hackerrank.com/challenges/text-processing-in-linux-the-uniq-command-2/problem) | [Solution](Challenges/Text%20Processing/'Uniq'%20Command%20%232.sh) |
|27|['Uniq' Command #3](https://www.hackerrank.com/challenges/text-processing-in-linux-the-uniq-command-3/problem)| [Solution](Challenges/Text%20Processing/'Uniq'%20Command%20%233.sh) |
|28|['Uniq' Command #4](https://www.hackerrank.com/challenges/text-processing-in-linux-the-uniq-command-4/problem) | [Solution](Challenges/Text%20Processing/'Uniq'%20Command%20%234.sh) |
|29|[Paste - 1](https://www.hackerrank.com/challenges/paste-1/problem) | [Solution](Challenges/Text%20Processing/Paste%20-%201.sh) |
|30|[Paste - 2](https://www.hackerrank.com/challenges/paste-2/problem) | [Solution](Challenges/Text%20Processing/Paste%20-%202.sh) |
|31|[Paste - 3](https://www.hackerrank.com/challenges/paste-3/problem) | [Solution](Challenges/Text%20Processing/Paste%20-%203.sh) |
|32|[Paste - 4](https://www.hackerrank.com/challenges/paste-4/problem) | [Solution](Challenges/Text%20Processing/Paste%20-%204.sh) |

## Arrays in Bash

| Number | Challenge | Solutions |
|:------:|-----------|:---------:|
|1|[Read in an Array](https://www.hackerrank.com/challenges/bash-tutorials-read-in-an-array/problem) | [Solution](Challenges/Arrays%20in%20Bash/Read%20in%20an%20Array.sh) |
|2|[Slice an Array](https://www.hackerrank.com/challenges/bash-tutorials-slice-an-array/problem) | [Solution](Challenges/Arrays%20in%20Bash/Slice%20an%20Array.sh) |
|3|[Filter an Array with Patterns](https://www.hackerrank.com/challenges/bash-tutorials-filter-an-array-with-patterns/problem) | [Solution](Challenges/Arrays%20in%20Bash/Filter%20an%20Array%20with%20Patterns.sh) |
|4|[Concatenate an array with itself](https://www.hackerrank.com/challenges/bash-tutorials-concatenate-an-array-with-itself/problem) | [Solution](Challenges/Arrays%20in%20Bash/Concatenate%20an%20array%20with%20itself.sh) |
|5|[Display an element of an array](https://www.hackerrank.com/challenges/bash-tutorials-display-the-third-element-of-an-array/problem) | [Solution](Challenges/Arrays%20in%20Bash/Display%20an%20element%20of%20an%20array.sh) |
|6|[Count the number of elements in an Array](https://www.hackerrank.com/challenges/bash-tutorials-count-the-number-of-elements-in-an-array/problem) | [Solution](Challenges/Arrays%20in%20Bash/Count%20the%20number%20of%20elements%20in%20an%20Array.sh) |
|7|[Remove the First Capital Letter from Each Element](https://www.hackerrank.com/challenges/bash-tutorials-remove-the-first-capital-letter-from-each-array-element/problem) | [Solution](Challenges/Arrays%20in%20Bash/Remove%20the%20First%20Capital%20Letter%20from%20Each%20Element.sh) |
|8|[Lonely Integer - Bash!](https://www.hackerrank.com/challenges/lonely-integer-2/problem) | [Solution](Challenges/Arrays%20in%20Bash/Lonely%20Integer%20-%20Bash!.sh) |

## Grep Sed Awk

| Number | Challenge | Solutions |
|:------:|-----------|:---------:|
|1|['Grep' #1](https://www.hackerrank.com/challenges/text-processing-in-linux-the-grep-command-1/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Grep'%20%231.sh) |
|2|['Grep' #2](https://www.hackerrank.com/challenges/text-processing-in-linux-the-grep-command-2/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Grep'%20%232.sh) |
|3|['Grep' #3](https://www.hackerrank.com/challenges/text-processing-in-linux-the-grep-command-3/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Grep'%20%233.sh) |
|4|['Grep' -A](https://www.hackerrank.com/challenges/text-processing-in-linux-the-grep-command-4/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Grep'%20-A.sh) |
|5|['Grep' -B](https://www.hackerrank.com/challenges/text-processing-in-linux-the-grep-command-5/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Grep'%20-%20B.sh) |
|6|['Sed' command #1](https://www.hackerrank.com/challenges/text-processing-in-linux-the-sed-command-1/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Sed'%20command%20%231.sh) |
|7|['Sed' command #2](https://www.hackerrank.com/challenges/text-processing-in-linux-the-sed-command-2/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Sed'%20command%20%232.sh) |
|8|['Sed' command #3](https://www.hackerrank.com/challenges/text-processing-in-linux-the-sed-command-3/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Sed'%20command%20%233.sh) |
|9|['Sed' command #4](https://www.hackerrank.com/challenges/sed-command-4/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Sed'%20command%20%234.sh) |
|10|['Sed' command #5](https://www.hackerrank.com/challenges/sed-command-5/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Sed'%20command%20%235.sh) |
|11|['Awk' - 1](https://www.hackerrank.com/challenges/awk-1/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Awk'%20-%201.sh) |
|12|['Awk' - 2](https://www.hackerrank.com/challenges/awk-2/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Awk'%20-%202.sh) |
|13|['Awk' - 3](https://www.hackerrank.com/challenges/awk-3/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Awk'%20-%203.sh) |
|14|['Awk' - 4](https://www.hackerrank.com/challenges/awk-4/problem) | [Solution](Challenges/Grep%20Sed%20Awk/'Awk'%20-%204.sh) |

## Featured in
- [lib4dev.in](http://www.lib4dev.in/info/Thomas-George-T/HackerRank-The-Linux-Shell-Challenges-Solutions/117837470)

## References, Tutorials and Relevant Materials

### General
* [Shell Scripting video tutorial](https://www.youtube.com/watch?v=hwrnmQumtPw)

### Bash
* [Refresher to Bash](https://learnxinyminutes.com/docs/bash/)
* [Quick guide to shell scripts](http://www.panix.com/~elflord/unix/bash-tute.html)
* [Catching user input](http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_08_02.html)
* [Loops in Bash](https://www.cyberciti.biz/faq/bash-for-loop/)

### Text Processing
* [Cut](https://www.geeksforgeeks.org/cut-command-linux-examples/)
* [Head](https://www.geeksforgeeks.org/head-command-linux-examples/)
* [Tr video](https://www.youtube.com/watch?v=RNuh1rqKIbg&feature=youtu.be)
* [Sort](https://www.thegeekstuff.com/2013/04/sort-files/)
* [Uniq video](https://youtu.be/VRrd9ErU13w)
* [Uniq](https://www.thegeekstuff.com/2013/05/uniq-command-examples/)
* [Paste video](https://www.youtube.com/watch?v=DCJPFjS_vss)
* [Paste](http://www.theunixschool.com/2012/07/10-examples-of-paste-command-usage-in.html)

### Arrays in Bash
* [Array Tutorial](https://www.thegeekstuff.com/2010/06/bash-array-tutorial/)