Blog Archives

How To Install Grep 2.21 On Arch Linux, Manjaro And Arch Derivative Systems, Via AUR

Hello Linux Geeksters. As you may know, Grep is an open-source, command-line tool for searching plain-text data sets for lines that match regular expressions. The latest version available is Grep 2.21, which has been recently released, coming with the below

Tagged with: , , , , , ,
Posted in The Linux and Unix Articles!

Delete all the files not matching pattern with find and grep

In this article I will show you how to remove all the files that do not match a certain pattern, with grep and find, combined with grep: As an example, I will remove all the files not containing the string

Tagged with: , , , ,
Posted in The Linux and Unix Articles!

Oneliner: Count How Many Times a String Appears in a File

When working with text files, it is usefull to know how to count how many times a string appears in a file. To do that, use this oneliner: $ grep -o string /path/to/file | wc -l $ cat jedi jedi

Tagged with: , , , ,
Posted in The Linux and Unix Articles!
Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!