02-19-2006, 12:18 AM
Like just extract line 1?
I would think it'd be something like
grep -l 1 or something..
I would think it'd be something like
grep -l 1 or something..
UNIX Command Question- How do I just extract line 'X'
|
02-19-2006, 12:18 AM
Like just extract line 1?
I would think it'd be something like grep -l 1 or something..
02-19-2006, 12:58 AM
If you want to do something like that, take a look at the man info for the 'more' or 'less' commands. That might be the appropriate tool for a simple job like that.
HTH hwystar
02-19-2006, 12:59 AM
Sweet, thanks yet again hwystar.
02-19-2006, 01:08 AM
You got over the smashed finger fast enough. Or are you typing with your toes?
02-19-2006, 01:21 AM
How about combining both 'head' and 'tail'?
To extract the 100th line head -n 100 thefilename.txt | tail -n 1
02-19-2006, 08:39 PM
HEAD(1) BSD General Commands Manual HEAD(1)
NAME head -- display first lines of a file SYNOPSIS head [-n count] [file ...] DESCRIPTION This filter displays the first count lines of each of the specified files, or of the standard input if no files are specified. If count is omitted it defaults to 10. If more than a single file is specified, each file is preceded by a header consisting of the string ``==> XXX <=='' where ``XXX'' is the name of the file. |
« Next Oldest | Next Newest »
|