- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to display or cat 10th line to 20rth line of a...
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
Discussions
Discussions
Discussions
Forums
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
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-07-2008 01:10 AM
тАО10-07-2008 01:10 AM
How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2008 01:36 AM
тАО10-07-2008 01:36 AM
Re: How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
Use this command.
awk -v line=10 "NR==line" file_name -> to display 10th line.
awk -v line=20 "NR==line" file_name -> to display 20th line
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2008 01:43 AM
тАО10-07-2008 01:43 AM
Re: How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
You can also use this command.
sed -n '10 p' < file name -> to display 10th line
sed -n '20 p' < file name -> to display 20th line
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2008 01:44 AM
тАО10-07-2008 01:44 AM
Re: How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2008 01:45 AM
тАО10-07-2008 01:45 AM
Re: How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
HTH
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2008 01:48 AM
тАО10-07-2008 01:48 AM
Re: How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2008 01:50 AM
тАО10-07-2008 01:50 AM
Re: How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
cat fstab.org | awk '{if (NR >9) {print $0}}' | awk '{if (NR <12) {print $0}}'
HTH
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2008 01:54 AM
тАО10-07-2008 01:54 AM
Re: How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2008 02:11 AM
тАО10-07-2008 02:11 AM
Re: How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2008 02:11 AM
тАО10-07-2008 02:11 AM
Re: How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
You can play this trick with head and tail also. see below.
# head -10 filename |tail -1 -> display 10th line
# head -20 filename |tail -1 -> display 20th line.
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2008 03:02 AM
тАО10-07-2008 03:02 AM
Re: How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
Please read question again...
He wants display lines from 10 to 20( 10,11,12....up to 20). Not exactly 10th and 20.
Rgds
Sreekanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2008 03:16 AM
тАО10-07-2008 03:16 AM
Re: How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
Manoj, use this command.
#sed -n '10,20p'
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2008 05:05 AM
тАО10-07-2008 05:05 AM
Re: How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
perl -ne 'print if $.>=10; last if $.>=20'
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2008 05:47 PM
тАО10-07-2008 05:47 PM
Re: How to display or cat 10th line to 20rth line of a text file have 100 lines in HP UNIX
I used sed -n '10,20p'
Excellent job !!!!