Member-only story
Text processing from the command line
( List of commands that can make you productive in pre-processing text file.)

Every time you want to manipulate your text file, you don’t need to spin up a programming language. The common use cases are while reading a log file directly from a file or input stream; you might want to filter the results, sort them, replace words or whatever your use case be there are few commands that will definitely help you in long run.
Let’s take a look at some of my favorite ones.
Cat:
Reading the whole files into the shell. Cat can work with single or multiple files.
cat file1.txt file2.txt
Head and Tail:
Get data from the top or bottom of your file or input stream.
head -n 5 logs.log
tail -n 6 logs.log
tail -f logs.log // -f means follow; while streaming see what is being written; used for reading logs
Word Count:
Count words, lines or characters with “wc” command.
wc -l file.log // Use -c & -w for characters and words -l means line
Exercise:
Verify that “tail” command prints exactly 10 lines using “wc” command:
tail logs.log | wc -l