what is the command to print last 8 lines of any text file.
Answers were Sorted based on User's Feedback
Answer / santosh sathe
1) use tail -8 filename
2) This will print last three lines of a file
cat 1.lst
hi
hello
bye
good
morning
sed -n '1,2!p' 1.lst
o/p
bye
good
morning
The last 3 lines are printed.sed command uses !(negation)
operator for skipping the 1st and 2nd line,That means it
will print all the lines except 1st and 2nd.
| Is This Answer Correct ? | 0 Yes | 1 No |
Assume that a file’s permissions give you read and write access. What operations can you perform on the file if it is in a directory which has “r”(read) only process? What operations can you perform on the file if it is in a directory which has “x”(execute) only access?
What are the general commands in using unix os for a beginner?
What do chown command do?
What command will change your prompt to myprompt?
write grep commands to select the lines that have exactly two characters
What is the use of tee command?
What does mkdir up2date; touch outdated up2date do?
what is the use of "grep" command?
What is rmdir command?
What is unix command?
What is the use of touch command in there?
What do chmod command do?