if we create a file, in that 10 rows(means 1,2,....9,10
like). i want 7 row exactly, which command use in unix?
plz send this question.
Answers were Sorted based on User's Feedback
Answer / soumendra
ans- cut -d " " -f 1-7 <file name>
by this u can get all the 7 rows of ur file.
here i give 'space" as the delimeter.
u give the delimeter as u give in the file.
by -f option u can exactly get the 1 to 7 field/rows
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / mo
Using VI editor this can be done like this.
type this command.
:1,7w <newfilename>
All Good
Mo
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / meenu
if u want first 7 rows then
head -n7 <filename>
but if you want only 7th row then
awk 'nr==7 {print}' <fileanme>
or
tail -n4 <filename>|head -n1
| Is This Answer Correct ? | 0 Yes | 6 No |
How to know a process is a zombie or orphan process?
Which command is used to find whether the system is 32 bit or 64 bit?
Explain iostat, vmstat and netstat.
What is sed awk grep?
what is the use of "grep" command?
Where LOG fiels resides in AIX and pls tel me how to remove the log file
Why is it called grep?
How to copy multiple files and directories into some other directory?
How to use grep command to list find the records of a file containing 10 different strings?
Describe the usage and functionality of the command rm –r * in unix?
A file has 1000 lines and i want to display only 1st line how to do it? pls ..tel me
What is grep short for?