TransWikia.com

How to delete files using grep?

Unix & Linux Asked on January 5, 2022

Here the result of this command :

sudo dpkg -l | grep mariadb

It returns me this :

ic  mariadb-server-10.3                        1:10.3.23+maria~bionic                           amd64        MariaDB database server binaries

and I need to delete all mariadb files. What is the next command line that I should run?

Thank for your help.

One Answer

$ for package in $( sudo dpkg -l | grep mariadb | awk ' $1 == "ic" { print $2 }' ); do apt remove "$package"; done

Answered by DopeGhoti on January 5, 2022

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP