


Using the –i option is a good habit of getting into, unless of course you are trying to nail down a more specific search. Second, we piped that output to grep –i python, which simple states “go to grep and filter out and return everything with ‘python’ in it.” The –i option is there to ignore-case, as grep is case-sensitive. Ii python-pam 0.4.2-12.2ubuntu4 A Python interface to the PAM libraryįirst, we ran dpkg –l, which lists installed *.deb packages on your system. Ii python-openssl 0.12-1ubuntu2.1 Python wrapper around the OpenSSL library Ii python2.7-minimal 2.7.3-0ubuntu3.4 Minimal subset of the Python language (version 2.7) Simply run this command: # dpkg -l | grep -i python Sample Output ii python2.7 2.7.3-0ubuntu3.4 Interactive high-level object-oriented language (version 2.7) You have been scouring the web looking for tutorials, but you see that there are two different versions of Python in use, and you don’t know which one was installed on your system by the Ubuntu installer, or if it installed any modules.

Let’s say that you have just installed a fresh copy of the new Ubuntu on your machine, and that you are going to give Python scripting a shot. I have found that the easiest way to get your feet wet with grep is to just dive right in and use some real world examples.
GREP USAGE LINUX INSTALL
$ sudo apt-get install grep #Debian/Ubuntu $ sudo yum install grep #RHEL/CentOS/Fedora If, for whatever reason, it is not installed on your system, you can easily install it via your package manager ( apt-get on Debian/ Ubuntu and yum on RHEL/ CentOS/ Fedora). Grep is a powerful file pattern searcher that comes equipped on every distribution of Linux. Have you ever been confronted with the task of looking for a particular string or pattern in a file, yet have no idea where to start looking? Well then, here is grep to the rescue! 12 Grep Command Examples
