LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-18-2004, 12:29 AM   #1
davidas
Member
 
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168

Rep: Reputation: 30
What does rpm -qa |grep th* (as compared to rpm -qa |grep th) display?


rpm -qa |grep th displays packages with "th" in their name.

What do rpm -qa |grep th* and rpm -qa |grep *th display? I don't quite understand the output. rpm -qa |grep th* seems to display any package with "t" in the name?!

Some concept teaching required here

Thanks !
 
Old 03-18-2004, 12:43 AM   #2
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Grep takes regular expressions, so "grep th*" is actually equivalent to "any line that has the letter 't' and any number of 'h'(including 0)".
If you want to grep for packages that start with "th", try
Code:
rpm -qa | grep ^th
 
Old 03-18-2004, 01:35 AM   #3
davidas
Member
 
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168

Original Poster
Rep: Reputation: 30
Could you elaborate on "regular expressions"? Does "grep th3" refers to "any line that has the letter 't' and 3 instances of 'h'"?

Thanks !

Quote:
Originally posted by Demonbane
Grep takes regular expressions, so "grep th*" is actually equivalent to "any line that has the letter 't' and any number of 'h'(including 0)".
If you want to grep for packages that start with "th", try
Code:
rpm -qa | grep ^th

Last edited by davidas; 03-18-2004 at 02:16 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grep ?? can grep us variables? DaFrEQ Linux - Software 4 09-14-2005 12:22 PM
rpm -qa | grep kernel gives wrong kernel version markelo Red Hat 3 07-18-2004 09:35 AM
"Undeleting" data using grep, but get "grep: memory exhausted" error SammyK Linux - Software 2 03-13-2004 03:11 PM
ps -ef|grep -v root|grep apache<<result maelstrombob Linux - Newbie 1 09-24-2003 11:38 AM
.src.rpm, .i386.rpm and .i686.rpm hhegab Linux - Software 2 06-19-2003 07:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration