- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Newbie grep question...
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
11-06-2006 04:00 AM
11-06-2006 04:00 AM
ioscan -fnC disk | grep '/dev/rdsk/c7t0d1'
It returns the following...
/dev/dsk/c7t0d1 /dev/dsk/c7t0d1s2 /dev/rdsk/c7t0d1 /dev/rdsk/c7t0d1s2
/dev/dsk/c7t0d1s1 /dev/dsk/c7t0d1s3 /dev/rdsk/c7t0d1s1 /dev/rdsk/c7t0d1s3
I only want the first line, how do I do that?
If I want only the second line, how do I do that?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2006 04:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2006 04:06 AM
11-06-2006 04:06 AM
Re: Newbie grep question...
ioscan -fnC disk | grep '/dev/rdsk/c7t0d1' |tail -1
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2006 04:07 AM
11-06-2006 04:07 AM
Re: Newbie grep question...
ioscan -fnC disk | grep '/dev/rdsk/c7t0d1' | head -n1
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2006 04:07 AM
11-06-2006 04:07 AM
Re: Newbie grep question...
ioscan -fnC disk | grep '/dev/rdsk/c7t0d1' |head -2 |tail -1
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2006 04:08 AM
11-06-2006 04:08 AM
Re: Newbie grep question...
ioscan -fnC disk | grep -w '/dev/rdsk/c7t0d1'
Your second question is a bit trickier. What would be your criteria for returning only the second line? The fact that it is second? The fact that it doesn't include the /dev/rdsk/c7t0d1 string except with additional characters at the end? The fact that it includes s1 and s3 and not s2?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2006 04:29 AM
11-06-2006 04:29 AM
Re: Newbie grep question...
Thanks everyone!!!