How to view 10 lines from history command
Hi,
How to view 10 starting lines from history command without using tail,head & more command |
Code:
history | head -10 |
I dont want to use head,more,less & tail. I only want to view the starting lines in history
|
But head is exactly the tool for the job, why would you not use it?
Do you use a hammer to put in screws? |
It is possible without these too, try to help it out instead of commenting..............
|
I agree with descendant_command. head and tail are the tools to use.
But you can do this if you really don't want to use either of those: Code:
history | awk '{ if ( NR <= 10 ) print }' |
You can use the bash built-in fc (just read it from the bash man page)
Code:
fc -l -10 |
do you know the command fc? try: fc -l 1 10
_____________________________________ If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post. Happy with solution ... mark as SOLVED (located in the "thread tools") |
Quote:
|
Thanks all it resolves my problem.
|
All times are GMT -5. The time now is 07:47 PM. |