- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- grep .profile * ? yields all lines with profile as...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2004 12:22 PM
10-04-2004 12:22 PM
# grep .profile *
shows all lines with profile in it.
How do just grep for lines in file with the dot profile (.profile)
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2004 12:29 PM
10-04-2004 12:29 PM
Re: grep .profile * ? yields all lines with profile as well ? Only need files with (dot) .profile ?
# grep \.profile *
# grep ".profile" *
man regexp will cover the special characters used for pattern matching.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2004 12:39 PM
10-04-2004 12:39 PM
Re: grep .profile * ? yields all lines with profile as well ? Only need files with (dot) .profile ?
actually, That was what i had thought. But I had earlier tried both the commands as specified by you but I still get lines with profile in it. Don't have unix box in front of me so I could give you an example. Does that work on your unix server ?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2004 01:10 PM
10-04-2004 01:10 PM
Solution# fgrep .profile *
equals
# grep -F .profile *
equals (almost the same, but the effect is the same)
# grep '\.profile' *
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2004 01:58 PM
10-04-2004 01:58 PM
Re: grep .profile * ? yields all lines with profile as well ? Only need files with (dot) .profile ?
$ type grep
grep is /usr/bin/grep
This verifies what you will get when you type grep on the command line (essentially obsoletes which and whereis). You might have an alternate grep installed. The suggestion to use fgrep (or grep -F) is a good one too.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2004 04:55 PM
10-04-2004 04:55 PM
Re: grep .profile * ? yields all lines with profile as well ? Only need files with (dot) .profile ?
Bill- Tried the 2 commands but yield similar results (see below)
But grep -F would work
# which grep
/usr/bin/grep
# grep \.subir *
vic.pl:#system ("echo DATE is `date` >> $vic_log 2>&1;cat $vic_log | mailx -s '$
vp' subir_pokhriyal\@dom.com 2>&1");
vic1.pl:$int_org="/home/paradigm/scripts/VIC/vic1.load" .subir test ;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2004 04:56 PM
10-04-2004 04:56 PM